Popular recipes tagged "meta:requires=__builtin__" and "ui"http://code.activestate.com/recipes/tags/meta:requires=__builtin__+ui/2001-09-27T15:49:21-07:00ActiveState Code RecipesBuilding GTK GUIs interactively (Python)
2001-09-27T15:49:21-07:00Brian McErleanhttp://code.activestate.com/recipes/users/111980/http://code.activestate.com/recipes/65109-building-gtk-guis-interactively/
<p style="color: grey">
Python
recipe 65109
by <a href="/recipes/users/111980/">Brian McErlean</a>
(<a href="/recipes/tags/ui/">ui</a>).
Revision 3.
</p>
<p>One of pythons greatest strengths is the ability to try things interactively at the interpreter.
Using Tkinter shares this strength, since one can create buttons, windows and other widgets,
and instantly see them onscreen, click on buttons to activate callbacks and still be able to
edit and add to the widgets from the python command line.</p>
<p>While the python GTK bindings are generally excellent, one of their flaws is that this is not possible.
Before anything is actually displayed, the gtk.mainloop() function must be called, ending the
possibility of interactive manipulation.</p>
<p>This recipe is a program which simulates a python interpreter which transparently allows the user to
use gtk widgets without having to call mainloop(), in much the same way as Tk widgets.</p>
<p>This latest version contains enhancements added by Christian Robottom Reis to add readline completion support.</p>