4
import Graphics.UI.Gtk.Glade
9
-- load up the glade file
10
dialogXmlM <- xmlNew "simple.glade"
11
let dialogXml = case dialogXmlM of
12
(Just dialogXml) -> dialogXml
13
Nothing -> error "can't find the glade file \"simple.glade\" \
14
\in the current directory"
16
-- get a handle on a couple widgets from the glade file
17
window <- xmlGetWidget dialogXml castToWindow "window1"
18
button <- xmlGetWidget dialogXml castToButton "button1"
20
-- do something with the widgets, just to prove it works
21
button `onClicked` putStrLn "button pressed!"
22
window `onDestroy` mainQuit