2013-12-10 25 views
2

我的問題讓我很困惑,因爲它只發生在Windows上(我正在使用XP進行測試)。它在Linux上完美運行。gtk2hs:無法在Windows上顯示組合框

我正在使用gtkbuilder加載我的佈局。 (如果它是很重要的)

route_input <- builderGetObject builder castToComboBox "route" 
comboBoxSetModelText route_input 
comboBoxAppendText route_input "first" 
comboBoxAppendText route_input "second" 
comboBoxAppendText route_input "third" 
t <- listStoreToList =<< comboBoxGetModelText route_input 
putStrLn $ show t 

打印:

["first","second","third"] 

在窗口中,它顯示有三個條目的組合框,所有這些空白 我點擊「確定」按鈕,它運行在它的信號處理程序下面的代碼:

t <- listStoreToList =<< comboBoxGetModelText cbox 
putStrLn $ show t 
selection <- comboBoxGetActiveText cbox 
putStrLn $ show selection 

打印:

["first","second","third"] 
Nothing 

有沒有人有任何想法?

回答

0

好吧,事實證明這是一個軟件包版本問題。 Windows版本中的gtk軟件包比Linux機器上的版本高一個版本號。這肯定會破壞一些東西。