سؤال

My problem is very confusing to me because it occurs only on Windows (I am testing with XP). It all works perfectly on Linux.

I am using gtkbuilder to load my layout. (in case it's important)

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

Prints:

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

In the window, it displays a combo box with three entries, all of them blank I hit the "ok" button, which runs the following code in its signal handler:

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

Prints:

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

Does anyone have any ideas regarding this?

هل كانت مفيدة؟

المحلول

Ok, it turns out that it was a package version issue. The gtk package in the Windows version was one version number higher than the version on the Linux machines. That must have broken something.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top