spebern has asked for the wisdom of the Perl Monks concerning the following question:

I need my application to wait until a toplevel Window is destroyed. Is there something in Tkx like

$widget->waitWindow;

Using message boxes is not an option, because I need a scrollbar in the dialog box

Thanks!

Replies are listed 'Best First'.
Re: tkx waitWindwow
by spebern (Initiate) on Aug 19, 2015 at 09:22 UTC

    Thanks for the quick replies! I have found another solution that works exactly as needed.

    This is my first time building a "bigger" gui and I had some problems with usage of tcl and tk in the tkx namespace.

    What I wanted:
    - popup with a message
    - scrollbar ( message can be long )
    - let script wait until this popup is closed

    Here my solution:

    my $mw = Tkx::widget->new("."); #somewhere else a popup sub sub scrolled_message_box { my ( $mw, $message ) = @_; my $child = $self->mw->new___toplevel(); my $textbox = $child->new_tkx_Scrolled('text'); $textbox->insert_end( $message ); $textbox->configure( -state => "disabled", -wrap => "none", ); $textbox->g_pack( -expand => 1, -fill => 'both' ); #this is what I was looking for #part of the problem was that I did not know #how to access tcl namespace ( Tkx::__tclExpression ) Tkx::__tkwait('window', '.t'); }
Re: tkx waitWindwow
by GotToBTru (Prior) on Aug 18, 2015 at 18:45 UTC

    What does the documentation say?

    Dum Spiro Spero
Re: tkx waitWindwow
by james28909 (Deacon) on Aug 18, 2015 at 23:44 UTC
    Maybe this will be of assistance? :) This node suggest to possibly raise or withdaw instead of destroying it. Looks like you could at the very least get some ideas from it.