Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have been using gtk a lot to make my python programs have a graphical interface, and it's pretty awesome. I recently discovered Glade which is a hassle-free way of making a GUI for your programs. I used glade to make the program the way i wanted it to look, and now I would like to look at it's code, but I have no idea how to. Some help would be appreciated, thanks Ubuntu :)

share|improve this question
up vote 1 down vote accepted

It is possible to build GUI dynamically from Glade file using PyGTK Gtk.Builder class

The Gtk.Builder class offers you the opportunity to design user interfaces without writing a single line of code. This is possible through describing the interface by a XML file and then loading the XML description at runtime and create the objects automatically, which the Builder class does for you. For the purpose of not needing to write the XML manually the Glade application lets you create the user interface in a WYSIWYG (what you see is what you get) manner

See this is a nice tutorial: Python GTK+ 3 Tutorial: 20. Glade and Gtk.Builder


from gi.repository import Gtk

class Handler:
    def onDeleteWindow(self, *args):

    def onButtonPressed(self, button):
        print("Hello World!")

builder = Gtk.Builder()

window = builder.get_object("window1")

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.