Resizing MessageDialog



Hi,

i found the next problem in porting from perl-Gtk to perl-Gtk2, i don't
really understand.

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.

Everything works like expected from my experience with perl-Gtk, but i'm
not able to set the size of the window, the width always stays very small,
so the text is wrapped up very ugly.

Calling $box->set-resizebale(1) like in the C docu returns an error.


Shortened code:

# creating the dialog:

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

if(defined($ext)) {
   $box->add_action_widget($dbutton, 1);
}

# toggling the textfield

if #open the textfield
   $scrolled = Gtk2::ScrolledWindow->new(undef, undef);
   $box->vbox->add($scrolled);
   
   $buffer = Gtk2::TextBuffer->new();
   $buffer->set_text($ext);

   $text = Gtk2::TextView->new_with_buffer($buffer);

   $scrolled->add($text);
else #close the textfield
   $scrolled->destroy();
   $box->set_default_size(600, 0);


      stephan

-- 
t="\$_='for(\$i=-2;\$_=substr(\"2720ab25409d2500f82310a6272\",\$i+=2,3);)
   .~.
   /V\           [  sm sm-zone net     GnuPG: 0x7E30CD6D  ]
 /(   )\
  ^ ~ ^  {\$_=\$i++%2?hex:oct;\$_=chr(\$_%(2**2*22));\$_=\$i?lc:{};print;
}';s/\( +\)|[.\/V~^\\\]+| {2,}|\\[\s+.+\s+\\]//g;eval \$_;"&&echo $t|perl

Attachment: pgpM5okHv24d_.pgp
Description: PGP signature



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