FWD: Re: GtkText -> GtkTextView ?



forgot to CC the list...

Pascal writes:
 [...]
With GtkText i used the GtkEditable methods : delete_text(), get_length() an$
What am i suppose to do with GtkTextView ? I've to use the buffer ?

Is GtkTextView really what i should use as a replacement ?


Yes, you have to use the buffer. All the work happens in the buffer,
and TextView is just a "window" to it.

Try something like:
my $text_view = Gtk2::TextView->new;
my $text_buffer = $text_view->get_buffer;
my $iter = $text_buffer->get_iter_at_offset(0);
$text_view->set_wrap_mode ('word');
$text_view->set_editable( FALSE );
$text_view->set_cursor_visible( FALSE );
$text_view->show();

$text_buffer->insert($iter, "Some Text To Display\n");

The docs at http://gtk.org actually translate to perl well for
GtkText*. Check this section:
http://developer.gnome.org/doc/API/2.0/gtk/TextWidgetObjects.html




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