Re: When to call widget_set_events




Lionel ULMER <ulmer@email.enst.fr> writes:

>   In writing an 'animation control' for my Quake 2 model viewer, I
> stumbled on something strange. This control (a bit like the control in
> Gimp's gradient editor) is a Drawing Area. When I pack it in a box,
> and then call "widget_set_events" to catch mouse and exposure events,
> I get only MAP and CONFIGURE, and not those specified in the event
> mask... If I move the 'set_events' before the 'bok_pack_start', it works
> fine.
> 
>   I (still :-) ) use Gtk+ 1.0.0...
> 
>   Is this a : 
>    1) FAQ, then I apologize :-)
>    2) something that is designed that way
>    3) a known "feature"

Somewhere between 1-2 and 3. The situation is that you must
call set_events very early in the life cycle of a widget -
before the X window for the widget is created (you'll get
a warning if you call it afterwards, I believe). 

Since it is sometimes a bit hard to predict exactly when GDK will
decide to realize (create the window for) you widget, the answer to
your question "when to call widget_set_events", is "as early as
possible".

                                        Owen



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]