#!/usr/bin/python # menu-example-2.py from Tkinter import * import tkMessageBox import tkFileDialog root = Tk() def mount(): filename = tkFileDialog.askopenfilename() try: if filename: print "finns" except: print 'Finns ej' def information(): tkMessageBox.showwarning("Information", "Information kommer här") # Menu menubar = Menu(root) menubar.add_command(label="Mount Iso", command=mount) menubar.add_command(label="Information", command=information) def callback(): if tkMessageBox.askyesno("Quit", "Do you really wish to quit?"): root.destroy() # Orka get = 'MountXiso version 0.5' root.config(menu=menubar) root.protocol("WM_DELETE_WINDOW", callback) root.geometry("%dx%d" % (400, 100)) root.title(get) mainloop()