Python Forum
[Tkinter] question for a tkinter dialog box
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tkinter] question for a tkinter dialog box
#2
You don't have a dialog box. You have a toplevel window.

There are commands for making different kinds of standard dialog boxes.

https://docs.python.org/3/library/dialog.html

Or you can make a custom dialog box:

https://code-maven.com/slides/python/tk-...ple-dialog

As an aside, you do not have w1 and w2. w1 and w2 are both None because that is the value returned by pack().

If you are asking how widgets appear in windows, that happens when the window is drawn. When you call root.mainloop() the first thing it does is draw the root window. Because you packed two labels in the root window, the labels are positioned and the root window grows to accommodate. If you had buttons or other interactive controls the root.mainloop() would process button and key press events.
Reply


Messages In This Thread
RE: question for a tkinter dialog box - by deanhystad - Aug-25-2021, 03:13 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Beginner question re: Tkinter geometry return2sender 3 905 Jun-19-2023, 06:19 PM
Last Post: deanhystad
  Tkinter GUI question texan1836 3 1,822 Apr-13-2023, 03:12 AM
Last Post: deanhystad
  Is there is a printer dialog box in PySimpleGUI shaunfish 2 1,582 Aug-22-2022, 07:29 PM
Last Post: deanhystad
  simple tkinter question function call not opening image gr3yali3n 5 3,303 Aug-02-2022, 09:13 PM
Last Post: woooee
  How a QMainWindow can open a dialog? panoss 4 3,472 Feb-03-2022, 04:33 PM
Last Post: panoss
  [Tkinter] cancelling open dialog gives empty string rwahdan 2 3,308 Jul-17-2021, 09:17 PM
Last Post: steve_shambles
  Python tkinter question tablet Nick_tkinter 8 4,924 Mar-04-2021, 10:44 PM
Last Post: Larz60+
  tkinter slider question Nick_tkinter 1 2,433 Feb-22-2021, 01:31 PM
Last Post: deanhystad
  [Tkinter] Noob question:Using pyttsx3 with tkinter causes program to stop and close, any ideas? Osman_P 4 5,233 Nov-14-2020, 10:51 AM
Last Post: Osman_P
  question on tkinter canvas PhotoImage gr3yali3n 1 2,105 Sep-05-2020, 12:18 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020