tkinter menu (newbie question)
Stephane Ninin
stefnin.nospam at yahoo.fr
Wed Jun 19 05:53:13 EDT 2002
Hi all,
I am completely new to kinter and quite new too to Python,
so ... (sorry if my question has already been asked many times here...)
here is a simple program I am trying to make
<--->
#! /Python22/python
from Tkinter import *
class AppWin(Frame):
def __init__(self,master=None):
Frame.__init__(self,master)
self.grid()
self.menubar = Menu(self)
self.filemenu = Menu(self.menubar)
self.filemenu.add_command(label="New")
self.filemenu.add_command(label="Open...")
self.filemenu.add_command(label="Close")
self.filemenu.add_separator()
self.filemenu.add_command(label="Quit", command=self.nothing)
self.editmenu = Menu(self.menubar)
self.helpmenu = Menu(self.menubar, name='help')
self.helpmenu.add_command(label="About...")
self.menubar.add_cascade(label="File", menu=self.filemenu)
self.menubar.add_cascade(label="Edit", menu=self.editmenu)
self.menubar.add_cascade(label="Help", menu=self.helpmenu)
def nothing():
pass
# main
appwin = AppWin()
appwin.mainloop()
<--->
The main problem is that except a small window (Tk),
there is no menu on it...
Does anybody have an idea why ? and how to change that ?
(that's probably quite a stupid mistake... :) )
Thanks in advance.
Regards,
Stephane
--
Stephane Ninin
stefnin.nospam at yahoo.fr
More information about the Python-list
mailing list