#!/usr/bin/env python #-*- coding: cp1251 -*- """ Это главный файл типа программы """ import sys try: import pygtk # tell pyGTK, if possible, that we want GTK2 pygtk.require("2.0") except: pass try: import gtk import gtk.glade except: print "You need to install pyGTK or GTKv2", print "or set your PYTHONPATH correctly." print "/usr/local/bin/python2.3/site-packager/" sys.exit(1) class appgui: def __init__(self): """ Here we display the main serverinfo window """ gladefile="pinger.glade" windowname="serverinfo" self.wTree=gtk.glade.XML (gladefile,windowname) dic = {"on_button1_clicked" : self.button1_clicked, "on_serverinfo_destroy": (gtk.mainquit) } self.wTree.signal_autoconnect (dic) return #####CALLBACKS def button1_clicked(self, widget): print "button clicked" # start application app=appgui() gtk.mainloop()