Hi,

On Tue, 16 Oct 2012 12:42:25 -0000
mkieve...@tlink.de wrote:

> The problem I see with both your hints (bind keys to all widgets,
> tag widgets and bind keys to tag) is I doubt they will work with tix
> Tree. I don't think tix Tree hands down any bind or tag to
> its subwidgets (or does it?).

Why not simply try it:


import tkinter
from tkinter import tix

root = tix.Tk()

t = tix.Tree(root)
t.pack(side='left')
l = tkinter.Listbox(root)
l.pack(side='right')

def on_key(event):
    print(str(event.widget) + ' received key event: ' + event.keysym)

root.bind_all('<Any-Key>', on_key, add=True)

root.mainloop()

Here this works as expected. You can even use a DirTree instead of a Tree
and you will see that keyboard navigation through the tree still works
fine.

Regards

Michael


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

Vulcans do not approve of violence.
                -- Spock, "Journey to Babel", stardate 3842.4
_______________________________________________
Tkinter-discuss mailing list
Tkinter-discuss@python.org
http://mail.python.org/mailman/listinfo/tkinter-discuss

Reply via email to