I just started using gtk2hs (gtk3 in hackage) and ran into some problems with comboBoxes. I cannot make a simple comboBoxNewText displaying its rows. I commented on everything unnecessary in my application, so I have a basic structure for the actual window.
import Graphics.UI.Gtk
import Control.Monad.IO.Class
main = do
initGUI
window <- windowNew
set window [windowTitle := "Table", containerBorderWidth := 20,
windowDefaultWidth := 800, windowDefaultHeight := 600]
table <- tableNew 10 10 True
containerAdd window table
lbox <- hBoxNew False 0
rbox <- hBoxNew False 0
tableAttachDefaults table lbox 0 3 0 10
tableAttachDefaults table rbox 3 10 0 10
cb <- comboBoxNewText
comboBoxAppendText cb "test"
boxPackStart lbox cb PackGrow 10
on window deleteEvent $ liftIO mainQuit >> return False
widgetShowAll window
mainGUI
Am I missing something? gtk3 marked as unstable iirc on the hack, could this be a mistake? Or am I just doing something wrong? Adding comboBoxSetActive cb 0doesn't help either. To clarify, the actual combo box appears when the program starts, but it does not contain lines / is empty.
image of Evernote
source
share