| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
| 2 | <html> |
| 3 | <head> |
| 4 | <link rel="STYLESHEET" href="lib.css" type='text/css' /> |
| 5 | <link rel="SHORTCUT ICON" href="../icons/pyfav.png" type="image/png" /> |
| 6 | <link rel='start' href='../index.html' title='Python Documentation Index' /> |
| 7 | <link rel="first" href="lib.html" title='Python Library Reference' /> |
| 8 | <link rel='contents' href='contents.html' title="Contents" /> |
| 9 | <link rel='index' href='genindex.html' title='Index' /> |
| 10 | <link rel='last' href='about.html' title='About this document...' /> |
| 11 | <link rel='help' href='about.html' title='About this document...' /> |
| 12 | <link rel="next" href="node729.html" /> |
| 13 | <link rel="prev" href="node727.html" /> |
| 14 | <link rel="parent" href="node722.html" /> |
| 15 | <link rel="next" href="node729.html" /> |
| 16 | <meta name='aesop' content='information' /> |
| 17 | <title>16.1.6.6 Tk Option Data Types</title> |
| 18 | </head> |
| 19 | <body> |
| 20 | <DIV CLASS="navigation"> |
| 21 | <div id='top-navigation-panel' xml:id='top-navigation-panel'> |
| 22 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> |
| 23 | <tr> |
| 24 | <td class='online-navigation'><a rel="prev" title="16.1.6.5 The Window Manager" |
| 25 | href="node727.html"><img src='../icons/previous.png' |
| 26 | border='0' height='32' alt='Previous Page' width='32' /></A></td> |
| 27 | <td class='online-navigation'><a rel="parent" title="16.1.6 Handy Reference" |
| 28 | href="node722.html"><img src='../icons/up.png' |
| 29 | border='0' height='32' alt='Up One Level' width='32' /></A></td> |
| 30 | <td class='online-navigation'><a rel="next" title="16.1.6.7 Bindings and Events" |
| 31 | href="node729.html"><img src='../icons/next.png' |
| 32 | border='0' height='32' alt='Next Page' width='32' /></A></td> |
| 33 | <td align="center" width="100%">Python Library Reference</td> |
| 34 | <td class='online-navigation'><a rel="contents" title="Table of Contents" |
| 35 | href="contents.html"><img src='../icons/contents.png' |
| 36 | border='0' height='32' alt='Contents' width='32' /></A></td> |
| 37 | <td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png' |
| 38 | border='0' height='32' alt='Module Index' width='32' /></a></td> |
| 39 | <td class='online-navigation'><a rel="index" title="Index" |
| 40 | href="genindex.html"><img src='../icons/index.png' |
| 41 | border='0' height='32' alt='Index' width='32' /></A></td> |
| 42 | </tr></table> |
| 43 | <div class='online-navigation'> |
| 44 | <b class="navlabel">Previous:</b> |
| 45 | <a class="sectref" rel="prev" href="node727.html">16.1.6.5 The Window Manager</A> |
| 46 | <b class="navlabel">Up:</b> |
| 47 | <a class="sectref" rel="parent" href="node722.html">16.1.6 Handy Reference</A> |
| 48 | <b class="navlabel">Next:</b> |
| 49 | <a class="sectref" rel="next" href="node729.html">16.1.6.7 Bindings and Events</A> |
| 50 | </div> |
| 51 | <hr /></div> |
| 52 | </DIV> |
| 53 | <!--End of Navigation Panel--> |
| 54 | |
| 55 | <H3><A NAME="SECTION0018166000000000000000"> |
| 56 | 16.1.6.6 Tk Option Data Types</A> |
| 57 | </H3> |
| 58 | <P> |
| 59 | <a id='l2h-4839' xml:id='l2h-4839'></a> |
| 60 | |
| 61 | <P> |
| 62 | <DL> |
| 63 | <DT><STRONG>anchor</STRONG></DT> |
| 64 | <DD>Legal values are points of the compass: <code>"n"</code>, |
| 65 | <code>"ne"</code>, <code>"e"</code>, <code>"se"</code>, <code>"s"</code>, |
| 66 | <code>"sw"</code>, <code>"w"</code>, <code>"nw"</code>, and also |
| 67 | <code>"center"</code>. |
| 68 | |
| 69 | <P> |
| 70 | </DD> |
| 71 | <DT><STRONG>bitmap</STRONG></DT> |
| 72 | <DD>There are eight built-in, named bitmaps: <code>'error'</code>, <code>'gray25'</code>, |
| 73 | <code>'gray50'</code>, <code>'hourglass'</code>, <code>'info'</code>, <code>'questhead'</code>, |
| 74 | <code>'question'</code>, <code>'warning'</code>. To specify an X bitmap |
| 75 | filename, give the full path to the file, preceded with an <code>@</code>, |
| 76 | as in <code>"@/usr/contrib/bitmap/gumby.bit"</code>. |
| 77 | |
| 78 | <P> |
| 79 | </DD> |
| 80 | <DT><STRONG>boolean</STRONG></DT> |
| 81 | <DD>You can pass integers 0 or 1 or the strings <code>"yes"</code> or <code>"no"</code> . |
| 82 | |
| 83 | <P> |
| 84 | </DD> |
| 85 | <DT><STRONG>callback</STRONG></DT> |
| 86 | <DD>This is any Python function that takes no arguments. For example: |
| 87 | <div class="verbatim"><pre> |
| 88 | def print_it(): |
| 89 | print "hi there" |
| 90 | fred["command"] = print_it |
| 91 | </pre></div> |
| 92 | |
| 93 | <P> |
| 94 | </DD> |
| 95 | <DT><STRONG>color</STRONG></DT> |
| 96 | <DD>Colors can be given as the names of X colors in the rgb.txt file, |
| 97 | or as strings representing RGB values in 4 bit: <code>"#RGB"</code>, 8 |
| 98 | bit: <code>"#RRGGBB"</code>, 12 bit" <code>"#RRRGGGBBB"</code>, or 16 bit |
| 99 | <code>"#RRRRGGGGBBBB"</code> ranges, where R,G,B here represent any |
| 100 | legal hex digit. See page 160 of Ousterhout's book for details. |
| 101 | |
| 102 | <P> |
| 103 | </DD> |
| 104 | <DT><STRONG>cursor</STRONG></DT> |
| 105 | <DD>The standard X cursor names from <span class="file">cursorfont.h</span> can be used, |
| 106 | without the <code>XC_</code> prefix. For example to get a hand cursor |
| 107 | (<tt class="constant">XC_hand2</tt>), use the string <code>"hand2"</code>. You can also |
| 108 | specify a bitmap and mask file of your own. See page 179 of |
| 109 | Ousterhout's book. |
| 110 | |
| 111 | <P> |
| 112 | </DD> |
| 113 | <DT><STRONG>distance</STRONG></DT> |
| 114 | <DD>Screen distances can be specified in either pixels or absolute |
| 115 | distances. Pixels are given as numbers and absolute distances as |
| 116 | strings, with the trailing character denoting units: <code>c</code> |
| 117 | for centimetres, <code>i</code> for inches, <code>m</code> for millimetres, |
| 118 | <code>p</code> for printer's points. For example, 3.5 inches is expressed |
| 119 | as <code>"3.5i"</code>. |
| 120 | |
| 121 | <P> |
| 122 | </DD> |
| 123 | <DT><STRONG>font</STRONG></DT> |
| 124 | <DD>Tk uses a list font name format, such as <code>{courier 10 bold}</code>. |
| 125 | Font sizes with positive numbers are measured in points; |
| 126 | sizes with negative numbers are measured in pixels. |
| 127 | |
| 128 | <P> |
| 129 | </DD> |
| 130 | <DT><STRONG>geometry</STRONG></DT> |
| 131 | <DD>This is a string of the form "<tt class="samp"><var>width</var>x<var>height</var></tt>", where |
| 132 | width and height are measured in pixels for most widgets (in |
| 133 | characters for widgets displaying text). For example: |
| 134 | <code>fred["geometry"] = "200x100"</code>. |
| 135 | |
| 136 | <P> |
| 137 | </DD> |
| 138 | <DT><STRONG>justify</STRONG></DT> |
| 139 | <DD>Legal values are the strings: <code>"left"</code>, |
| 140 | <code>"center"</code>, <code>"right"</code>, and <code>"fill"</code>. |
| 141 | |
| 142 | <P> |
| 143 | </DD> |
| 144 | <DT><STRONG>region</STRONG></DT> |
| 145 | <DD>This is a string with four space-delimited elements, each of |
| 146 | which is a legal distance (see above). For example: <code>"2 3 4 |
| 147 | 5"</code> and <code>"3i 2i 4.5i 2i"</code> and <code>"3c 2c 4c 10.43c"</code> |
| 148 | are all legal regions. |
| 149 | |
| 150 | <P> |
| 151 | </DD> |
| 152 | <DT><STRONG>relief</STRONG></DT> |
| 153 | <DD>Determines what the border style of a widget will be. Legal |
| 154 | values are: <code>"raised"</code>, <code>"sunken"</code>, |
| 155 | <code>"flat"</code>, <code>"groove"</code>, and <code>"ridge"</code>. |
| 156 | |
| 157 | <P> |
| 158 | </DD> |
| 159 | <DT><STRONG>scrollcommand</STRONG></DT> |
| 160 | <DD>This is almost always the <tt class="method">set()</tt> method of some scrollbar |
| 161 | widget, but can be any widget method that takes a single argument. |
| 162 | Refer to the file <span class="file">Demo/tkinter/matt/canvas-with-scrollbars.py</span> |
| 163 | in the Python source distribution for an example. |
| 164 | |
| 165 | <P> |
| 166 | </DD> |
| 167 | <DT><STRONG>wrap:</STRONG></DT> |
| 168 | <DD>Must be one of: <code>"none"</code>, <code>"char"</code>, or <code>"word"</code>. |
| 169 | </DD> |
| 170 | </DL> |
| 171 | |
| 172 | <P> |
| 173 | |
| 174 | <DIV CLASS="navigation"> |
| 175 | <div class='online-navigation'> |
| 176 | <p></p><hr /> |
| 177 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> |
| 178 | <tr> |
| 179 | <td class='online-navigation'><a rel="prev" title="16.1.6.5 The Window Manager" |
| 180 | href="node727.html"><img src='../icons/previous.png' |
| 181 | border='0' height='32' alt='Previous Page' width='32' /></A></td> |
| 182 | <td class='online-navigation'><a rel="parent" title="16.1.6 Handy Reference" |
| 183 | href="node722.html"><img src='../icons/up.png' |
| 184 | border='0' height='32' alt='Up One Level' width='32' /></A></td> |
| 185 | <td class='online-navigation'><a rel="next" title="16.1.6.7 Bindings and Events" |
| 186 | href="node729.html"><img src='../icons/next.png' |
| 187 | border='0' height='32' alt='Next Page' width='32' /></A></td> |
| 188 | <td align="center" width="100%">Python Library Reference</td> |
| 189 | <td class='online-navigation'><a rel="contents" title="Table of Contents" |
| 190 | href="contents.html"><img src='../icons/contents.png' |
| 191 | border='0' height='32' alt='Contents' width='32' /></A></td> |
| 192 | <td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png' |
| 193 | border='0' height='32' alt='Module Index' width='32' /></a></td> |
| 194 | <td class='online-navigation'><a rel="index" title="Index" |
| 195 | href="genindex.html"><img src='../icons/index.png' |
| 196 | border='0' height='32' alt='Index' width='32' /></A></td> |
| 197 | </tr></table> |
| 198 | <div class='online-navigation'> |
| 199 | <b class="navlabel">Previous:</b> |
| 200 | <a class="sectref" rel="prev" href="node727.html">16.1.6.5 The Window Manager</A> |
| 201 | <b class="navlabel">Up:</b> |
| 202 | <a class="sectref" rel="parent" href="node722.html">16.1.6 Handy Reference</A> |
| 203 | <b class="navlabel">Next:</b> |
| 204 | <a class="sectref" rel="next" href="node729.html">16.1.6.7 Bindings and Events</A> |
| 205 | </div> |
| 206 | </div> |
| 207 | <hr /> |
| 208 | <span class="release-info">Release 2.4.2, documentation updated on 28 September 2005.</span> |
| 209 | </DIV> |
| 210 | <!--End of Navigation Panel--> |
| 211 | <ADDRESS> |
| 212 | See <i><a href="about.html">About this document...</a></i> for information on suggesting changes. |
| 213 | </ADDRESS> |
| 214 | </BODY> |
| 215 | </HTML> |