Skip to content

Instantly share code, notes, and snippets.

@prasincs
Created October 19, 2009 19:31
Show Gist options
  • Select an option

  • Save prasincs/213653 to your computer and use it in GitHub Desktop.

Select an option

Save prasincs/213653 to your computer and use it in GitHub Desktop.
"""
LoadFromGladeFile.py
Description: load the glade file easily
Author: Prasanna Gautam
Info: Works with libglade for the .glade file
"""
import sys
import pygtk
pygtk.require('2.0')
import gtk
import gtk.glade
class ImageViewer:
def __init__(self,gladeFile):
self.gladefile = gladeFile
self.wTree = gtk.glade.XML(self.gladefile, "MainWindow")
self.window = self.wTree.get_widget("MainWindow")
self.window.connect('destroy',gtk.main_quit)
def main(self):
self.window.show()
gtk.main()
if __name__=="__main__":
iV = ImageViewer("ImageViewer.glade")
iV.main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment