I've created a layout in Glade 3 and saved it as filename.glade
My code is:
Code:
#!/usr/bin/env python
import sys
import gtk
import gtk.glade
class TutorialApp:
def __init__(self):
self.wTree = gtk.glade.XML("filename.glade")
dic = { "on_window_destroy" : gtk.main_quit }
self.wTree.signal_autoconnect(dic)
self.wTree.get_widget("window").show()
if __name__ == "__main__":
app = TutorialApp()
gtk.main()
I get this error:
Code:
Traceback (most recent call last):
File "/home/user/Documents/Programming/tutorial.py", line 18, in
app = TutorialApp()
File "/home/user/Documents/Programming/tutorial.py", line 15, in __init__
self.wTree.get_widget("window").show()
AttributeError: 'NoneType' object has no attribute 'show'
I know what the problem is: previously I had called my window win_, saved it and ran a similar python script, with win_ instead of window. It worked. But gtk.glade.XML cached the glade file, and the change I made to the window's name isn't acknowledged.
So my question is, how can I clear python's cache?
(I've just started to learn python and glade.)
Bookmarks