Thanks that's worked out well, I've been changing around my implementation a bit. One last question. I setup the msgboxes in the MainLoop and I intialize their message values in a subroutine. When I run the program I get two blank msgboxes at startup (supposedly from the setup statements for them in the MainLoop). How can I avoid this?
Code below:
#!/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;

In reply to Re^2: Tk::MsgBox and my -message string by davidov0009
in thread Tk::MsgBox and my -message string by davidov0009

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.