in reply to Re^2: Tk::Wizard content
in thread Tk::Wizard content

You don't want to use a DialogBox then. A DialogBox will create it's own toplevel window to be in, it isn't like a frame.

I still don't know what your overall software is supposed to do. It sounds like you want to get some inforamtion from a popup, then feed the results from the popup to some other frame?

Tk widgets are like complex jigsaw puzzle pieces. They have to be fit together properly, or they won't work.

Maybe you could get the result from a DialogBox, then feed that output to the Wizard? Maybe use the $letter from this script, and use that for your -text option in the Wizard?

#!/usr/bin/perl use Tk; use Tk::DialogBox; my $mw = MainWindow->new; my $dialog = $mw->DialogBox( -buttons => [qw/Ok Cancel/], -title => "Enter New Value" ); my $dialogE = $dialog->add("Entry"); $dialogE->pack(qw/-padx 10 -pady 10/); my $button = $mw->Button( -text => "Get new value...", -command => [ \&getNewValue, $dialog, $entry ] )->pack(qw/-side left -padx 10/); MainLoop; sub getNewValue { my ( $db, $entry ) = @_; my $dbEntry = $db->Subwidget('entry'); ## Clear the Entry before showing the dialog $dbEntry->delete( 0, 'end' ); ## Determine whether or not the user hit "Ok" my $button = $db->Show(); if ( $button eq "Ok" ) { my $letter = $dbEntry->get(); print "$letter was submitted\n"; } } __END__

I'm not really a human, but I play one on earth. flash japh

Replies are listed 'Best First'.
Re^4: Tk::Wizard content
by mikasue (Friar) on Apr 18, 2006 at 21:13 UTC
    I think i've figured it out.
    my $user_wizard = new Tk::Wizard( -title => " User Wizard", -imagepath => "people.gif", ); $user_wizard->addPage( sub { return $user_wizard->blank_frame( -title => "Page Title", -subtitle => "Sub-title", -text => "Some text.", ); }); $user_wizard->addPage(sub{ my $bframe= $user_wizard- +>blank_frame( -title => "Welcome to the User Informati +on Wizard", -text=>"What is your name?"); my $lbfirstname = $bframe->Label(-text=>"First Name", -backgro +und=>'white')->pack; my $lbfnentry = $bframe->Entry->pack; my $lblastname = $bframe->Label(-text=>"Last Name", -backgroun +d=>'white')->pack; my $lblnentry = $bframe->Entry->pack; return $bframe; } ); $user_wizard->Show; MainLoop; __END__
    Now if I can just resize the Wizard box somehow to show all my text.

    There is a -resizable option but I don't know what boolean value to give it.. http://search.cpan.org/~lgoddard/Tk-Wizard-Bases-1.92/lib/Tk/Wizard.pm

    my $user_wizard = new Tk::Wizard( -title => " User Wizard", -style=>'top', -imagepath => "z:\\BPP\\people.gif", -resizable=>"0", );
      I'm glad to hear you figured it out, but I will say one thing. Tk::Wizard isn't used very often at all, so don't expect too many people to know about it. As a matter of fact, you are the first Wizard question I've seen here in years. So when you use these GUI-makers, expect to run into troubles, that occur because of the hidden complexities of the GUI-designer. That is why most Tk authors always stick to the basic widget set, it's a little more work, but you have more control.

      I'm not really a human, but I play one on earth. flash japh
        Thanks! I am learning a lot about Tk::Wizard. It's really not bad.