Search code examples
tkintertkinter-entry

Tkinter Dialogue box issues


I have some code like this:

import tkinter as tk
from tkinter import Entry, Label, Text, Button, W, SE, simpledialog

app_window = tk.Tk() #root
name = simpledialog.askfloat('hello', 'What is your name?: ',
                                  parent = app_window)
age = simpledialog.askfloat('hello', 'What is your age?: ',
                                    parent = app_window)
address = simpledialog.askfloat('hello', 'What is your address?: ',
                                    parent = app_window)

Is there a way to stop the main window from popping up on top of the dialogue boxes?


Solution

  • As the OP said, the answer is to use app_window.withdraw(). The .withdraw() function minimizes a widget.

    Read more about it here.

    Hope this helps!