in reply to Re: Re: Re: clsoing sub window upon execution?
in thread clsoing sub window upon execution?

Ok cool. One thing though. What is the syntax to have the script perform it's function when the button in the dialogbox is pressed? Right now as I have it the script performs the function whenever I press the button that calls the dialogbox and not after I enter a line number and pree "Go". Here is the code.
sub go_to { my $sw = $mw->DialogBox(-title => "Go To Line", -buttons => ["Go"]) +; $sw->add("Entry", -text => \$line_number)->pack(); my $response = $sw->Show(&scroll_line); sub scroll_line { $line_number = $line_number - 1; my $calc = $line_number/$line_count; $t->yviewMoveto($calc); $line_number = $line_number + 1; } }
I just need "$response" to be executed when the Go button is pressed.

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: clsoing sub window upon execution?
by Grygonos (Chaplain) on Dec 04, 2003 at 17:15 UTC

    my $result = $myDialogBox->Show; print ($result eq "OK"? "user chose to save":"user discarded");
    just check the return value of the ->Show(); function


    Grygonos