我用下面的代码加载我的GUI的要素:
import Graphics.UI.Gtk
main = do
initGUI
-- loading
builder <- builderNew
builderAddFromFile builder "gui.glade"
window <- builderGetObject builder castToWindow "window"
onDestroy window mainQuit
widgetShowAll window
mainGUI
我怎么能访问ListStore
名为“listStore”,怎么样,我访问的Window
名为“窗口”
例:
-- doesn't compile because castToListStore is part of a hidden module, unlike castToWindow :(
listStore <- builderGetObject builder castToListStore "listStore"