[Tkinter-discuss] Questions about treeview
klappnase at web.de
Thu Apr 12 16:17:48 CEST 2012
Thus spoketh Bill Felton <subscriptions at cagttraining.com>
unto us on Thu, 12 Apr 2012 08:32:58 -0400:
> Hi all,
> Is it true that the ttk treeview widget 'swallows' right-mouse clicks?
> We have a need that could be met with the treeview if we could only
> figure out how to get pop-up menus to work in that widget. Our tests
> seem to show that regardless of where in the containment structure one
> binds <button-2> (widget, frmae, outframe, window, app), if the widget
> at the "bottom" of the stack is a treeview, the mouse button-2 event
> will not be caught.
Maybe you simply confuse Button-2 (the button in the middle, under the
wheel) and Button-3 ? The following code works here just as expected:
from Tkinter import *
root = Tk()
t = ttk.Treeview(root)
> Also, are there plans to fix the current problems with horizontal
> scrolling in treeviews? We have used the work-around of having an
> empty data column that the user can drag to the right; once the drag
> moves past the visible bounds of the frame containing the treeview the
> horizontal scrollbar appears. This seems clumsy and un-intuitive, so
> we're hoping there's another, better, way to get horizontal scrolling
> to work.
I haven't used the treeview much yet, so maybe I am missing something,
but I do not see any way to do it. Maybe the problem is the way
ttk reports the widget width to the window manager, just a guess though.
For some reason you cannot configure the width of a treeview, maybe this
is related. I am not sure if this is intentional or a bug, but I am afraid
there is not much we can do here, the problem is apparently on the Tcl/Tk
side. Maybe you could file a bug report there?
.-.. .. ...- . .-.. --- -. --. .- -. -.. .--. .-. --- ... .--. . .-.
No one can guarantee the actions of another.
-- Spock, "Day of the Dove", stardate unknown
More information about the Tkinter-discuss