W Wrapl, The Programming Language



DoEvent(event @ Gtk.Gdk.Event.T) : Std.Object.T

Processes a single GDK event. This is public only to allow filtering of events between GDK and GTK+. You will not usually need to call this function directly.

While you should not call this function directly, you might want to know how exactly events are handled. So here is what this function does with the event:

  1. Compress enter/leave notify events. If the event passed build an enter/leave pair together with the next event (peeked from GDK) both events are thrown away. This is to avoid a backlog of (de-)highlighting widgets crossed by the pointer.

  2. Find the widget which got the event. If the widget can't be determined the event is thrown away unless it belongs to a INCR transaction. In that case it is passed to gtk_selection_incr_event().

  3. Then the event is passed on a stack so you can query the currently handled event with Gtk.Gtk.Global.GetCurrentEvent.

  4. The event is sent to a widget. If a grab is active all events for widgets that are not in the contained in the grab widget are sent to the latter with a few exceptions:

    • Deletion and destruction events are still sent to the event widget for obvious reasons.

    • Events which directly relate to the visual representation of the event widget.

    • Leave events are delivered to the event widget if there was an enter event delivered to it before without the paired leave event.

    • Drag events are not redirected because it is unclear what the semantics of that would be.

InitAdd(function @ Std.Function.T, data @ Std.Address.T) : Std.Object.T


InitAdd is deprecated and should not be used in newly-written code. This function is going to be removed in GTK+ 3.0

Iteration() : Std.Symbol.T

Runs a single iteration of the mainloop. If no events are waiting to be processed GTK+ will block until the next event is noticed. If you don't want to block look at IterationDo or check if any events are pending with Gtk.Gtk.Global.EventsPending first.

Returns TRUE if Quit has been called for the innermost mainloop.

IterationDo(blocking @ Std.Symbol.T) : Std.Symbol.T

Runs a single iteration of the mainloop. If no events are available either return or block dependent on the value of blocking.

blocking TRUE if you want GTK+ to block if no events are pending.
Returns TRUE if Quit has been called for the innermost mainloop.

Level() : Std.Integer.SmallT

Asks for the current nesting level of the main loop. This can be useful when calling Gtk.Gtk.Quit.Add.

Returns the nesting level of the current invocation of the main loop.

Quit() : Std.Object.T

Makes the innermost invocation of the main loop return when it regains control.

Run() : Std.Object.T

Runs the main loop until Quit is called. You can nest calls to Run. In that case Quit will make the innermost invocation of the main loop return.