Message28305
My system information:
------------------------------------------
uname -a:
Linux linux 2.6.4-52-default #1 Wed Apr 7 02:08:30 UTC
2004 i686 athlon i386 GNU/Linux
Python:
Python 2.4.1 (#4, Jan 10 2006, 10:53:14)
[GCC 3.3.3 (SuSE Linux)] on linux2
and
Python 2.3.5 (#1, Sep 12 2005, 14:56:24)
[GCC 3.3.3 (SuSE Linux)] on linux2
------------------------------------------
Using Tix you can produce the following exception:
---------------------------------------------------
>>> from Tix import *
>>> tk = Tk ()
>>> b = Balloon ()
>>> b.subwidget ( 'label' )
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/home/mkiever/pro/Python-2.4.1/Lib/lib-tk/Tix.
py", line 340, in subwidget
return self._nametowidget(n)
File "/home/mkiever/pro/Python-2.4.1/Lib/lib-tk/
Tkinter.py", line 1015, in nametowidget
w = w.children[name]
KeyError: 'lab'
>>>
---------------------------------------------------
I found a commentary in Tix.py:TixWidget:__init__
stating that 'subwidget_list' should contain
Tix names. But in Tix.py:TixSubWidget:__init__
the python names are used, not the names returned
by Tix.
I was successful with the following two
small additions (+++) near lines 400-450:
---------------------------------------------
class TixSubWidget(TixWidget):
...
def __init__(self, master, name,
destroy_physically=1,
check_intermediate=1):
...
if (not check_intermediate) or len(plist) < 2:
# immediate descendant
if check_intermediate: +++
name = plist [0] +++
TixWidget.__init__(self, master, None, None,
{'name' : name})
else:
...
name = plist [-1] +++
TixWidget.__init__(self, parent, None, None,
{'name' : name})
self.destroy_physically = destroy_physically
...
---------------------------------------------
This replaces the python name by the name
returned from Tix.
I have not extensively tested this (sorry).
Hope this helps.
Matthias Kievernagel (mkiever@web.de)
|
|
Date |
User |
Action |
Args |
2007-08-23 14:39:33 | admin | link | issue1472877 messages |
2007-08-23 14:39:33 | admin | create | |
|