GtkWidget::add_events

GtkWidget::add_events

This method is used to set the GdkEventMask flags on a widget, extending the type of event that the widget can capture from its default capabilities. You may need to do this, for instance, to capture a button press event on a widget that does not normally capture such events.

add_events() can only be used after a widget has had realize() called on it. Note that realization is a part of the show() routine as well as being a method/signal pair in its own right.

Staying with the button-press example, the syntax would be: $widget->add_events(GDK_BUTTON_PRESS_MASK|GDK_BUTTON_RELEASE_MASK); This would enable a previously mouse-insensitive widget to emit "button-press-event" and "button-release-event" signals.

© Copyright 2003-2023 www.php-editors.com. The ultimate PHP Editor and PHP IDE site.