Re: Frame button binding

Vasilis Vlachoudis <[email protected]>
Newsgroups gmane.comp.python.tkinter
Message-ID <[email protected]>
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

Thanks
Vasilis

________________________________________
From: Tkinter-discuss [[email protected]] on behalf of Michael Lange [[email protected]]
Sent: Wednesday, September 07, 2016 12:31
To: [email protected]
Subject: Re: [Tkinter-discuss] Frame button binding

Hi,

On Wed, 7 Sep 2016 10:21:02 +0000
Vasilis Vlachoudis <[email protected]> wrote:

> Thanks for the idea. It will make the code indeed odd.
> I was looking for a less intrusive method, something that I could
> easily replace the Frame() with ScrollFrame() in an existing application
> and everything should work.

I had the same problem quite a while ago; finally I decided that if I
want to scroll the frame I will just need to use the scrollbar ;)
I don't remember what exactly I tried back then, at least I can say if
there's an easy solution, then I did not find it.

>
> My approach with binding on the toplevel works only if I have only one
> ScrollFrame, but if I have more in the application then it doesn't.

Exactly, and possibly nested ScrolledFrames make it even worse.

> What happens if I bind more than once a certain event? Does Tk calls in
> chain all handlers or only the last one?

By default, with add=False , only the last binding should be active.

Regards

Michael


.-.. .. ...- .   .-.. --- -. --.   .- -. -..   .--. .-. --- ... .--. . .-.

Women are more easily and more deeply terrified ... generating more
sheer horror than the male of the species.
                -- Spock, "Wolf in the Fold", stardate 3615.4
_______________________________________________
Tkinter-discuss mailing list
[email protected]
https://mail.python.org/mailman/listinfo/tkinter-discuss
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.