[Python-de] Tkinter/ Pmw problem

Sharriff Aina nhytro-python at web.de
Tue Oct 16 15:46:44 EDT 2001


Hallo! kann jemand mir erklaren wieso die "About" Dialoge nicht funktioniert?

################## code

import Pmw
from tkFileDialog import askopenfilename
from Tkinter import *

# variables and constants
filepath = ""

# create main application
root = Tk()

# initialise Pmw for use
Pmw.initialise(root)
Pmw.aboutversion('0.5')
Pmw.aboutcopyright('Copyright Sharriff Aina, 2001\nAll rights reserved')
Pmw.aboutcontact('email: test at nowhere.de')

# construct about dialogue
about = Pmw.AboutDialog(root, applicationname = 'test_apllication')
about.withdraw()

# create root frame
appframe = Frame(root, width = 400, height = 550)

# create menu
menubar = Menu(root, border=1)

# create submenu "file"
filemenu = Menu(menubar, tearoff = 0)
filemenu.add_command(label = "Exit", command = root.quit)

#add submenu "file" to mainmenu "menubar"
menubar.add_cascade(label="File", menu=filemenu)

#create submenu "Help"
helpmenu = Menu(menubar, tearoff=0)
helpmenu.add_command(label = "menu1")
helpmenu.add_command(label = "menu2")

# add submenu "Help" to menubar
menubar.add_cascade(label="Help", menu=helpmenu)


def dialogue_about():
....about.show() 


#create submenu "About"
aboutmenu = Menu(menubar, tearoff=0)
aboutmenu.add_command(label = "About")
# add submenu "about" to menubar
menubar.add_cascade(label="About", menu=aboutmenu, command = dialogue_about)

appframe.pack()

# set the title
root.title("testapplication")

#assign root a menubar
root.config(menu=menubar)

root.mainloop()

###################### end code



Vielen dank

 
_______________________________________________________________________
1.000.000 DM gewinnen - kostenlos tippen - http://millionenklick.web.de
IhrName at web.de, 8MB Speicher, Verschluesselung - http://freemail.web.de





More information about the Python-de mailing list