Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/haskell/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Haskell Gtk2hs中的组合框编译错误_Haskell_Combobox_Gtk2hs - Fatal编程技术网

Haskell Gtk2hs中的组合框编译错误

Haskell Gtk2hs中的组合框编译错误,haskell,combobox,gtk2hs,Haskell,Combobox,Gtk2hs,如何使用Gtk2hs处理组合框? 在第页,我找到了一个解决方案: store <- listStoreNew ["green", "yellow", "..."] comboElem <- comboBoxNewWithModel store ren <- cellRendererTextNew cellLayoutPackEnd comboElem ren True cellLayoutSetAttributes comboElem ren store (\txt -&g

如何使用Gtk2hs处理组合框? 在第页,我找到了一个解决方案:

store <- listStoreNew ["green", "yellow", "..."]
comboElem <- comboBoxNewWithModel store
ren <- cellRendererTextNew
cellLayoutPackEnd comboElem ren True
cellLayoutSetAttributes comboElem ren store
  (\txt -> [cellText := Just txt])
我怎样才能解决这个问题


提前感谢

似乎没有
可能字符串的实例。它可能在某一点上有错误,但您应该能够只使用
cellText:=txt
。如果出于任何原因需要使用
可能字符串
,您可以自己实现该实例。

可能更多的是
cellText
的属性类型在某个点(在某些Gtk2HS版本中)从
GlibString a=>可能a
更改为
GlibString a=>a
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]