Pop up dialog from main app in Tkinter (python)

Discussion in 'General Computer Support' started by sreastman, Mar 21, 2013.

  1. sreastman

    sreastman

    Joined:
    Mar 21, 2013
    Messages:
    2
    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
    sreastman, Mar 21, 2013
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Doug
    Replies:
    1
    Views:
    529
    Robert Bonomi
    Jun 1, 2006
  2. Marshall
    Replies:
    8
    Views:
    3,286
    null@zilch.com
    Sep 3, 2003
  3. Bruce Sinclair

    Killer App/Nifty App

    Bruce Sinclair, Jun 8, 2005, in forum: NZ Computing
    Replies:
    35
    Views:
    1,167
  4. El Chippy
    Replies:
    3
    Views:
    741
    Shane
    Apr 16, 2007
  5. partyin
    Replies:
    0
    Views:
    1,047
    partyin
    Feb 21, 2012
Loading...

Share This Page