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 / dialog1.pl
CommitLineData
86530b38
AT
1# dialog1.pl
2
3use subs qw/see_code/;
4use vars qw/$DIALOG1/;
5
6sub dialog1 {
7
8 my($demo) = @_;
9
10 my($ok, $can, $see) = ('OK', 'Cancel', 'See Code');
11 if (not Exists($DIALOG1)) {
12 $DIALOG1 = $MW->Dialog(
13 -title => 'Dialog with local grab',
14 -text => '',
15 -bitmap => 'info',
16 -default_button => $ok,
17 -buttons => [$ok, $can, $see],
18 );
19 $DIALOG1->configure(
20 -wraplength => '4i',
21 -text => 'This is a modal dialog box. It uses Tk\'s "grab" command to create a "local grab" on the dialog box. The grab prevents any pointer-related events from getting to any other windows in the application until you have answered the dialog by invoking one of the buttons below. However, you can still interact with other applications.',
22 );
23 }
24
25 my $button = $DIALOG1->Show;
26
27 print "You pressed OK\n" if $button eq $ok;
28 print "You pressed Cancel\n" if $button eq $can;
29 see_code 'dialog1' if $button eq $see;
30
31} # end dialog1
32
331;