Re: Gtk2::TextView problems output



On Monday 18 February 2008 21.56.03 kilckk wrote:
Hello everyone, I wanted to know how to retrieve the text in a textview.

That is an entry just do:

My $test = $app->get_widget ("test");
Print $test->get_text;

But with a TextView?

Thanks for your help.
Excuse my English: P

_______________________________________________
gtk-perl-list mailing list
gtk-perl-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-perl-list


my $textview = Gtk2::TextView->new;

# put your text in it
my $buffer = $textview->get_buffer;
$buffer->insert ($buffer->get_end_iter, $text);

...

$dialog->run() ;

#retrieve the text
my $new_text =  $textview->get_buffer->get_text($buffer->get_start_iter, 
$buffer->get_end_iter, TRUE) ;

Nadim.



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