Aug-25-2021, 03:13 AM
(This post was last modified: Aug-25-2021, 06:18 PM by deanhystad.)
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.
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.