Created
October 19, 2009 19:31
-
-
Save prasincs/213653 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| 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