Examples of All Widgets

4/17/18 – Adding this note: at the top of the sub pages is a page holding the “instantiate” code shown in a soon-to-be-released program called “tksidekick”. It may be the best quick reference page on this site.

______________________________

Here we have created 18 live, working demos,  which cover something beyond the basics of all the tkinter widgets except canvas. I know these examples are not elegant, efficient or Pythonic.  In many cases that is because we want to be clear about the process and syntax in these examples and try to use variable names that actually mean something to the process occuring.   Most feature multiple widgets and most widgets can be found in more than one example. I think canvas is the only one with a single example , but it includes all 5 or 6 objects, including a window example holding a button

The majority of these examples also begin with what we call “standard tkinter header #2”. It saves a huge amount of time not having to reinvent the wheel every time you want to creat some code to test a widget.

For your reference, here is an incomplete list of widgets and working examples where they may be found. Root, Toplevel, Button, Label and LabelFrame are just about ubiquitous.

Button               Rec Team Maker, Basic_Frame_Label_Button, Simple Labelframe_Label demo
Canvas              Canvas basic 011918 including window
Checkbutton     Ham and Eggs
Entry                  Rec Team Maker
Frame                Rec Team Maker, Color creator, Ham and Eggs, Basic_Frame_Label_Button
Label                  Rec Team Maker, Color creator, Ham and Eggs, Simple Labelframe_Label demo
LabelFrame       Rec Team Maker, PanedWindow and Friends icons, Simple Labelframe_Label demo
Listbox              Rec Team Maker, simple listbox
Menu                 Menu demo 1
Menubutton      Menubutton basic   ***Obsolete since tk 8.0
Message           Rec Team Maker
PanedWindow  PanedWindow and friends icons
Radiobutton     Radiobuttons horizontal, PanedWindow and friends icons
Scale                 Color creator, Big Simple horizontal scale demo
Scrollbar           scrollbar basic test
Spinbox            Spinbox label change demo, spinbox number change demo, spinbox basic demo
Text                   Destroy Remove and Recover,
Toplevel            Rec Team Maker, Lift toplevels
also:                  root (all scripts)
using propogate        Rec Team Maker
using event data        Destroy Remove and Recover
lambda                        lift toplevels examples (plus others)