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.
表 10. GdkEvent properties
GdkEventType | property | GdkEventMask |
---|
GDK_NOTHING | GDK_DELETE | GDK_DESTROY |
| | |
| | |
| | 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 |
| | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
|
GDK_KEY_PRESS | GDK_KEY_RELEASE |
| | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK |
|
GDK_ENTER_NOTIFY | GDK_LEAVE_NOTIFY |
| | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK |
|
| | |
| | |
| | |
| | |
GDK_SELECTION_CLEAR | GDK_SELECTION_REQUEST | GDK_SELECTION_NOTIFY |
| | |
GDK_PROXIMITY_IN | GDK_PROXIMITY_OUT |
| | 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 |
| | |
| | |
| | GDK_VISIBILITY_NOTIFY_MASK |
|
| | |