从回调更改gtk窗口状态

时间:2018-03-01 16:43:48

标签: haskell functional-programming gtk2hs

我有一个简单的GTK窗口,其菜单栏有Open项。它在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

如果openPressed没有嵌套在初始化主窗口的主函数中,如何将文件名放到主窗口中的标签上?

0 个答案:

没有答案