[PythonCAD] Need testers for PyGTK compatiblity patch

Art Haas ahaas at airmail.net
Wed May 4 19:40:01 CEST 2005


Hi.

The latest release does not work on PyGTK releases prior to 2.4, and
I've made the following minimal patch to hopefully get things going
again. Could anyone running a PyGTK prior to 2.4 test this. I believe
the Fedora Core 2 release uses PyGTK-2.2, as would Fedora/RedHat releases
prior to FC3. I think older SuSE, Mandrake/Mandriva, and Debian
releases use PyGTK-2.2, but I don't know which release versions would
apply, nor do I know what the various BSD systems have.

Hopefully applying this patch will produce a working PythonCAD for
the older PyGTK release. Things seem to be working fine for users
of PyGTK-2.4 and newer I'm glad to report.

Art

Index: PythonCAD/Interface/Gtk/gtkactions.py
===================================================================
--- PythonCAD/Interface/Gtk/gtkactions.py	(revision 1791)
+++ PythonCAD/Interface/Gtk/gtkactions.py	(revision 1793)
@@ -291,7 +291,8 @@
             widget.show()
         else:
             widget.hide()
-        widget.set_no_show_all(True)
+        if hasattr(widget, 'set_no_show_all'):
+            widget.set_no_show_all(True)
         if isinstance(widget, gtk.MenuItem):
             if self.__accelpath is not None:
                 self.connect_accelerator()
@@ -363,7 +364,14 @@
             if _count == 0:
                 # print "calling accelgroup.connect_by_path()"
                 # print "accelpath: " + self.__accelpath
-                self.__accelgroup.connect_by_path(self.__accelpath,
+                if hasattr(self.__accelgroup, 'connect_by_path'):
+                    self.__accelgroup.connect_by_path(self.__accelpath,
+                                                      self._accel_cb)
+                else:
+                    _data = gtk.accel_map_lookup_entry(self.__accelpath)
+                    if _data is not None:
+                        _k, _m = _data
+                        self.__accelgroup.connect(_k, _m, gtk.ACCEL_VISIBLE,
                                                   self._accel_cb)
             _count = _count + 1
 
-- 
Man once surrendering his reason, has no remaining guard against absurdities
the most monstrous, and like a ship without rudder, is the sport of every wind.

-Thomas Jefferson to James Smith, 1822


More information about the PythonCAD mailing list