GdkEvent

GdkEvent

One of the stream of mainloop events.

Object Hierarchy

Direct subclasses

None.

Description

A GdkEvent is one of the continual stream of events that help make up the GTK main loop. Events crossing a widget indicate some form of activity - generally, but not exclusively, user activity.

There are 32 different kinds of GdkEvent, each of which has only the properties appropriate to it exposed. Those differences are keyed using an enumerated value known as GdkEventType, which is a type property of both GdkEventAny and GdkEvent itself. Confused yet? That'll be because GdkEvent has a union structure, which is unique in GTK+ programming, and because the type property is intentionally accessible both through $event->type and through $any->type.

Each event carries GdkEventType and GdkEventAny information. Beyond that, the properties that can be accessed within an event depend completely on its type. See the table below for details.

The types of event that can be captured by an object depend on the GdkEventMask or masks that are in effect on that object. Each GTK widget is created with a set of these flags; this base set can be added to or limited within PHP-GTK using set_events() or add_events() as appropriate. The masks required by each event type are also listed in the table below, where applicable.

See also: GtkEventBox, add_events() , set_events() , and the section on events in the Userguide.

Further reading: The relevant chapter of Havoc Pennington's GTK+ / Gnome Application Development provides an in-depth overview of GDK events. It's aimed at C programmers, but is easy to read despite that caveat.

Table 10. GdkEvent properties

GdkEventTypepropertyGdkEventMask
GDK_NOTHING
GDK_DELETE
GDK_DESTROY
GDK_EXPOSE
expose
GDK_EXPOSURE_MASK
GDK_MOTION_NOTIFY
motion
GDK_POINTER_MOTION_MASK
GDK_BUTTON1_MOTION_MASK
GDK_BUTTON2_MOTION_MASK
GDK_BUTTON3_MOTION_MASK
GDK_BUTTON_PRESS
GDK_2BUTTON_PRESS
GDK_3BUTTON_PRESS
GDK_BUTTON_RELEASE
button
GDK_BUTTON_PRESS_MASK
GDK_BUTTON_RELEASE_MASK
GDK_KEY_PRESS
GDK_KEY_RELEASE
key
GDK_KEY_PRESS_MASK
GDK_KEY_RELEASE_MASK
GDK_ENTER_NOTIFY
GDK_LEAVE_NOTIFY
crossing
GDK_ENTER_NOTIFY_MASK
GDK_LEAVE_NOTIFY_MASK
GDK_FOCUS_CHANGE
focus_change
GDK_FOCUS_CHANGE_MASK
GDK_CONFIGURE
configure
GDK_MAP
GDK_UNMAP
GDK_PROPERTY_NOTIFY
property
GDK_PROPERTY_CHANGE_MASK
GDK_SELECTION_CLEAR
GDK_SELECTION_REQUEST
GDK_SELECTION_NOTIFY
selection
GDK_PROXIMITY_IN
GDK_PROXIMITY_OUT
proximity
GDK_PROXIMITY_IN_MASK
GDK_PROXIMITY_OUT_MASK
GDK_DRAG_ENTER
GDK_DRAG_LEAVE
GDK_DRAG_MOTION
GDK_DRAG_STATUS
GDK_DROP_START
GDK_DROP_FINISH
dnd
GDK_CLIENT_EVENT
client
GDK_VISIBILITY_NOTIFY
visibility
GDK_VISIBILITY_NOTIFY_MASK
GDK_NO_EXPOSE
no_expose

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