From: Andy S. <laz...@gm...> - 2010-09-30 08:50:56
|
Hi Oleg, I remember someone has send same patch as yours. We have fix this problem in gtk2hs darcs : http://code.haskell.org/gtk2hs/gtk/Graphics/UI/Gtk/Abstract/Container.chs Thanks for patch! :) -- Andy Oleg Belozeorov <up...@gm...> writes: > Hi, > > Connecting to Container's setFocusChild signal crashes the program. This > is because Gtk+ emits the "set-focus-child" signal not only when a child > gets focus but also when it looses focus. The attached patch fixes that. > > > diff --git a/Graphics/UI/Gtk/Abstract/Container.chs b/Graphics/UI/Gtk/Abstract/Container.chs > index 452c3f6..3936272 100644 > --- a/Graphics/UI/Gtk/Abstract/Container.chs > +++ b/Graphics/UI/Gtk/Abstract/Container.chs > @@ -527,10 +527,10 @@ checkResize :: ContainerClass self => Signal self (IO ()) > checkResize = Signal (connect_NONE__NONE "check_resize") > > -- %hash c:b3a d:af3f > --- | A widget in the container received the input focus. > +-- | A widget in the container received or lost the input focus. > -- > -setFocusChild :: ContainerClass self => Signal self (Widget -> IO ()) > -setFocusChild = Signal (connect_OBJECT__NONE "set-focus-child") > +setFocusChild :: ContainerClass self => Signal self (Maybe Widget -> IO ()) > +setFocusChild = Signal (connect_MOBJECT__NONE "set-focus-child") > > -------------------- > -- Deprecated Signals > @@ -580,15 +580,15 @@ afterCheckResize = connect_NONE__NONE "check_resize" True > > -- %hash c:1ac6 > onSetFocusChild :: ContainerClass self => self > - -> (Widget -> IO ()) > + -> (Maybe Widget -> IO ()) > -> IO (ConnectId self) > -onSetFocusChild = connect_OBJECT__NONE "set-focus-child" False > +onSetFocusChild = connect_MOBJECT__NONE "set-focus-child" False > {-# DEPRECATED onSetFocusChild "instead of 'onSetFocusChild obj' use 'on obj setFocusChild'" #-} > > -- %hash c:23e5 > afterSetFocusChild :: ContainerClass self => self > - -> (Widget -> IO ()) > + -> (Maybe Widget -> IO ()) > -> IO (ConnectId self) > -afterSetFocusChild = connect_OBJECT__NONE "set-focus-child" True > +afterSetFocusChild = connect_MOBJECT__NONE "set-focus-child" True > {-# DEPRECATED afterSetFocusChild "instead of 'afterSetFocusChild obj' use 'after obj setFocusChild'" #-} > #endif > > ------------------------------------------------------------------------------ > Start uncovering the many advantages of virtual appliances > and start using them to simplify application deployment and > accelerate your shift to cloud computing. > http://p.sf.net/sfu/novell-sfdev2dev_______________________________________________ > Gtk2hs-users mailing list > Gtk...@li... > https://lists.sourceforge.net/lists/listinfo/gtk2hs-users |