[Tkinter-discuss] Frame button binding

Vasilis Vlachoudis Vasilis.Vlachoudis at cern.ch
Wed Sep 7 02:31:06 EDT 2016


Hi Michael,

the ScrollFrame is of generic use as a normal frame class. So I don't know apriori how many
children it will have. I could set the bind recursively in all winfo_children() and sub-children etc. after the
frame is populated but I though it will be an overkill.

Vasilis
________________________________________
From: Tkinter-discuss [tkinter-discuss-bounces+vasilis.vlachoudis=cern.ch at python.org] on behalf of Michael Lange [klappnase at web.de]
Sent: Tuesday, September 06, 2016 23:24
To: tkinter-discuss at python.org
Subject: Re: [Tkinter-discuss] Frame button binding

Hi,

On Tue, 6 Sep 2016 09:00:45 +0000
Vasilis Vlachoudis <Vasilis.Vlachoudis at cern.ch> wrote:

> Hi all,
>
> I want to create a Scrolled Frame, it works nicely with the place
> command however when I bind the B2-Motion, and I click the middle mouse
> button on the child buttons instead of dragging it does nothing, since
> they are capturing the B2 and not propagate it to the master.
(...)

Have you tried to simply add a binding for the event to the Frame's
children, as in

b = Button(f, text="Button")
b.pack()
b.bind("<Button-2>", dragStart)     ?

Best regards

Michael

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

No more blah, blah, blah!
                -- Kirk, "Miri", stardate 2713.6
_______________________________________________
Tkinter-discuss mailing list
Tkinter-discuss at python.org
https://mail.python.org/mailman/listinfo/tkinter-discuss


More information about the Tkinter-discuss mailing list