for the moment I was using the event.widget and compare it as a string it is has as prefix the scrolled frame, but I was wondering if there was a more elegant way.
V. ________________________________________ From: Tkinter-discuss [tkinter-discuss-bounces+vasilis.vlachoudis=cern...@python.org] on behalf of Michael Lange [klappn...@web.de] Sent: Wednesday, September 07, 2016 22:47 To: tkinter-discuss@python.org Subject: Re: [Tkinter-discuss] Frame button binding Hi, On Wed, 7 Sep 2016 14:01:19 +0000 Vasilis Vlachoudis <vasilis.vlachou...@cern.ch> wrote: > Until now I had the scrollbar working which is not very elegant vs the > Mouse Wheel or middle mouse drag. Everything started in a new > application I was doing for RPi as a home server that uses full screen > with no scrollbar and acts on gestures. But I wanted it general so that > my other programs could benefit of it. > > What if I bind the toplevel on a static method of the ScrollFrame only > once by keeping a list of registered scrollframes, and then I check if > the hit location is inside any of the ScrollFrames. > > Is there any fast method to see if a point event.x_root, y_root is > inside a widget or do I have to make the comparison with the winfo_xxx > () information Shouldn't simply using event.widget in the callback be the easiest way to check which frame (resp. child widget) was clicked? Regards Michael .-.. .. ...- . .-.. --- -. --. .- -. -.. .--. .-. --- ... .--. . .-. Blast medicine anyway! We've learned to tie into every organ in the human body but one. The brain! The brain is what life is all about. -- McCoy, "The Menagerie", stardate 3012.4 _______________________________________________ Tkinter-discuss mailing list Tkinter-discuss@python.org https://mail.python.org/mailman/listinfo/tkinter-discuss _______________________________________________ Tkinter-discuss mailing list Tkinter-discuss@python.org https://mail.python.org/mailman/listinfo/tkinter-discuss