## org.gnu.glib
Class CustomEvents

    java.lang.Object
      org.gnu.glib.Struct
          org.gnu.glib.GObject
              org.gnu.glib.CustomEvents

public final class CustomEvents
extends GObject

Provides methods for adding custom event sources. The main glib thread will poll this ojbect as part of its main loop. If any events are pending, they will be executed from within the main glib loop.

For multithreaded Gtk/Gnome applications, all gui modifications must be done from within the main loop. The methods of this class allow you to do this.

As events run on the main glib loop, only short methods should be executed in it.

Method Summary
`static void` `addEvent(java.lang.Runnable target)` Adds a new event to the queue.
`static void` `addEventAndWait(java.lang.Runnable target)` Adds a new event to the queue.
`static void` `runEvents()` Executes the pending events.

Methods inherited from class org.gnu.glib.GObject

`addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addListener, collect, freezeNotify, getBooleanProperty, getData, getDoubleProperty, getEventListenerClass, getEventType, getFloatProperty, getGObjectFromHandle, getIntProperty, getJavaObjectProperty, getLongProperty, getPixbufProperty, getProperty, getStringProperty, hasProperty, notify, removeEventHandler, removeListener, setBooleanProperty, setData, setDoubleProperty, setFloatProperty, setIntProperty, setJavaObjectProperty, setLongProperty, setPixbufProperty, setProperty, setStringProperty, thawNotify`

Methods inherited from class org.gnu.glib.Struct
`equals, getHandle, getNullHandle, hashCode`

Methods inherited from class java.lang.Object
`getClass, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### addEvent

    public static void addEvent(java.lang.Runnable target)

  Adds a new event to the queue. `target.run()` will be called in the next iteration of the glib (gtk) main loop. This method will return immediately after adding the item to the queue.

### addEventAndWait

    public static void addEventAndWait(java.lang.Runnable target)

  Adds a new event to the queue. `target.run()` will be called in the next iteration of the glib (gtk) main loop. This method waits until the method call has completed before returning.

### runEvents

    public static final void runEvents()

  Executes the pending events. This is called from within the gtk main thread.