in reply to Re: Tk::MsgBox and my -message string
in thread Tk::MsgBox and my -message string
#!/usr/bin/perl $VERSION = 1.00; use strict; use Tk; use Tk::FileSelect; use Tk::MsgBox; my (%deck); #main window my $mw = MainWindow->new(); $mw->geometry("400x200"); #file selector button my $file_dialog = $mw->Button( -text => 'Load Cards', -command => \&load_deck ) ->grid(-row=>6,-column=>0); #start quiz button $mw->Button( -text => 'Quiz Me!', -command => \&quiz_me ) ->grid(-row=>6,-column=>2); #quit button $mw->Button( -text => 'Quit', -command => sub { exit } ) ->grid(-row=>6,-column=>4); #front & back popups # Here is where I believe those 2 blank ones at startup are coming fro +m... my $front = $mw->MsgBox(-title=>'FRONT',-default=>'ok',-icon=>'questio +n'); my $back = $mw->MsgBox(-title=>'BACK',-default=>'ok',-icon=>'info'); MainLoop; sub load_deck { my $start_dir = "/home/$ENV{'USER'}/TkPerl"; my $FSref = $mw->FileSelect(-directory => $start_dir); my $file = $FSref->Show; dbmopen(%deck, $file, 0644); } sub quiz_me { while ( my ($key, $value) = each (%deck) ) { #Configure the message value and then show the msgboxes $front->configure(-message=>$key); $front->Show; $back->configure(-message=>$value); $back->Show; } }
use strict; use CGI;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Tk::MsgBox and my -message string
by NetWallah (Canon) on Jan 06, 2008 at 06:49 UTC | |
by davidov0009 (Scribe) on Jan 06, 2008 at 19:28 UTC | |
by eserte (Deacon) on Jan 06, 2008 at 22:14 UTC |