On Tue, 2003-07-29 at 23:29, Jon Willeke wrote: > This question appears a couple of times in the archives with no > satisfactory answer: how do I use a GLADE custom widget?
As I wrote this patch I guess I should document it somewhere...
This is a working example:
import pygtk
pygtk.require("2.0")
import gtk
import gtk.glade
def create_source_cd_dropdown():
return gtk.Label("source")
gtk.glade.set_custom_widget_callbacks(locals())
glade = gtk.glade.XML("cd-copier.glade")
window = glade.get_widget ("window")
window.show_all()
gtk.main()
The important call is gtk.glade.set_custom_widget_callbacks(), which
takes a dictionary of function names->functions (so locals() works).
Ross
--
Ross Burton mail: [EMAIL PROTECTED]
jabber: [EMAIL PROTECTED]
www: http://www.burtonini.com./
PGP Fingerprint: 1A21 F5B0 D8D0 CFE3 81D4 E25A 2D09 E447 D0B4 33DF
signature.asc
Description: This is a digitally signed message part
_______________________________________________ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
