Ticket #1138: Hello.hs

File Hello.hs, 0.5 kB (added by guest, 6 years ago)
Line 
1import Graphics.UI.Gtk
2import Graphics.UI.Gtk.ModelView as Mod
3
4main :: IO ()
5main = do
6  initGUI
7  window <- windowNew
8  button <- buttonNew
9  (cView,cStore) <- Mod.comboBoxNewText id ["a","b","c"]
10  vp <- vPanedNew
11  set window [ containerBorderWidth := 10,
12               containerChild := vp ]
13  set button [ buttonLabel := "Add Item" ]
14  panedPack1 vp button True False
15  panedPack2 vp cView True False
16  onClicked button (Mod.listStoreAppend cStore "d" >> return ())
17 
18  onDestroy window mainQuit
19  widgetShowAll window
20  mainGUI