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(
        undef,
        [ qw/ destroy-with-parent modal / ],
        'warning',
        'none',
        $t,
    );
    $box->set_default_size(600, 0);

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

Regards,
-- 
#Aristotle
*AUTOLOAD=*_=sub{s/(.*)::(.*)/print$2,(",$\/"," ")[defined wantarray]/e;$1};
&Just->another->Perl->hacker;



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