GUI Programming with Python, Glade and


Python + Glade + smartglade = Productivity Gain2


A smart way to build GTK+ based applications using Python programming language, Glade GUI builder and smartglade module on almost all modern platforms. Inspired by libglade, it brings a fresh way how to deal with widget identifiers in programs. It smartly fixes their names and initialize. smartglade allows dynamic loading of user interfaces from XML descriptions (Glade files or buffers). smartglade automatically creates (gets children, assigns identifiers and initialize them) corresponding widgets from XML descriptions. smartglade uses following Python modules: pygtk, gtk, gobject and xml. vs. smartglade

According to example, it is obvious that we manually have to get all required widgets using get_widget() method. Problem appears if our XML description has too many widgets, and it makes very hard to manually get all of them. Using to 'get' all necessary widgets, this bit of code will linearly increase.

xml ='', 'window1')
self.window = self.window1 = xml.get_widget('window1')
self.entry1 = xml.get_widget('entry1')
self.button1 = xml.get_widget('button1')
# ...


Even if XML description has hundreds of widgets in same window, smartglade automatically does job for us. Following bit of code is everything that is required to 'get' all widgets from 'window1' widget.

smartglade.xml.__init__(self, '')
self.window = self.window1


There are two very simple examples that use smartglade ( with and, and one that uses ( with uses external Glade file, and it is required in same directory where is uses internal Glade buffer as XML description of GUI. Both XML descriptions are generated with Glade GUI builder.

Examples with smartglade module can be found on this address

Installation of smartglade

Just copy into working directory.