PyGTK, Glade/libglade. What am I doing wrong?

Alister Ware alister.ware at ntlworld.com
Sat May 7 04:11:40 EDT 2011


On Sat, 07 May 2011 15:14:07 +1100, Даниил Рыжков wrote:

> Thanks, Cristian! It works.
>> List of Pygtk: http://www.daa.com.au/mailman/listinfo/pygtk
> Thanks again. Subscribed :)
> 2011/5/7 craf <pyclutter at gmail.com>:
>> Hi.
>>
>> Try this:
>>
>> #!/usr/bin/env python
>>
>> import gtk.glade
>>
>> class TestPyGtk:
>>    """This is an Hello World GTK application"""
>>
>>    def __init__(self):
>>
>>        #Set the Glade file
>>        self.gladefile = "test.glade"
>>        self.glade = gtk.glade.XML(self.gladefile)
>>
>>        self.MainWindow = self.glade.get_widget('MainWindow')
>>        self.MainWindow.show()
>>        self.MainWindow.connect('destroy', lambda e:gtk.main_quit())
>>
>>
>>
>> TestPyGtk()
>> gtk.main()
>>
>> Regards.
>>
>> Cristian.
>>
>> List of Pygtk: http://www.daa.com.au/mailman/listinfo/pygtk
you may also want to look at using gtk.builder instread as it is now the 
prefered option.




-- 
The human mind ordinarily operates at only ten percent of its capacity
-- the rest is overhead for the operating system.



More information about the Python-list mailing list