Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > General Computer Discussion > General Computer Support > Pop up dialog from main app in Tkinter (python)

Reply
Thread Tools

Pop up dialog from main app in Tkinter (python)

 
 
sreastman sreastman is offline
Junior Member
Join Date: Mar 2013
Posts: 2
 
      03-21-2013
I'm am trying to create a pop up dialog in Tkinter from an application so that I can send values back from the dialog to the main screen.

This is part of the code:

from Tkinter import *
import ttk
class MainScreen:
def __init__(self, master):
self.master = master
self.result="Untested"

self.b = Button(master, text="Select Data", width=12)
self.b.grid(row=0, column=0)
self.b = Button(master, text="Select Learners", width=12, command=self.display_learner_options)
self.b.grid(row=0, column=1)
self.b = Button(master, text="Optimize",width=12)
self.b.grid(row=0, column=2)
self.b = Button(master, text="Save Results", width=12)
self.b.grid(row=0, column=3)
self.b = Button(master, text="Exit", width=12, command=quit)
self.b.grid(row=0, column=4)
self.t = Text(master, width=60, height=15)
self.t.grid(row=1, columnspan=5)
self.p = ttk.Progressbar(master)
self.p.grid(row=2, columnspan=5)
def display_learner_options(self):
self.learnerOptions = LearnerOptions(self.master)
class LearnerOptions(Toplevel):
def __init__(self, parent):
Toplevel.__init__(self, parent)
self.transient(parent)
self.parent = parent
self.b = Button(self, text="Test")
self.b.pack()
# self.grab__set()
self.initial_focus = self
self.wait__window(self)
def test(self):
parent.result="Tested"
self.destroy
root = Tk()
root.wm_title("Prediction Optimizer")
mainScreen = MainScreen(root)
root.mainloop()

I get the following exception:

LearnerOptions instance has no attribute wait_window

What am I doing wrong or omitting?

Thanks--Steve
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
main window in tkinter app William Gill Python 7 07-20-2005 05:00 PM
adding main.aspx.vb & main.aspx.resx under aspx John M ASP .Net 1 05-29-2005 09:27 PM
Tkinter app=App(root) problem snoylr@gmail.com Python 1 04-30-2005 03:11 PM
int main(int argc, char *argv[] ) vs int main(int argc, char **argv ) Hal Styli C Programming 14 01-20-2004 10:00 PM



Advertisments