Hi, On Wed, 7 Sep 2016 06:31:06 +0000 Vasilis Vlachoudis <vasilis.vlachou...@cern.ch> wrote:
> 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. > I see your point of course, especially since probably other events than <Button-2> should be handled, too. Not sure if there is an easy solution to this, though. One possibility that comes to mind is adding custom geometry methods to the ScrolledFrame class that handle the bindings, like: def pack_child(self, child, **kw): child.pack(**kw) child.bind("<Button-2>", self.dragStart) Then you could conveniently do something like b = Button(f, text="Button") f.pack_child(b, side='left') I haven't tried this, but I think it should work, however it might make the usage of the widget feel oddly unfamiliar. Otoh it should come in handy enough even for complex layouts with multiple layers of sub-frames (as long as these aren't ScrolledFrames themselves of course - definitely a flaw with this approach). Regards Michael .-.. .. ...- . .-.. --- -. --. .- -. -.. .--. .-. --- ... .--. . .-. Vulcans believe peace should not depend on force. -- Amanda, "Journey to Babel", stardate 3842.3 _______________________________________________ Tkinter-discuss mailing list Tkinter-discuss@python.org https://mail.python.org/mailman/listinfo/tkinter-discuss