Ahh yes the python code changes for gtk3. In fact I don't think its pygtk anymore...
look here: http://python-gtk-3-tutorial.readthedocs.org/en/latest/builder.html Not that I have tried it nor am an expert :) Hope that helps Chris M > From: [email protected] > To: [email protected] > Date: Sat, 20 Oct 2012 13:03:59 -0400 > Subject: Re: [Emc-developers] Glade3 and GTK3 > > Chris, > > My own stuff which is intended to run stand-alone from Linuxcnc. This part > however is basically straight out of John Thorton's tutorial here: > http://www.gnipsel.com/glade/index.html > > The Python code is listed below after adding a menu and response methods for > closing the main window and file|quit. > > <python code> > > import sys > > try: > import pygtk > pygtk.require('2.0') > except: > pass > try: > import gtk > import gtk.glade > except: > print('GTK not available') > sys.exit(1) > > class cncView: > > def on_mainWindow_destroy(self, object, data=None): > print "quit with cancel" > gtk.main_quit() > > def on_quitImageMenuItem_activate(self, menuitem, data=None): > print "quit from menu" > gtk.main_quit() > > def __init__(self): > self.gladefile = "CNCRmt.glade" > self.builder = gtk.Builder() > self.builder.add_from_file(self.gladefile) > self.builder.connect_signals(self) > self.window = self.builder.get_object("mainWindow") > self.window.show() > > if __name__ == "__main__": > main = cncView() > gtk.main() > > </python code> > > Here are the first few lines of the glade file: > > <glade XML> > > <?xml version="1.0" encoding="UTF-8"?> > <interface> > <!-- interface-requires gtk+ 3.0 --> > <object class="GtkWindow" id="mainWindow"> > <property name="width_request">800</property> > <property name="height_request">600</property> > <property name="can_focus">False</property> > <signal name="destroy" handler="on_mainWindow_destroy" swapped="no"/> > <child> > <object class="GtkBox" id="mainBox"> > <property name="visible">True</property> > <property name="can_focus">False</property> > > </glade XML> > > > > Are you trying to use gladeVCP or your own stuff? > Can you post the code? > Chris M > > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_sfd2d_oct > _______________________________________________ > Emc-developers mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/emc-developers ------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_sfd2d_oct _______________________________________________ Emc-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-developers
