我的问题让我很困惑,因为它只发生在 Windows 上(我正在使用 XP 进行测试)。这一切都在 Linux 上完美运行。
我正在使用 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
有人对此有任何想法吗?