From 0b6932cf263ac3dc68640e3f59e0d83678315aea Mon Sep 17 00:00:00 2001 From: Johan Dahlin Date: Fri, 1 Aug 2008 22:52:06 +0000 Subject: Separate the glib and gobject bindings in the manual. 2008-08-02 Johan Dahlin * docs/Makefile.am: * docs/reference/pyglib-constants.xml: * docs/reference/pyglib-functions.xml: * docs/reference/pyglib-maincontext.xml: * docs/reference/pyglib-mainloop.xml: * docs/reference/pygobject-classes.xml: * docs/reference/pygobject-constants.xml: * docs/reference/pygobject-functions.xml: * docs/reference/pygobject-maincontext.xml: * docs/reference/pygobject-mainloop.xml: Separate the glib and gobject bindings in the manual. svn path=/trunk/; revision=910 --- docs/reference/pyglib-mainloop.xml | 202 +++++++++++++++++++++++++++++++++++++ 1 file changed, 202 insertions(+) create mode 100644 docs/reference/pyglib-mainloop.xml (limited to 'docs/reference/pyglib-mainloop.xml') diff --git a/docs/reference/pyglib-mainloop.xml b/docs/reference/pyglib-mainloop.xml new file mode 100644 index 0000000..bd12fca --- /dev/null +++ b/docs/reference/pyglib-mainloop.xml @@ -0,0 +1,202 @@ + + + + + + glib.MainLoop + + an object representing the main event loop of a PyGTK + application. + + + + Synopsis + + + glib.MainLoop + + glib.MainLoop + contextNone + is_running0 + + + get_context + + + is_running + + + quit + + + run + + + + + + + Ancestry + ++-- glib.MainLoop + + + + + + Description + + glib.MainLoop +represents a main event loop. A glib.MainLoop +is created with the glib.MainLoop() +constructor. After adding the initial event sources, the run() +method is called. This continuously checks for new events from each of the +event sources and dispatches them. Finally, the processing of an event from +one of the sources leads to a call to the quit() +method to exit the main loop, and the run() +method returns. + + It is possible to create new instances of glib.MainLoop +recursively. This is often used in PyGTK applications +when showing modal dialog boxes. Note that event sources are associated with +a particular glib.MainContext, +and will be checked and dispatched for all main loops associated with that +glib.MainContext. + + PyGTK contains wrappers of some of these +functions, e.g. the gtk.main(), gtk.main_quit() +and gtk.events_pending() +functions. + + + + + Constructor + + + glib.MainLoop + contextNone + is_runningNone + + + + context : + a glib.MainContext + or None to use the default + context. + + + is_running : + if TRUE indicates that the + loop is running. This is not very important since calling the run() + method will set this to TRUE + anyway. + + + Returns : + a new glib.MainLoop + object. + + + + Creates a new glib.MainLoop +object. + + + + + Methods + + + glib.MainLoop.get_context + + + get_context + + + + Returns : + the glib.MainContext + the mainloop is associated with + + + + The get_context() method returns the +glib.MainContext +that the mainloop was created with. + + + + + glib.MainLoop.is_running + + + is_running + + + + Returns : + TRUE if the mainloop is + currently being run. + + + + The is_running() method checks to see +if the mainloop is currently being run via the run() +method. + + + + + glib.MainLoop.quit + + + quit + + + The quit() method stops the mainloop +from running. Any subsequent calls to the run() +method will return immediately. + + + + + glib.MainLoop.run + + + run + + + The run() method runs a mainloop until +the quit() +method is called. If this is called for the thread of the loop's glib.MainContext, +it will process events from the loop, otherwise it will simply wait. + + + + + + -- cgit