22.07.2013 Views

A Comprehensive Introduction to Python Programming and ... - MSDL

A Comprehensive Introduction to Python Programming and ... - MSDL

A Comprehensive Introduction to Python Programming and ... - MSDL

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

3.2 The Different Widgets 27 / 75<br />

3.2.4 Entry<br />

Method Description<br />

deselect() Deselects the checkbut<strong>to</strong>n <strong>and</strong> s<strong>to</strong>res the value specified<br />

by the offvalue option <strong>to</strong> its associated variable.<br />

flash() Redraws the but<strong>to</strong>n several times, alternating between<br />

active <strong>and</strong> normal colors.<br />

invoke() Simulates a click on the widget (<strong>to</strong>ggles the state, updates<br />

the variable <strong>and</strong> invokes the callback associated<br />

with the checkbut<strong>to</strong>n, if any).<br />

select() Selects the checkbut<strong>to</strong>n <strong>and</strong> s<strong>to</strong>res the value specified<br />

by the onvalue option <strong>to</strong> its associated variable.<br />

<strong>to</strong>ggle() Similar <strong>to</strong> invoke(), but does not invoke the callback<br />

associated with the checkbut<strong>to</strong>n.<br />

The Entry widget allows users <strong>to</strong> type <strong>and</strong> edit a single line of text. A portion of this<br />

text can be selected.<br />

The Entry widget provides the following options:<br />

Option Description<br />

show Controls how <strong>to</strong> display the contents of the widget.<br />

If non-empty, the widget will replace characters <strong>to</strong> be<br />

displayed by the first character the specified string. To<br />

get a password entry widget, use ”*”.<br />

The Entry widget defines the following methods:<br />

Method Description<br />

delete(index), delete(from,<strong>to</strong>) Delete the character at index, or within the given range.<br />

Use delete(0, END) <strong>to</strong> delete all text in the widget.<br />

get() Returns the current contents of the widget.<br />

insert(index, text) Inserts text at the given index. Use insert(INSERT,<br />

text) <strong>to</strong> insert text at the cursor, insert(END, text) <strong>to</strong><br />

append text <strong>to</strong> the widget.<br />

3.2.5 Frame<br />

The Frame widget is a rectangular container for other widgets. It is primarily used as<br />

a gemometry master since it allows <strong>to</strong> group widgets. It can have an unvisible border<br />

which is useful <strong>to</strong> space widgets. It can also have a visible border with a 3D effect, or<br />

no border at all.<br />

The Frame widget provides the following options:

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!