我使用下面改编自教程的代码。它在下拉列表中显示了两个选项,但是当我选择一个时,它会在控制台中显示错误:
(组合:12158):Gtk-CRITICAL **:IA__gtk_entry_set_text:断言“文本!= NULL”失败
import Graphics.UI.Gtk
import Graphics.UI.Gtk.Gdk.EventM
import Graphics.UI.Gtk.Gdk.GC
main = do
initGUI
window <- windowNew
window `onDestroy` mainQuit
windowSetDefaultSize window 800 600
windowSetPosition window WinPosCenter
store <- listStoreNew ["one", "two"]
combo <- comboBoxEntryNewWithModel store
ren <- cellRendererTextNew
cellLayoutPackEnd combo ren False
cellLayoutSetAttributes combo ren store
(\txt -> [cellText := txt])
containerAdd window combo
widgetShowAll window
mainGUI