Re: Resizing MessageDialog

* Stephan Martin <sm sm-zone net> [2005-04-02 09:00]:
I create a Dialog with a warning, and if i have some additional
info (output of the command) i add a second button to toggle a
textfield with this extended information.

Instead of rolling your own solution using a button, you should
use the appropriate widget, in this case an expander.

    my $box = Gtk2::MessageDialog->new(
        [ qw/ destroy-with-parent modal / ],
    $box->set_default_size(600, 0);

    if( defined $ext ) {
        my $more = Gtk2::Expander->new( "More information" );
            Gtk2::Label->new( $text ) # whichever widget you want
        $box->vbox->add( $more );

*AUTOLOAD=*_=sub{s/(.*)::(.*)/print$2,(",$\/"," ")[defined wantarray]/e;$1};

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]