Change gtk window state from callback

111 views Asked by At

I have a simple GTK window with menu bar which has Open item. It gets filename inside callback of menuItemActivate:

openPressed = do
    chooser <- fileChooserDialogNew

...
    filename <- performResponse res chooser
        widgetHide chooser
        where
            performResponse ResponseCancel _ = return ("")
            performResponse ResponseOk chooser = do
                Just fname <- fileChooserGetFilename chooser
                putStrLn fname 
                --how can i put filename in label inside MainForm from here?
                return fname

How can I put filename to label located in my main window if openPressed is not nested in the main function which initialize main window?

0

There are 0 answers