Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ScrolledText allows Frame.bbox to hide Text.bbox #41557

Closed
drewp mannequin opened this issue Feb 9, 2005 · 5 comments
Closed

ScrolledText allows Frame.bbox to hide Text.bbox #41557

drewp mannequin opened this issue Feb 9, 2005 · 5 comments
Assignees
Labels
topic-tkinter type-bug An unexpected behavior, bug, or error

Comments

@drewp
Copy link
Mannequin

drewp mannequin commented Feb 9, 2005

BPO 1119673
Nosy @loewis
Files
  • issue1119673.diff
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/loewis'
    closed_at = <Date 2009-08-18.13:23:32.974>
    created_at = <Date 2005-02-09.22:22:56.000>
    labels = ['type-bug', 'expert-tkinter']
    title = 'ScrolledText allows Frame.bbox to hide Text.bbox'
    updated_at = <Date 2009-08-18.15:36:49.159>
    user = 'https://bugs.python.org/drewp'

    bugs.python.org fields:

    activity = <Date 2009-08-18.15:36:49.159>
    actor = 'gpolo'
    assignee = 'loewis'
    closed = True
    closed_date = <Date 2009-08-18.13:23:32.974>
    closer = 'gpolo'
    components = ['Tkinter']
    creation = <Date 2005-02-09.22:22:56.000>
    creator = 'drewp'
    dependencies = []
    files = ['13740']
    hgrepos = []
    issue_num = 1119673
    keywords = ['patch']
    message_count = 5.0
    messages = ['60650', '60651', '86336', '91687', '91701']
    nosy_count = 3.0
    nosy_names = ['loewis', 'drewp', 'gpolo']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'test needed'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue1119673'
    versions = ['Python 3.1', 'Python 2.7']

    @drewp
    Copy link
    Mannequin Author

    drewp mannequin commented Feb 9, 2005

    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().

    @drewp drewp mannequin assigned loewis Feb 9, 2005
    @drewp drewp mannequin added the topic-tkinter label Feb 9, 2005
    @drewp drewp mannequin assigned loewis Feb 9, 2005
    @drewp drewp mannequin added the topic-tkinter label Feb 9, 2005
    @drewp
    Copy link
    Mannequin Author

    drewp mannequin commented Feb 9, 2005

    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)

    @devdanzin devdanzin mannequin added type-bug An unexpected behavior, bug, or error labels Feb 16, 2009
    @gpolo
    Copy link
    Mannequin

    gpolo mannequin commented Apr 22, 2009

    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.

    @gpolo
    Copy link
    Mannequin

    gpolo mannequin commented Aug 18, 2009

    This has been fixed on r74507 now.

    @gpolo gpolo mannequin closed this as completed Aug 18, 2009
    @gpolo gpolo mannequin closed this as completed Aug 18, 2009
    @gpolo
    Copy link
    Mannequin

    gpolo mannequin commented Aug 18, 2009

    This has been fixed on r74507 now.

    py3k branch: r74518.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    topic-tkinter type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    0 participants