It sticks your widgets to the GUI, making them visible. The grid() method, however, is an alternative to the pack() method. Label(t, text = "MUO Tkinter tutorial").grid() Tkinter lets you write plain texts directly to the GUI using the Label widget: You can also adjust the Window size with the geometry function and then specify a title using the title widget of tkinter: To use these widgets, you can import them from tkinter by replacing from tkinter import Tk with: The customization features of Tkinter, however, are in its built-in widgets. Running the code above spins up an empty tkinter frame. Thus, the mainloop wrapper makes your tkinter code executable. And it wraps up all the events within the GUI in a mainloop. Tkinter depends on its built-in TK class.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |