【发布时间】:2016-08-25 15:22:36
【问题描述】:
如何使用 Gtk2hs 处理 ComboBox? 在this 页面上,我找到了解决方案:
store <- listStoreNew ["green", "yellow", "..."]
comboElem <- comboBoxNewWithModel store
ren <- cellRendererTextNew
cellLayoutPackEnd comboElem ren True
cellLayoutSetAttributes comboElem ren store
(\txt -> [cellText := Just txt])
但是在编译时出现此错误(发生在我的代码示例的最后一行):
Main.hs:36:17:
No instance for (System.Glib.UTFString.GlibString (Maybe [Char]))
arising from a use of ‘cellText’
In the first argument of ‘(:=)’, namely ‘cellText’
In the expression: cellText := Just txt
In the expression: [cellText := Just txt]
我该如何解决这个问题?
提前致谢
【问题讨论】: