Question on Pmw Balloon Binding
Geiger Ho
s997659 at ee.cuhk.edu.hk
Tue May 21 04:51:06 EDT 2002
Hi all,
I want to create a balloon help for a button. So I have the following
code:
from Tkinter import *
import Pmw
root = Tk()
Pmw.initialise(root)
frame = Frame(root).pack()
button = Button(frame, text="Button").pack()
balloon = Pmw.Balloon(root)
balloon.bind(button, "Button")
However, when I run the code I get the following error:
File "myprog.py", line 8, in ?
balloon.bind(button, "Button")
File "..../PmwBalloon.py", line 67, in bind
enterID = widget.bind('<Enter>',
AttributeError: 'NoneType' object has no atribute 'bind'
When I modify the code as:
button = Button(frame, text="Button")
button.pack()
balloon = Pmw.Balloon(root)
balloon.bind(button, "Button")
It works!
Why? Can anyone tell me the reasons behind.
Thanks in advance.
Regards,
Geiger
More information about the Python-list
mailing list