Bugs item #1472877, was opened at 2006-04-19 10:26 Message generated for change (Comment added) made by mkiever You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1472877&group_id=5470
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Tkinter Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Matthias Kievernagel (mkiever) Assigned to: Martin v. Löwis (loewis) Summary: Tix: Subwidget names Initial Comment: 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 ([EMAIL PROTECTED]) ---------------------------------------------------------------------- >Comment By: Matthias Kievernagel (mkiever) Date: 2006-10-25 20:36 Message: Logged In: YES user_id=1477880 Solution was not complete. Submitted a complete patch #1472877 for this which is tested against the tix demo code in Demo/tix/tixwidgets.py Matthias Kievernagel mkiever at web dot de ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1472877&group_id=5470 _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com