Tkinter App Wanted

Brian & Colleen greybria at direct.ca
Fri Apr 13 16:41:32 EDT 2001


Is anyone willing to share the source for a small Tkinter app (maybe an
editor or file viewer) that includes a menu. I'm having problems getting
a menu to work inside an encapsulated application.#! /usr/bin/env python

from Tkinter import *

class App:
     frame=Frame(master)
     frame.pack()

     self.button=Button(frame,text="QUIT",fg="red",command=frame.quit)
     self.button.pack(side=LEFT)

     self.hi_there=Button(frame,text="Hello",command=self.say_hi)
     self.hi_there.pack(side=LEFT)

     def say_hi(self):
     print "Hi there, everyone!"

root=Tk()
app = App(root)
root.mainloop()

Somewhere inside the App class, I'd like to include a basic menu
(File-Save As, Exit) etc. so that when I create an instance of App, all
the pieces are there.

Thanks in advance.

--
 Brian Smith
 greybria at direct.ca
 http://mypage.direct.ca/g/greybria






More information about the Python-list mailing list