saving from a menu bar
- From: AvA <a v a home nl>
- To: gtk-perl-list gnome org
- Subject: saving from a menu bar
- Date: Sun, 15 Apr 2001 15:07:42 +0500
Hi all,
Im new to perl-gtk and i have been editing the text widget example from
the gtk-perl tutorial on the web.
I could make a "save" button that saves the whole textfile to disk, but
that aint fun.
So i created a menu with the help of that tutorial.
Here is a snip:
........
{ path => '/File/_Save',
accelerator => '<control>S',
callback => \&save, $window,$text },
.....
and here is the subroutine:
sub save {
my ($widget, $window, $text) = @_;
my $entry_text = $text->get_chars();
open (FILE, ">$textfile");
print FILE "$entry_text\n";
close FILE;
}
This complains cos im not pasing the right stuff to the subroutine
("Can't call method "get_chars" on an undefined value at ...")
How do i pass the right stuff in the callback?
Thanks.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]