module Main where import Barrie demoWidget :: Widget demoWidget = vbox [ui "fst label" (textLabel "fst label"), ui "snd label" (textLabel "snd label"), mkPopup "demo popup" popupWidget (labelButton "click me")] popupWidget :: Widget popupWidget = vbox [ui "textEditor" textBox, ui "close" $ labelButton "Close"] type DemoState = (String, String) type DemoGadget = Gadget DemoState type PopupState = String type PopupGadget = Gadget PopupState demoGUI :: DemoGadget demoGUI = sectionG "demo gui" [displayG "fst label" fst, displayG "snd label" snd, childG "demo popup" fst (\ x (_,y) -> (x,y)) popupGUI] popupGUI :: PopupGadget popupGUI = sectionG "popup" [editorG "textEditor" id (\ s _ -> s), returnG "close" ] main = do mapM_ putStrLn (abstract demoGUI) gtkMain demoGUI demoWidget ("change me", "can't change me")