我已經創建的窗口,組合框,利用林間空地和代碼按鈕如下:組合框在gtk2hs,林間空地
module Main where
import Graphics.UI.Gtk
import Graphics.UI.Gtk.Glade
main = do
initGUI
Just xml <- xmlNew "Tp.glade"
window <- xmlGetWidget xml castToWindow "window1"
button <- xmlGetWidget xml castToButton "button1"
comboBox <- xmlGetWidget xml castToComboBox "combobox1"
onClicked button $ do
putStrLn $ "Apply button selected "
selected <- comboBoxGetActiveText comboBox
print selected
onDestroy window mainQuit
widgetShowAll window
mainGUI
如果我從ComboBox中選擇一個選項,並單擊動作按鈕,它顯示了以下錯誤消息 UI.exe:用戶錯誤(在模式匹配失敗做在GTK \圖形\ UI表達\ G變 TK \ MenuComboToolbar \ ComboBox.chs.pp:244:2-13)
我需要將行爲分開的函數爲p當我從ComboBox中選擇一個選項時是否有錯誤?請幫幫我!!