org.gnu.glib
Class CustomEvents

java.lang.Object
  extended byorg.gnu.glib.GObject
      extended byorg.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.


Field Summary
 
Fields inherited from class org.gnu.glib.GObject
eventsInitialized
 
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.
protected  void finalize()
          Do not call this method; it's only purpose is to remove the event source once it is finished with.
static void runEvents()
          Executes the pending events.
 
Methods inherited from class org.gnu.glib.GObject
addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addListener, equals, freezeNotify, getBooleanProperty, getData, getData, getDoubleProperty, getEventListenerClass, getEventType, getFloatProperty, getGObjectFromHandle, getHandle, getIntFromHandle, getIntProperty, getJavaObjectProperty, getLongProperty, getNullHandle, getPixbufProperty, getProperty, getStringFromHandle, getStringProperty, hashCode, hasProperty, instantiateJGObjectFromGType, notify, removeEventHandler, removeListener, retrieveGObject, setBooleanProperty, setData, setData, setDoubleProperty, setFloatProperty, setHandle, setIntProperty, setJavaObjectProperty, setLongProperty, setPixbufProperty, setProperty, setStringProperty, thawNotify
 
Methods inherited from class java.lang.Object
clone, 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.


finalize

protected final void finalize()
                       throws java.lang.Throwable
Do not call this method; it's only purpose is to remove the event source once it is finished with.

Throws:
java.lang.Throwable