W Wrapl, The Programming Language

Libraries:Gtk:Gdk:Error

Functions

TrapPop() : Std.Integer.SmallT

Removes the X error trap installed with TrapPush.

Returns the X error code, or 0 if no error occurred.


TrapPush() : Std.Object.T

This function allows X errors to be trapped instead of the normal behavior of exiting the application. It should only be used if it is not possible to avoid the X error in any other way.

Example 1. Trapping an X error

1
2
3
4
5
6
7
8
gdk_error_trap_push ();
/* ... Call the X function which may cause an error here ... */
/* Flush the X queue to catch errors now. */
gdk_flush ();
if (gdk_error_trap_pop ())
  {
    /* ... Handle the error here ... */
  }