Package brisa :: Package core :: Package reactors :: Module gtk2
[hide private]
[frames] | no frames]

Module gtk2

source code

Gtk2 based reactor.

BRisa can be easily embedded in applications with Gtk GUI's. For achieving that, the FIRST THING you should do in your application is to install this reactor.

>>> from brisa.core.reactors import Gtk2Reactor
>>> reactor = Gtk2Reactor()

On the first time you call Gtk2Reactor() the reactor will be installed and BRisa modules will adapt themselves to work with this reactor. Subsequent calls to it will only retrieve the already installed reactor - so, any internal module of your application can retrieve the reactor when you need to add timers or file descriptors.

When starting up your application, instead of calling gtk.main(), you should call reactor.main() (which is internally the same thing but you should use the name "reactor" for avoiding confusions).

Calling reactor.main_quit() is also recommended instead of gtk.main_quit().

Classes [hide private]
  Gtk2Reactor
Variables [hide private]
  log = log.getLogger('reactor.gtk2')