RE: Problems with Gtk::Text and set_pointer and Text widget quest ions


I was able to get this to work with version 0.7006.  I also suggest changing
your button_press_event routine to use $widget->get_length rather than
$text->get_length.  It makes the routine usable if you have more than one
Text widget.

I hope that helps!


David P. Fannin
Database Administrator                                  dpf umr edu
UM-Rolla Computing and Information Services      FAX (573) 341-4216
URL                   PHONE (573) 341-4841

-----Original Message-----
From: Michel Blanc [mailto:mblanc erasme org]
Sent: Monday, August 13, 2001 12:05 PM
To: gtk-perl-list gnome org
Subject: Problems with Gtk::Text and set_pointer and Text widget

Dear All,

I have a problem with the Text widget. When I try to use set_point(), I
always get : 

"Use of uninitialized value in subroutine entry at line 143"

I use the demo Text widget example, and just add the following :

$text->signal_connect ("button_press_event" => \&button_press); 


sub button_press {
        my ($widget, $event) = @_;
        my $len = $text->get_length()-1;
#       $text->set_point($len);
#       $text->set_point($text->get_point());
#       $text->set_point(3);

All the three commented out lines produce the same error. I have Gtk
0.7005  here.

Any clue anyone ??

Also, is there anyway to navigate the widget using, for instance
something similar to Tk indices (linestart, end, @x,y  etc...) ? 


Michel Blanc
Centre Multimédia Erasme/Parc d'activités innovantes
69930 Saint Clément-les-places
Tel : +33-(0)4-74-70-68-40 / Fax : +33-(0)4-74-70-68-40

gtk-perl-list mailing list
gtk-perl-list gnome org

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