Gtk2::TextView
- From: Daniel Kasak <dkasak nusconsulting com au>
- To: gtk-perl mailing list <gtk-perl-list gnome org>
- Subject: Gtk2::TextView
- Date: Mon, 19 Jul 2004 13:54:45 +1000
Hi all.
I want to display a note in a text widget.
From what I understand, I need a GtkTextView widget to display text
that takes up more than one line.
Here's what I've got so far to get the note in the widget:
my ( $widget, $event ) = @_;
# Check if we've received a double-click event; exit if we haven't
if ($event->type ne '2button-press') {
return;
}
my $slist = $prospects->get_widget("Notes_SList");
my @selected = $slist->get_selected_indices;
my $note_txt = $slist->{data}[$selected[0]][3];
my $textbuffer = Gtk2::TextBuffer->new;
$textbuffer->set_text($note_txt);
my $notedetails = Gtk2::GladeXML->new($gladefile, 'NoteDetails');
$notedetails->get_widget("NoteTxt")->set_buffer($textbuffer);
I'm getting the correct text in $note_txt, but something goes wrong ( or
doesn't happen ) after this, because my Gtk2::TextView is empty.
What am I doing wrong?
Dan
--
Daniel Kasak
IT Developer
NUS Consulting Group
Level 5, 77 Pacific Highway
North Sydney, NSW, Australia 2060
T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
email: dkasak nusconsulting com au
website: http://www.nusconsulting.com.au
Title: CanIt Vote for ID 70162
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]