Event


Object Hierarchy:

Gdk.Event Gdk.Event Gdk.Event

Description:

[ CCode ( copy_function = "g_boxed_copy" , free_function = "g_boxed_free" , type_id = "gdk_event_get_type ()" ) ]
[ Compact ]
public class Event

A Event contains a union of all of the event types, and allows access to the data fields in a number of ways.

The event type is always the first field in all of the event types, and can always be accessed with the following code, no matter what type of event it is:

  GdkEvent *event;
GdkEventType type;

type = event->type;

To access other fields of the event, the pointer to the event can be cast to the appropriate event type, or the union member name can be used. For example if the event type is gdk_button_press then the x coordinate of the button press can be accessed with:

  GdkEvent *event;
gdouble x;

x = ((GdkEventButton*)event)->x;
or:
  GdkEvent *event;
gdouble x;

x = event->button.x;


Namespace: Gdk
Package: gdk-3.0

Content:

Properties:

Static methods:

Creation methods:

Methods:

Fields: