Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- _Listing of Widget classes_
- tkinter provides common GUI elements to build interface – such as buttons, menus and various kinds of entry fields and display areas. We call these elements widgets, and we construct a tree of widgets – each widget will have a parent widget, all the way up to the root window of our application. For example, a button or a text field needs to be inside some kind of containing window. Here is a list of common widgets.
- _Frame_ is a container widget which is placed inside a window, which can have its own border and background – it is used to group related widgets together in an application’s layout.
- _Toplevel_ is a container widget which is displayed as a separate window.
- _Canvas_ is a widget for drawing graphics. In advanced usage, it can also be used to create custom widgets – because we can draw anything we like inside it, and make it interactive.
- _Text_ displays formatted text, which can be editable and can have embedded images.
- _Button_ usually maps directly onto a user action – when the user clicks on a button, something should happen.
- _Label_ is a simple widget which displays a short piece of text or an image, but usually isn’t interactive.
- _Message_ is similar to a Label, but is designed for longer bodies of text which need to be wrapped.
- _Scrollbar_ allows the user to scroll through content which is too large to be visible all at once.
- _Checkbutton_, _Radiobutton_, _Listbox_, _Entry_ and _Scale_ are different kinds of input widgets – they allow the user to enter information into the program.
- _Menu_ and _Menubutton_ are used to create pull-down menus.
Advertisement
Add Comment
Please, Sign In to add comment