From: Axel S. <A....@ke...> - 2007-04-05 07:54:06
|
On Apr 5, 2007, at 5:59, Daniel Wagner wrote: > Hello all, > > I got this error while working on a preliminary hello-world type > project. I talked with dcoutts on #haskell, who suggested that > this means there could be a bug in gtk2hs, so here's a very > stripped-down version that exhibits the same behavior. I use ghc > 6.4.1 and gtk2hs 0.9.11. > > This creates a window with a single button; either pressing tab or > clicking the button will cause the error in the subject line to > appear. I suspect that tabbing and clicking are the result of two > separate problems, but of course I don't really know. I think the only bug here is that we didn't bind onSetFocus directly. I suppose that the widget that is passed to the handler constitutes the widget from which the focus came (but I really would have to check that). Thus, if the focus comes from outside the application, this widget is going to be NULL. We should have passed the widget as (Maybe Widget) which would then be Nothing in this case. We'll fix and document that. Thanks for reporting, Axel. > Thanks! > ~d > import Graphics.UI.Gtk > > queryWidget :: Widget -> IO () > queryWidget x = widgetGetName x >> return () > > main = do > initGUI > window <- windowNew > button <- buttonNew > > set window [containerChild := button] > set button [buttonLabel := "click me or press tab to die"] > > onClicked button (widgetDestroy window) > onDestroy window mainQuit > onSetFocus window queryWidget > > widgetShowAll window > mainGUI > ---------------------------------------------------------------------- > --- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to > share your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php? > page=join.php&p=sourceforge&CID=DEVDEV________________________________ > _______________ > Gtk2hs-devel mailing list > Gtk...@li... > https://lists.sourceforge.net/lists/listinfo/gtk2hs-devel |