Forgetting and Recalling widgets
"Henry Merryweather" <[email protected]> Wed, 12 Sep 2007 10:03:40 +0100
| Newsgroups | gmane.comp.lang.perl.tk |
|---|---|
| Message-ID | <000a01c7f51b$d077e930$0300aac0@DESKTOP> |
This is a multi-part message in MIME format.
------=_NextPart_000_000B_01C7F524.323C5130
Content-Type: multipart/alternative;
boundary="----=_NextPart_001_000C_01C7F524.323DD7D0"
------=_NextPart_001_000C_01C7F524.323DD7D0
Content-Type: text/plain;
charset="windows-1250"
Content-Transfer-Encoding: quoted-printable
I want to selectively hide and then recall widgets and when I recall the
widget it would be good if the widget was exactly the same as when it =
was
hidden.
gridForget hides the widget. However, I cannot see a way of simply
recalling the widget with its contents the same as when it was =
=91forgotten=92.
=20
I tested this with the Perl code below and attached. This gives two =
columns
where each column is:
1. an Entry box at the top
2. a Button to remove the Entry box at the top
3. a Button to recall the Entry box at the top.
=20
In both cases, the Button is recalled by using the same widget =
definition as
used when the GUI was created (but without setting the contents of the =
Entry
box). This seems to have the effect (as expected) of overwriting the
original definition so that the contents (when the widget is =
=91forgotten=92)
are lost. To overcome this:
1. I saved the contents of the Entry widget before using gridForget for
the first column - in sub forget_CellA_cb;
2. I retrieved the contents of the Entry widget after using gridForget
but before using the re-definition for the second column =96 in sub
recall_CellB_cb.
=20
Both worked. This also showed that the contents of the second Entry box
were available even though this had been forgotten.
=20
The question is, is there a way of recalling the =91forgotten=92 widget =
with its
contents intact without any additional code?
=20
# this tests the forget for a grid widget
=20
use Tk;
use strict "vars";
=20
my ($mw_Main, );
my ($CellA_Entry, $CellB_Entry, $CellC_Entry);
my ($CellA_Text, $CellB_Text, $CellC_Text);
=20
#=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
#
# forget call backs
#
#=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
=20
sub forget_CellA_cb() {
=20
$CellA_Text =3D $CellA_Entry->get();
$CellA_Entry->gridForget();
=20
=20
}
=20
sub forget_CellB_cb() {
=20
$CellB_Entry->gridForget();
=20
}
=20
#=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
#
# recall call backs
#
#=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
=20
sub recall_CellA_cb() {
=20
$CellA_Entry =3D $mw_Main->Entry(-width =3D> 6)->grid( -row =3D> 0, =
-column =3D> 0);
$CellA_Entry->configure(-text =3D> $CellA_Text);
}
=20
sub recall_CellB_cb() {
=20
my $CellB_OldText;
=20
$CellB_OldText =3D $CellB_Entry->get();
=20
$CellB_Entry =3D $mw_Main->Entry(-width =3D> 6)->grid( -row =3D> 0, =
-column =3D> 1);
$CellB_Entry->configure(-text =3D> $CellB_OldText);
}
=20
#=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D
=3D=3D=3D
#
# sub gui-set
#
# this sets up a gui with Entry boxes, forget buttons and recall buttons
=20
#=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D
=3D=3D=3D=3D
=20
sub gui_set() {
=20
$mw_Main =3D MainWindow->new;
=20
$CellA_Entry =3D $mw_Main->Entry(-width =3D> 6, -text =3D> =
'AAA')->grid(-row =3D> 0,
-column =3D> 0);
$CellB_Entry =3D $mw_Main->Entry(-width =3D> 6, -text =3D> =
'BBB')->grid(-row =3D> 0,
-column =3D> 1);
=20
=20
$mw_Main->Button(-text =3D> "Forget Entry Box at Top", -command =3D>
\&forget_CellA_cb)->grid(-row =3D> 1, -column =3D> 0);
=20
$mw_Main->Button(-text =3D> "Forget Entry Box at Top", -command =3D>
\&forget_CellB_cb)->grid(-row =3D> 1, -column =3D> 1);
=20
=20
$mw_Main->Button(-text =3D> "Recall Entry Box at Top", -command =3D>
\&recall_CellA_cb)->grid(-row =3D> 2, -column =3D> 0);
=20
$mw_Main->Button(-text =3D> "Recall Entry Box at Top",-command =3D>
\&recall_CellB_cb)->grid(-row =3D> 2, -column =3D> 1);
=20
=20
MainLoop;
=20
}
=20
=20
############## in line code #########################
=20
gui_set()
=20
=20
=20
Best regards
=20
Henry Merryweather
=20
Telephone: +44 (0) 1225 859051
Web: HYPERLINK
"http://www.merryweathersolutions.co.uk"www.merryweathersolutions.co.uk
=20
No virus found in this outgoing message.
Checked by AVG Free Edition.=20
Version: 7.5.485 / Virus Database: 269.13.15/1002 - Release Date: =
11/09/2007
17:46
=20
=20
------=_NextPart_001_000C_01C7F524.323DD7D0
Content-Type: text/html;
charset="windows-1250"
Content-Transfer-Encoding: quoted-printable
<html>
<head>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dwindows-1250">
<meta name=3DGenerator content=3D"Microsoft Word 10 (filtered)">
<style>
<!--
/* Font Definitions */
@font-face
{font-family:"Franklin Gothic Book";
panose-1:2 11 5 3 2 1 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
span.EmailStyle17
{font-family:"Franklin Gothic Book";
color:windowtext;
font-weight:normal;
font-style:normal;
text-decoration:none none;}
@page Section1
{size:595.3pt 841.9pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
{page:Section1;}
/* List Definitions */
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
-->
</style>
</head>
<body lang=3DEN-GB link=3Dblue vlink=3Dpurple>
<div class=3DSection1>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic Book"'>I want to
selectively hide and then recall widgets and when I recall the widget it =
would
be good if the widget was exactly the same as when it was =
hidden.</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic Book"'>gridForget =
hides the
widget. However, I cannot see a way of simply recalling the widget =
with
its contents the same as when it was =91forgotten=92.</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic Book"'>I tested =
this with
the Perl code below and attached. This gives two columns where =
each column
is:</span></font></p>
<ol start=3D1 type=3D1>
<li class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic =
Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic Book"'>an =
Entry box
at the top</span></font></li>
<li class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic =
Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic Book"'>a =
Button to
remove the Entry box at the top</span></font></li>
<li class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic =
Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic Book"'>a =
Button to
recall the Entry box at the top.</span></font></li>
</ol>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic Book"'>In both =
cases, the
Button is recalled by using the same widget definition as used when the =
GUI was
created (but without setting the contents of the Entry box). This =
seems
to have the effect (as expected) of overwriting the original definition =
so that
the contents (when the widget is =91forgotten=92) are lost. To
overcome this:</span></font></p>
<ol start=3D1 type=3D1>
<li class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic =
Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic Book"'>I =
saved the
contents of the Entry widget before using gridForget for the first =
column
- in sub forget_CellA_cb;</span></font></li>
<li class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic =
Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic Book"'>I =
retrieved
the contents of the Entry widget after using gridForget but before =
using
the re-definition for the second column =96 in sub =
recall_CellB_cb.</span></font></li>
</ol>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic Book"'>Both =
worked.
This also showed that the contents of the second Entry box were =
available even
though this had been forgotten.</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic Book"'>The =
question is, is
there a way of recalling the =91forgotten=92 widget with its contents
intact without any additional code?</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic Book"'># this =
tests the
forget for a grid widget</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic Book"'>use =
Tk;</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic Book"'>use strict =
"vars";</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic Book"'>my =
($mw_Main, );</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic Book"'>my =
($CellA_Entry, $CellB_Entry,
$CellC_Entry);</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic Book"'>my =
($CellA_Text, $CellB_Text,
$CellC_Text);</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'>#=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'>#</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic Book"'># forget =
call backs</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'>#</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'>#=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic Book"'>sub =
forget_CellA_cb()
{</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'>$CellA_Text =3D $CellA_Entry->get();</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'>$CellA_Entry->gridForget();</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'>}</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic Book"'>sub =
forget_CellB_cb()
{</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'>$CellB_Entry->gridForget();</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'>}</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'>#=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'>#</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic Book"'># recall =
call backs</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'>#</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'>#=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic Book"'>sub =
recall_CellA_cb()
{</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'>$CellA_Entry =3D $mw_Main->Entry(-width
=3D> 6)->grid( -row =3D> 0, -column =3D> =
0);</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'>$CellA_Entry->configure(-text
=3D> $CellA_Text);</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'>}</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic Book"'>sub =
recall_CellB_cb()
{</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic Book"'>my =
$CellB_OldText;</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'>$CellB_OldText =3D $CellB_Entry->get();</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'>$CellB_Entry =3D $mw_Main->Entry(-width
=3D> 6)->grid( -row =3D> 0, -column =3D> =
1);</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'>$CellB_Entry->configure(-text
=3D> $CellB_OldText);</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'>}</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'>#=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'>#</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic Book"'># sub =
gui-set</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'>#</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic Book"'># this =
sets up a
gui with Entry boxes, forget buttons and recall =
buttons</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'>#=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic Book"'>sub =
gui_set() {</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic Book"'>$mw_Main =
=3D MainWindow->new;</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'>$CellA_Entry =3D $mw_Main->Entry(-width
=3D> 6, -text =3D> 'AAA')->grid(-row =3D> 0, -column =3D> =
0);</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'>$CellB_Entry =3D $mw_Main->Entry(-width
=3D> 6, -text =3D> 'BBB')->grid(-row =3D> 0, -column =3D> =
1);</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'>$mw_Main->Button(-text
=3D> "Forget Entry Box at Top", -command =3D> =
\&forget_CellA_cb)->grid(-row
=3D> 1, -column =3D> 0);</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'>$mw_Main->Button(-text
=3D> "Forget Entry Box at Top", -command =3D> =
\&forget_CellB_cb)->grid(-row
=3D> 1, -column =3D> 1);</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'>$mw_Main->Button(-text
=3D> "Recall Entry Box at Top", -command =3D> =
\&recall_CellA_cb)->grid(-row
=3D> 2, -column =3D> 0);</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'>$mw_Main->Button(-text
=3D> "Recall Entry Box at Top",-command =3D>
\&recall_CellB_cb)->grid(-row =3D> 2, -column =3D> =
1);</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'>MainLoop;</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'>}</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'>############## in
line code #########################</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'>gui_set()</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Franklin Gothic Book"><span
style=3D'font-size:10.0pt;font-family:"Franklin Gothic =
Book"'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Times New Roman"><span =
style=3D'font-size:
10.0pt'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Best regards</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Times New Roman"><span =
style=3D'font-size:
10.0pt'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Henry Merryweather</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Times New Roman"><span =
style=3D'font-size:
10.0pt'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Telephone: +44 (0) 1225 859051</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Web: <a =
href=3D"http://www.merryweathersolutions.co.uk">www.merryweathersolutions=
.co.uk</a></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3D"Times New Roman"><span =
style=3D'font-size:
10.0pt'> </span></font></p>
</div>
</body>
</html>
<BR>
<P><FONT SIZE=3D2>No virus found in this outgoing message.<BR>
Checked by AVG Free Edition.<BR>
Version: 7.5.485 / Virus Database: 269.13.15/1002 - Release Date: =
11/09/2007 17:46<BR>
</FONT> </P>
<P><FONT SIZE=3D2 FACE=3D"Arial"> </FONT> </P>
------=_NextPart_001_000C_01C7F524.323DD7D0--
------=_NextPart_000_000B_01C7F524.323C5130
Content-Type: application/octet-stream;
name="forget-widget-test.pz"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="forget-widget-test.pz"
# this tests the forget for a grid widget
use Tk;
use Tk::TabFrame;
use strict "vars";
my ($mw_Main, );
my ($CellA_Entry, $CellB_Entry, $CellC_Entry);
my ($CellA_Text, $CellB_Text, $CellC_Text);
#=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
#
# forget call backs
#
#=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
sub forget_CellA_cb() {
$CellA_Text =3D $CellA_Entry->get();
$CellA_Entry->gridForget();
=20
}
sub forget_CellB_cb() {
$CellB_Entry->gridForget();
}
#=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
#
# recall call backs
#
#=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
sub recall_CellA_cb() {
$CellA_Entry =3D $mw_Main->Entry(-width =3D> 6)->grid( -row =3D> 0, =
-column =3D> 0);
$CellA_Entry->configure(-text =3D> $CellA_Text);
}
sub recall_CellB_cb() {
my $CellB_OldText;
$CellB_OldText =3D $CellB_Entry->get();
$CellB_Entry =3D $mw_Main->Entry(-width =3D> 6)->grid( -row =3D> 0, =
-column =3D> 1);
$CellB_Entry->configure(-text =3D> $CellB_OldText);
}
#=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
#
# sub gui-set
#
# this sets up a gui with Entry boxes, forget buttons and recall buttons
#=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
sub gui_set() {
$mw_Main =3D MainWindow->new;
$CellA_Entry =3D $mw_Main->Entry(-width =3D> 6)->grid( -row =3D> 0, =
-column =3D> 0);
$CellB_Entry =3D $mw_Main->Entry(-width =3D> 6)->grid(-row =3D> 0, =
-column =3D> 1);
$mw_Main->Button(-text =3D> "Forget Cell at Top",
-command =3D> \&forget_CellA_cb)->grid(-row =3D> 1, -column =3D> 0);
$mw_Main->Button(-text =3D> "Forget Cell at Top",
-command =3D> \&forget_CellB_cb)->grid(-row =3D> 1, -column =3D> 1);
$mw_Main->Button(-text =3D> "Recall Cell at Top",
-command =3D> \&recall_CellA_cb)->grid(-row =3D> 2, -column =3D> 0);
$mw_Main->Button(-text =3D> "Recall Cell at Top",
-command =3D> \&recall_CellB_cb)->grid(-row =3D> 2, -column =3D> 1);
MainLoop;
}
############## in line code #########################
gui_set()
------=_NextPart_000_000B_01C7F524.323C5130
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
--++**==--++**==--++**==--++**==--++**==--++**==--++**==
ptk mailing list
[email protected]
https://mailman.stanford.edu/mailman/listinfo/ptk
------=_NextPart_000_000B_01C7F524.323C5130--