Tkinter Menu tearoff

Daley, Mark W mark.w.daley at intel.com
Tue Sep 12 12:54:06 EDT 2000


I am having difficulty removing the tearoff from my menus.  I am using Tk
8.0.5.  Here is the code and message.

def makefilemenu():
	filebtn = Menubutton(mbar, text = 'File', tearoff = 0)
	filebtn.pack(side=LEFT)
	filebtn.menu = Menu(filebtn)
	
	filebtn.menu.add_command(label = 'Quit', command = die)
	
	filebtn['menu'] = filebtn.menu
	return filebtn


Traceback (innermost last):
  File "<pyshell#0>", line 1, in ?
    import cit
  File "C:\Python\cit.py", line 128, in ?
    filebtn = makefilemenu()
  File "C:\Python\cit.py", line 104, in makefilemenu
    filebtn = Menubutton(mbar, text = 'File', tearoff = 0)
  File "C:\Program Files\Python\Lib\lib-tk\Tkinter.py", line 1571, in
__init__
    Widget.__init__(self, master, 'menubutton', cnf, kw)
  File "C:\Program Files\Python\Lib\lib-tk\Tkinter.py", line 1084, in
__init__
    self.tk.call(
TclError: unknown option "-tearoff"

Am I using the wrong version of Tkinter, or is there some other explanation?
Any help is appreciated.


- Mark

----------------------------------------------
The opinions expressed are mine, and are not necessarily those of my
employer.






More information about the Python-list mailing list