Re: Creating a new widget after the program has started.

J. Davison de St. Germain wrote:


  In our application, we sometimes create new widgets after the
program is up and running.  (These new widgets are GL Windows.)
However, when we try to bind events to them (eg: have them catch mouse
clicks), they don't respond.  Does anyone know if this is something
that should just work?  Or is it a known problem?  Any ideas would
help us greatly.

Just an idea: are you sure that your widgets have the right event mask ?
If you want to catch mouse clicks you have to connect to "button-press-event" signal and also call gtk_widget_add_events() function with GDK_BUTTON_PRESS_MASK
as a second parameter.

You also can take a look at examples coming with gtk like "scribble-simple" and "eventbox".


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