[Haskell-cafe] Pure functional GUI (was

Marc Weber marco-oweber at gmx.de
Wed Aug 8 22:54:05 EDT 2007


>    Other question on using gtk from haskell: how easy is it to integrate
>    with glade?  ie, can we directly bind glade form elements to haskell
>    variables?  How easy is it to bind events to glade form elements from
>    within Haskell?
Download the source and have a look at the demo/glade folder.. ;-) (I've
pasted the most important lines below)

Marc

         [...]
         -- load up the glade file
         dialogXmlM <- xmlNew "simple.glade"
         let dialogXml = case dialogXmlM of
               (Just dialogXml) -> dialogXml
               Nothing -> error "can't find the glade file \"simple.glade\" \
                                \in the current directory"
         
         -- get a handle on a couple widgets from the glade file
         window <- xmlGetWidget dialogXml castToWindow "window1"
         button <- xmlGetWidget dialogXml castToButton "button1"
         [...]


More information about the Haskell-Cafe mailing list