我正在使用以下代码来加载我的 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"