Fw: Gtk::Text



 try something like this
Im not sure but I dont think you can do a get_text with a text widget only
 an entry widget.

 $length = $text->get_length;
 $text_>set_point(0) # this is probably optional;
$ezlan = $text->get_chars(0,length);
 print $ezlan;

 if you wanted to clear it out you would do somehting like this
 $length = $text->get_length;
 $text_>set_point(0);
 $text->forward_delete($length);

 Ive been doing a lot of ruby programming lately so if this doesnt work, its
 becasue im a forgetful moron




----- Original Message -----
From: "Peter K. Polinak" <polly ludens elte hu>
To: <gtk-perl-list gnome org>
Sent: Sunday, March 02, 2003 9:51 AM
Subject: Gtk::Text


Hi again!

Another question:

If i insert a Gtk::Text widget, like

$text=new Gtk::Text();
$text->set_editable(1);
$text->show();

how can I extract the text I entered the textbox to a scalar variable?
I'd like to print out the text I entered to the screen for example, or
perform other operations with the text, save it to a file, etc... I
tried

$text->get_text($ezvan);
print $ezvan;

but it didn't work, got an error message:

Can't locate object method "get_text" via package "Gtk::Text" at elso.pl
line 49

Thanks for your answer!

Regards,

Peter




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






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