1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.0//EN">
<!--Converted with LaTeX2HTML 96.1 (Feb 5, 1996) by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds -->
<HTML>
<HEAD>
<TITLE>Use of the Change function</TITLE>
<META NAME="description" CONTENT="Use of the Change function">
<META NAME="keywords" CONTENT="dotdotfiles">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<LINK REL=STYLESHEET HREF="dotdotfiles.css">
</HEAD>
<BODY BGCOLOR="#FFFFFF" LANG="EN">
<a href="index.html"><img align=right border=0 src=Graphics/gray-g3.gif></a><A NAME="tex2html668" HREF="node45.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="Graphics/next_motif.gif"></A> <A NAME="tex2html666" HREF="node43.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="Graphics/up_motif.gif"></A> <A NAME="tex2html660" HREF="node43.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="Graphics/previous_motif.gif"></A> <A NAME="tex2html670" HREF="node1.html"><IMG WIDTH=65 HEIGHT=24 ALIGN=BOTTOM ALT="contents" SRC="Graphics/contents_motif.gif"></A> <BR>
<B> Next:</B> <A NAME="tex2html669" HREF="node45.html">Use of the Init function</A>
<B>Up:</B> <A NAME="tex2html667" HREF="node43.html">The InitChange, ShowPage and
PageEnd </A>
<B> Previous:</B> <A NAME="tex2html661" HREF="node43.html">The InitChange, ShowPage and
PageEnd </A>
<BR> <HR> <P>
<H2><A NAME="SECTION00061000000000000000">Use of the <tt>Change</tt> function</A></H2>
<P>
<A NAME="Change"> </A>
The simplest case in which the Change function is to be used is when on
widget have to be disabled, when another is in a specefic state. To see
an example of this, imagine that there exists an element called <tt>number
of backups to keep</tt>, which is disabled if another element e.g. <tt>use
backup</tt> is deselected. This may look like this:
<PRE>proc page {} {
# page
CheckBox backup -text "Use backup"
Entry number -text "Number of backups to keep"
Change {
if {$backup} {
Enable number
} else {
Disable number
}
}
}</PRE>
<P>
<BR> <HR>
<P><ADDRESS>
<a href="http://www.imada.ou.dk/~blackie/">Jesper Kjær Pedersen</a> <<a href="mailto:blackie@imada.ou.dk">blackie@imada.ou.dk</a>><BR>
Wed Oct 2 13:29:53 MET DST 1996
</ADDRESS>
</BODY>
</HTML>
|