我有一个简单的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
没有嵌套在初始化主窗口的主函数中,如何将文件名放到主窗口中的标签上?