I have created a GUI using gtk2hs and glade and then passed it to haskell code in the main::IO()
. Then I have some coding for the windows say for labels, buttons and entry text. e.g.,
entry <- xmlGetWidget xml castToEntry "entry1"
applyButton <- xmlGetWidget xml castToButton "button1"
Then after clicking on the applybutton
onClicked applyButton $ do
number <- get entry entryText
Passed the value to a variable number
Then I wrote a function for squaring the number like this
sqr :: Int -> Int -> IO ()
sqr number = number * number
after the mainGUI.
Which doesn't work!!!!!!
It is supposed to be work as
I/p: Get a number from the user in GUI
o/p: Square of the number displayed in GUI