Issue 1119673: ScrolledText allows Frame.bbox to hide Text.bbox (original) (raw)

Issue1119673

Created on 2005-02-09 22:22 by drewp, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue1119673.diff gpolo,2009-04-22 21:20
Messages (5)
msg60650 - (view) Author: Drew Perttula (drewp) Date: 2005-02-09 22:22
sys.version == '2.3.3a0 (#3, Jul 20 2004, 10:32:48) \n[GCC 2.96 20000731 (Red Hat Linux 7.2 2.96-112.7.2)]' from ScrolledText import ScrolledText s = ScrolledText() s.pack() I wish to call bbox on the Text, but s.bbox is the surrounding Frame's bbox, and the Text's bbox method is lost. I suppose these lines from ScrolledText.py should be expanded to include 'bbox', but I have not tested such a fix: if m[0] != '_' and m != 'config' and m != 'configure': setattr(self, m, getattr(self.frame, m)) For special situations (of which bbox is probably *not* one), the Text methods should probably be available under something like s.text.bbox().
msg60651 - (view) Author: Drew Perttula (drewp) Date: 2005-02-09 22:36
Logged In: YES user_id=127598 A workaround: s = ScrolledText() new.instancemethod(Text.bbox,s,s.__class__)(...) but, I actually have a subclass of ScrolledText, and I can't figure out how to use the workaround. class Foo(ScrolledText): ... def foo(self): ... ... new.instancemethod(tk.Text.bbox, self, self.__class__)("insert") TypeError: unbound method bbox() must be called with Text instance as first argument (got Foo instance instead)
msg86336 - (view) Author: Guilherme Polo (gpolo) * (Python committer) Date: 2009-04-22 21:20
> I suppose these lines from ScrolledText.py should > be expanded to include 'bbox', but I have not tested > such a fix: > > if m[0] != '_' and m != 'config' and m != 'configure': > setattr(self, m, getattr(self.frame, m)) bbox is already there, that is the problem. Including it again there doesn't solve your problem. The actual problem is that Grid methods include the "bbox" as an alias to the Misc.grid_bbox method. One way to fix this is setting only the attributes that are not present in the Text class. The attached patch does that.
msg91687 - (view) Author: Guilherme Polo (gpolo) * (Python committer) Date: 2009-08-18 13:23
This has been fixed on r74507 now.
msg91701 - (view) Author: Guilherme Polo (gpolo) * (Python committer) Date: 2009-08-18 15:36
> This has been fixed on r74507 now. py3k branch: r74518.
History
Date User Action Args
2022-04-11 14:56:09 admin set github: 41557
2009-08-18 15:36:49 gpolo set messages: +
2009-08-18 15:36:44 gpolo set resolution: accepted -> fixed
2009-08-18 13:23:32 gpolo set status: open -> closedresolution: acceptedmessages: +
2009-04-22 21:20:20 gpolo set files: + issue1119673.diffversions: + Python 3.1, Python 2.7, - Python 2.6nosy: + gpolomessages: + keywords: + patch
2009-02-16 01:01:04 ajaksu2 set stage: test neededtype: behaviorversions: + Python 2.6, - Python 2.3
2005-02-09 22:22:56 drewp create