Bugs item #1178872, was opened at 2005-04-07 17:20 Message generated for change (Comment added) made by tjreedy You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1178872&group_id=5470
Category: Tkinter Group: Python 2.4 >Status: Deleted >Resolution: Duplicate Priority: 5 Submitted By: Emil (droun) Assigned to: Martin v. Löwis (loewis) Summary: Variable.__init__ uses self.set(), blocking specialization Initial Comment: in class Variable the constructor uses self.set() to set the value of the variable. This makes it hard and in some cases impossible to make a speciallization of Variable that performs some operation after changing the value. It would be preferable to use Tkinter.Variable.set(self, self._default) example: class ViewChanger(Tkinter.StringVar) : def __init__(self, views) : self.views = views Tkinter.StringVar.__init__(self) def set(self, newview) : self.views.activate(newview) Tkinter.StringVar.set(newview) get() and everything else will use the normal StringVar ipementation, but when the value is changed, a new view is activated. At creation here the self.views varaible will be accessed, method activate() will be called, and it might not even be fully initiallized yet. This is the normal case if you want to supply a variable to a widget, where a variable change may update the widget. ---------------------------------------------------------------------- >Comment By: Terry J. Reedy (tjreedy) Date: 2005-04-26 17:46 Message: Logged In: YES user_id=593130 Duplicate of 1178863 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1178872&group_id=5470 _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com