menue windowing help needed

Eric Brunel eric.brunel at pragmadev.com
Fri Jun 28 09:57:27 EDT 2002


Klaus Reinhardt wrote:
> ---------------------------------------------------------------------
> Hi
> 
> I tried the samples from wxPython and tkinter
> without succes.

Can you tell us what samples? And what happened?

> I need some scripting help for:
> A menue
> each alternative can open
> one window for print or ..

Here is a simple example with Tkinter:

----------------------------------
from Tkinter import *

def openWindow():
  wdw = Toplevel()

root = Tk()
menuBar = Menu(root)
root['menu'] = menuBar
fileMenu = Menu(root)
fileMenu.add_command(label='Open window', command=openWindow)
fileMenu.add_separator()
fileMenu.add_command(label='Quit', command=root.quit)
menuBar.add_cascade(label='File', menu=fileMenu)

root.mainloop()
----------------------------------

HTH
-- 
- Eric Brunel <eric.brunel at pragmadev.com> -
PragmaDev : Real Time Software Development Tools - http://www.pragmadev.com



More information about the Python-list mailing list