More Complex Coding
Widgets have more attributes than we've mentioned yet. We'll look at some of the others now, and we'll also talk about some other kinds of Tk widgets.
Many attributes (for example, width and height) are common to all or nearly all widgets. When in doubt, consult a reference or simply try an experiment. A few recommended Tk references are listed at the end of this chapter.
Any widget dealing with text (such as TkLabel or TkEntry) will have such options as foreground, background, and font. The colors can be specified as six-digit hex values preceded by a pound sign; there is also a limited set of names defined for colors ("red", for example, is the same as "#FF0000"). A font string consists of (at most) three parts: a font name ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access