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

hey guys i found a tutorial about the Gtk2::TextView and know how to insert a text, but i dont know how to get a text inside the Gtk2 text box. Here is my code

#!/usr/bin/perl use strict; use warnings; use Gtk2 '-init'; use Glib qw/TRUE FALSE/; my $window=Gtk2::Window->new; $window->signal_connect('delete_event',sub{Gtk2::main_quit;}); my $vbox=Gtk2::VBox->new(); my $textview=Gtk2::TextView->new(); my $textbuffer=$textview->get_buffer; my $textiter=$textbuffer->get_end_iter; my $textiter1=$textbuffer->get_start_iter; $textbuffer->insert($textiter, "Hello"); $textview->set_buffer($textbuffer); my $button=Gtk2::Button->new("Submit"); $button->signal_connect(clicked=>sub{ my $rt=$textbuffer->get_text($textiter1, $textiter, 1); print "$rt\n"; }); $vbox->add($textview); $vbox->add($button); $window->add($vbox); $window->show_all; Gtk2->main;

Thanks in advance

Replies are listed 'Best First'.
Re: how to get a text inside the perl Gtk2::TextView
by ww (Archbishop) on Jan 09, 2015 at 20:33 UTC

    Given the sequence of your most recent questions, perhaps the best idea would be to settle down with the documentation until you know how to find your own answers.

Re: how to get a text inside the perl Gtk2::TextView
by Anonymous Monk on Jan 09, 2015 at 22:38 UTC
      hey monks... ill already know how to get a text inside the TextView .. ty.

        hey monks... ill already know how to get a text inside the TextView .. ty.

        Ok, so what is the question?