Home Contact

TkDocs

Information you need to build high-quality Tk user interfaces.

close

Modern Tkinter ebook If you've found the material on this site useful, please consider purchasing this e-book (only $10), which is based on the Python material in the tutorial. Doing so helps me maintain and update this site. Thank you very much!


 
 
@markroseman
mark@markroseman.com

 

Kindle Buy now for your Kindle
Kindle apps are also available for most smartphones, tablets, and desktops. Payment and download handled by Amazon's Kindle Store.

 

PDF Buy the DRM-free PDF
Downloads handled by SendOwl.com. Payment handled via PayPal
(click "Don't have a PayPal account" to use a credit card).

Hey Python Users!
Modern Tkinter ebook 
Like TkDocs?
 
Check out the e‑book Modern Tkinter!
 

From what language do you primarily use Tk?
Tcl. And you can quote me on that!
Python. Sorry, why another choice?
Ruby. Not all Rails all the time.
Perl. Wait, I can only pick one?
Other. I'm a minority of a minority.
None. What am I doing here?
Poll Maker
Widget Pictures

Label Widgets

Essentials

Widget Roundup

The widget roundup provides you with a quick and easy reference to the most important features and options for each Tk widget.

Label

Widget Essentials

When to use: To show a static text or image to the user, whether identifying some other user interface element (e.g. "Name" next to an entry), something purely decorative, or presenting a result. Users normally do not interact with labels.
Tcl usage: ttk::label .lbl -text "Name:"
Ruby usage: Tk::Tile::Label.new(parent) {text "Name:"}
Reference: (at www.tcl.tk)

Common Options

text The text string to be shown in the label.
textvariable As an alternative to text, get the string from a variable, updating when the variable changes.
image,
compound
Specify a Tk Image object (not the path to an image file) instead of the text string. If compound is center, top, bottom, left, or right, display the text and the image.
justify Alignment of text: left, center or right.
wraplength For multi-line labels; let Tk calculate the line breaks rather than explicitly embedding newlines in the text string.