2 Mar 2006 22:14
How to launch a dialog when app is started?
Russell Blau <russblau <at> hotmail.com>
2006-03-02 21:14:54 GMT
2006-03-02 21:14:54 GMT
I am trying to write a Tkinter application that will automatically display a
particular dialog box on top of the application when it is initialized.
(Like a word processor opening a "File Open" dialog as the first thing that
happens when you enter the application.) How do I do this? I have a method
that invokes the dialog box, but I cannot call it until after my app's
mainloop has started; but once the mainloop has started, I can't call it
from the program, either!
I'm sure I'm overlooking something obvious here.
Example (skeleton) code:
from Tkinter import *
class NewPageDialog(tkSimpleDialog.Dialog):
def body(self, master, title="Select Target"):
Label(master, text="Target page:").grid(row=0)
self.targetpage = Entry(master)
self.targetpage.grid(row=0, column=1)
return self.targetpage
def validate(self):
return True
def apply(self):
pass
class GuiApplication(Frame):
def __init__(self, master):
(Continue reading)
RSS Feed