Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / tools / perl-5.8.0 / lib / site_perl / 5.8.0 / sun4-solaris / Tk / demos / widget_lib / mkEntry.pl
CommitLineData
86530b38
AT
1
2
3sub mkEntry {
4
5 # Create a top-level window that displays a bunch of entries.
6
7 $mkEntry->destroy if Exists($mkEntry);
8 $mkEntry = $top->Toplevel();
9 my $w = $mkEntry;
10 dpos $w;
11 $w->title('Entry Demonstration');
12 $w->iconname('Entries');
13 my $w_msg = $w->Label(-font => '-Adobe-times-medium-r-normal--*-180-*-*-*-*-*-*', -wraplength => '5i',
14 -justify => 'left', -text => 'Three different entries are displayed below. You can add ' .
15 'characters by pointing, clicking and typing. You can delete by selecting and typing ' .
16 'Backspace, Delete, or Control-X. Backspace and Control-h erase the character to the left ' .
17 'of the insertion cursor, Delete and Control-d delete the chararacter to the right of the ' .
18 'insertion cursor, Control-W erases the word to the left of the insertion cursor, and Meta-d ' .
19 'deletes the word to the right of the insertion cursor. For entries that are too large to ' .
20 'fit in the window all at once, you can scan through the entries by dragging with mouse button ' .
21 '2 pressed. Click the "OK" button when you\'ve seen enough.');
22 my $w_frame = $w->Frame(-borderwidth => 10);
23 my $w_ok = $w->Button(-text => 'OK', -width => 8, -command => ['destroy', $w]);
24 my(@pl) = (-side => 'top', -fill => 'both');
25 $w_msg->pack(@pl);
26 $w_frame->pack(@pl);
27 $w_ok->pack(-side => 'top');
28
29 my $w_frame_e1 = $w_frame->Entry(-relief => 'sunken');
30 my $w_frame_e2 = $w_frame->Entry(-relief => 'sunken');
31 my $w_frame_e3 = $w_frame->Entry(-relief => 'sunken');
32 @pl = (-side => 'top', -pady => 5, -fill => 'x');
33 $w_frame_e1->pack(@pl);
34 $w_frame_e2->pack(@pl);
35 $w_frame_e3->pack(@pl);
36
37 $w_frame_e1->insert(0, 'Initial value');
38 $w_frame_e2->insert('end', 'This entry contains a long value, much too long ');
39 $w_frame_e2->insert('end', 'to fit in the window at one time, so long in fact ');
40 $w_frame_e2->insert('end', 'that you\'ll have to scan or scroll to see the end.');
41
42} # end mkEntry
43
44
451;