Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / sam-t2 / devtools / v9 / html / python / lib / node715.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<link rel="STYLESHEET" href="lib.css" type='text/css' />
<link rel="SHORTCUT ICON" href="../icons/pyfav.png" type="image/png" />
<link rel='start' href='../index.html' title='Python Documentation Index' />
<link rel="first" href="lib.html" title='Python Library Reference' />
<link rel='contents' href='contents.html' title="Contents" />
<link rel='index' href='genindex.html' title='Index' />
<link rel='last' href='about.html' title='About this document...' />
<link rel='help' href='about.html' title='About this document...' />
<link rel="next" href="node716.html" />
<link rel="prev" href="module-Tkinter.html" />
<link rel="parent" href="module-Tkinter.html" />
<link rel="next" href="node716.html" />
<meta name='aesop' content='information' />
<title>16.1.1 Tkinter Modules</title>
</head>
<body>
<DIV CLASS="navigation">
<div id='top-navigation-panel' xml:id='top-navigation-panel'>
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td class='online-navigation'><a rel="prev" title="16.1 Tkinter "
href="module-Tkinter.html"><img src='../icons/previous.png'
border='0' height='32' alt='Previous Page' width='32' /></A></td>
<td class='online-navigation'><a rel="parent" title="16.1 Tkinter "
href="module-Tkinter.html"><img src='../icons/up.png'
border='0' height='32' alt='Up One Level' width='32' /></A></td>
<td class='online-navigation'><a rel="next" title="16.1.2 Tkinter Life Preserver"
href="node716.html"><img src='../icons/next.png'
border='0' height='32' alt='Next Page' width='32' /></A></td>
<td align="center" width="100%">Python Library Reference</td>
<td class='online-navigation'><a rel="contents" title="Table of Contents"
href="contents.html"><img src='../icons/contents.png'
border='0' height='32' alt='Contents' width='32' /></A></td>
<td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png'
border='0' height='32' alt='Module Index' width='32' /></a></td>
<td class='online-navigation'><a rel="index" title="Index"
href="genindex.html"><img src='../icons/index.png'
border='0' height='32' alt='Index' width='32' /></A></td>
</tr></table>
<div class='online-navigation'>
<b class="navlabel">Previous:</b>
<a class="sectref" rel="prev" href="module-Tkinter.html">16.1 Tkinter </A>
<b class="navlabel">Up:</b>
<a class="sectref" rel="parent" href="module-Tkinter.html">16.1 Tkinter </A>
<b class="navlabel">Next:</b>
<a class="sectref" rel="next" href="node716.html">16.1.2 Tkinter Life Preserver</A>
</div>
<hr /></div>
</DIV>
<!--End of Navigation Panel-->
<H2><A NAME="SECTION0018110000000000000000">
16.1.1 Tkinter Modules</A>
</H2>
<P>
Most of the time, the <tt class="module"><a href="module-Tkinter.html">Tkinter</a></tt> module is all you really
need, but a number of additional modules are available as well. The
Tk interface is located in a binary module named <tt class="module">_tkinter</tt>.
This module contains the low-level interface to Tk, and should never
be used directly by application programmers. It is usually a shared
library (or DLL), but might in some cases be statically linked with
the Python interpreter.
<P>
In addition to the Tk interface module, <tt class="module"><a href="module-Tkinter.html">Tkinter</a></tt> includes a
number of Python modules. The two most important modules are the
<tt class="module"><a href="module-Tkinter.html">Tkinter</a></tt> module itself, and a module called
<tt class="module">Tkconstants</tt>. The former automatically imports the latter, so
to use Tkinter, all you need to do is to import one module:
<P>
<div class="verbatim"><pre>
import Tkinter
</pre></div>
<P>
Or, more often:
<P>
<div class="verbatim"><pre>
from Tkinter import *
</pre></div>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><span class="typelabel">class</span>&nbsp;<tt id='l2h-4835' xml:id='l2h-4835' class="class">Tk</tt></b>(</nobr></td>
<td><var>screenName=None, baseName=None, className='Tk', useTk=1</var>)</td></tr></table></dt>
<dd>
The <tt class="class">Tk</tt> class is instantiated without arguments.
This creates a toplevel widget of Tk which usually is the main window
of an application. Each instance has its own associated Tcl interpreter.
<span class="versionnote">Changed in version 2.4:
The <var>useTk</var> parameter was added.</span>
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-4836' xml:id='l2h-4836' class="function">Tcl</tt></b>(</nobr></td>
<td><var>screenName=None, baseName=None, className='Tk', useTk=0</var>)</td></tr></table></dt>
<dd>
The <tt class="function">Tcl</tt> function is a factory function which creates an object
much like that created by the <tt class="class">Tk</tt> class, except that it does not
initialize the Tk subsystem. This is most often useful when driving the Tcl
interpreter in an environment where one doesn't want to create extraneous
toplevel windows, or where one cannot (i.e. Unix/Linux systems without an X
server). An object created by the <tt class="function">Tcl</tt> object can have a Toplevel
window created (and the Tk subsystem initialized) by calling its
<tt class="method">loadtk</tt> method.
<span class="versionnote">New in version 2.4.</span>
</dl>
<P>
Other modules that provide Tk support include:
<P>
<DL>
<DT><STRONG><tt class="module"><a href="module-ScrolledText.html">ScrolledText</a></tt></STRONG></DT>
<DD>Text widget with a vertical scroll bar built in.
<P>
</DD>
<DT><STRONG><tt class="module">tkColorChooser</tt></STRONG></DT>
<DD>Dialog to let the user choose a color.
<P>
</DD>
<DT><STRONG><tt class="module">tkCommonDialog</tt></STRONG></DT>
<DD>Base class for the dialogs defined in the other modules listed here.
<P>
</DD>
<DT><STRONG><tt class="module">tkFileDialog</tt></STRONG></DT>
<DD>Common dialogs to allow the user to specify a file to open or save.
<P>
</DD>
<DT><STRONG><tt class="module">tkFont</tt></STRONG></DT>
<DD>Utilities to help work with fonts.
<P>
</DD>
<DT><STRONG><tt class="module">tkMessageBox</tt></STRONG></DT>
<DD>Access to standard Tk dialog boxes.
<P>
</DD>
<DT><STRONG><tt class="module">tkSimpleDialog</tt></STRONG></DT>
<DD>Basic dialogs and convenience functions.
<P>
</DD>
<DT><STRONG><tt class="module">Tkdnd</tt></STRONG></DT>
<DD>Drag-and-drop support for <tt class="module"><a href="module-Tkinter.html">Tkinter</a></tt>.
This is experimental and should become deprecated when it is replaced
with the Tk DND.
<P>
</DD>
<DT><STRONG><tt class="module"><a href="module-turtle.html">turtle</a></tt></STRONG></DT>
<DD>Turtle graphics in a Tk window.
<P>
</DD>
</DL>
<P>
<DIV CLASS="navigation">
<div class='online-navigation'>
<p></p><hr />
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td class='online-navigation'><a rel="prev" title="16.1 Tkinter "
href="module-Tkinter.html"><img src='../icons/previous.png'
border='0' height='32' alt='Previous Page' width='32' /></A></td>
<td class='online-navigation'><a rel="parent" title="16.1 Tkinter "
href="module-Tkinter.html"><img src='../icons/up.png'
border='0' height='32' alt='Up One Level' width='32' /></A></td>
<td class='online-navigation'><a rel="next" title="16.1.2 Tkinter Life Preserver"
href="node716.html"><img src='../icons/next.png'
border='0' height='32' alt='Next Page' width='32' /></A></td>
<td align="center" width="100%">Python Library Reference</td>
<td class='online-navigation'><a rel="contents" title="Table of Contents"
href="contents.html"><img src='../icons/contents.png'
border='0' height='32' alt='Contents' width='32' /></A></td>
<td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png'
border='0' height='32' alt='Module Index' width='32' /></a></td>
<td class='online-navigation'><a rel="index" title="Index"
href="genindex.html"><img src='../icons/index.png'
border='0' height='32' alt='Index' width='32' /></A></td>
</tr></table>
<div class='online-navigation'>
<b class="navlabel">Previous:</b>
<a class="sectref" rel="prev" href="module-Tkinter.html">16.1 Tkinter </A>
<b class="navlabel">Up:</b>
<a class="sectref" rel="parent" href="module-Tkinter.html">16.1 Tkinter </A>
<b class="navlabel">Next:</b>
<a class="sectref" rel="next" href="node716.html">16.1.2 Tkinter Life Preserver</A>
</div>
</div>
<hr />
<span class="release-info">Release 2.4.2, documentation updated on 28 September 2005.</span>
</DIV>
<!--End of Navigation Panel-->
<ADDRESS>
See <i><a href="about.html">About this document...</a></i> for information on suggesting changes.
</ADDRESS>
</BODY>
</HTML>