Bug in Tkinter??

Matt Conway (mjc4y@popcorn.cs.virginia.edu)
Fri, 1 Jul 1994 17:19:45 GMT

I think there's a bug in Tkinter, or perhaps I'm using the bind_all()
method incorrectly. Here's a tiny code snippet that demonstrates the
bug. What I'd expect (and what I'm trying to build) is for the words
"this is a button" to be printed whenever I use Shift-Button-3,
regardless of the widget. For this, I create a button and use
bind_all() to tie the shift-button-3 pattern to a callback. Problem
is, the function never gets called.

The analogous Tk code works as expected.

Any Help or pointers would be greatly appreciated.

thanks in advance,
matt

-----------------%< snippity snip %<---------------

from Tkinter import *

def buttonFunc(*event):
print "this is a button"

def createWidgets(top):
f = Frame(top)
f.pack()

# a hello button
f.hi_there = Button(f, {'text': 'Hello'})
f.hi_there.pack({'side': 'left', 'padx' : '1i'})

root = Tk()
createWidgets(root)
root.bind_all("<Shift-Button-3>", buttonFunc)
root.mainloop()

-- 
----------------------------------------------------------------------------
Matthew Conway              University of Virginia      
Dept. of Computer Science   Charlottesville, VA 22901   
		  conway@Virginia.EDU 
----------------------------------------------------------------------------