Re: [gtk-list] How to handle events on arrow widget




On Mon, 7 Sep 1998, Xiong Shao Jun wrote:
> gtk_widget_show(arrow);
>

One problem is that this realizes the arrow widget; you need to set_events
before you realize. 
 
> gtk_widget_set_events(arrow,   GDK_BUTTON_PRESS_MASK |
>                                                 GDK_KEY_PRESS_MASK |
>                                                 GDK_ENTER_NOTIFY_MASK);
>

Too late!
 
> But the event handlers are not called. So how to handle events on
> arrows? Should I have
> to use event box, and pack the arrow into the event box, then handle
> events on event box?
> 

If the arrow widget has no GdkWindow, you do have to use an event box. 
Look in the realize function for the arrow widget and see if it creates a
window. If the arrow widget has no window, you will have to set_events on
the event box and connect your handlers to the event box.

I think there's also a GTK_WIDGET_NO_WINDOW macro to determine if a widget
has a window.

Havoc




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