Tk -- stupid blank dialog opens up in background

Discussion in 'Python' started by bmgz, Dec 13, 2003.

  1. bmgz

    bmgz Guest

    I am just starting with python, I found it anoying that when I use Tk, a
    blank dialog always opens up behind tkMessageBox or whatever other gui
    element one executes.. Is their a way of disabling this?
     
    bmgz, Dec 13, 2003
    #1
    1. Advertising

  2. "bmgz" <> wrote:

    > I am just starting with python, I found it anoying that when I use Tk, a
    > blank dialog always opens up behind tkMessageBox or whatever other gui
    > element one executes.. Is their a way of disabling this?


    the "blank dialog" is Tkinter's root window.

    to eliminate that, explicitly create a root and withdraw it before
    proceeding:

    root = Tkinter.Tk()
    root.withdraw() # won't need this

    if you're building a full-blown Tkinter application, the usual approach is
    to put your widgets in the root window:

    root = Tkinter.Tk()

    mybutton = Button(root, text=...)
    mybutton.pack() # etc

    </F>
     
    Fredrik Lundh, Dec 13, 2003
    #2
    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. robertm
    Replies:
    1
    Views:
    824
    Vidar Petursson
    Aug 11, 2003
  2. Paul Turley
    Replies:
    1
    Views:
    4,533
    Joey Powell
    Jan 6, 2004
  3. Cal Who
    Replies:
    0
    Views:
    326
    Cal Who
    Apr 16, 2010
  4. Andi Lintermann

    MSI opens a blank page - other browsers don't

    Andi Lintermann, Mar 17, 2006, in forum: Javascript
    Replies:
    0
    Views:
    106
    Andi Lintermann
    Mar 17, 2006
  5. sid
    Replies:
    1
    Views:
    94
    scripts.contact
    May 23, 2007
Loading...

Share This Page