| pgk_xs documentation | view source | Contained in the pgk_xs distribution. |
pgk -- Perl Gimp Kit, a OO perl gtk interface that works for Windows too
To be done
pre: $name is the name of this widget.
$type is the type of this widget.
post: base class pgk::Widget created, that implements base
functions for all derived pgk classes.
pre: $widget is a derivative of pgk::Widget. post: $widget has been added to the widgetlist of $self.
pre: Got $handle from pgk_xs C-function and is a pointer
to a GTK widget.
post: $widget is associated with $handle.
pre: setHandle(..)
post: =the GTK widget pointer associated with this pgk widget.
Can be used in calls to pgk_xs.
pre: $eventType <- valid GTK event for the specific GTK Widget
associated with getHandle()
post: In case of an event of type $eventType for this GTK Widget,
$eventFunc will be called with arguments '...'.
smpl:
my $dlg=new pgk::Dialog('my_dialog','This is a title', 3, 3);
my $lab=new pgk::Label('my_label', 'This is my label');
$lab->setEvent('main::LabelEvent', 'clicked', $dlg);
In case of a 'clicked' event for the $lab label, main::LabelEvent
will be called with argument $dlg. E.g., fields in $dlg can be updated.
pre:
post: Timer is set for $millisecs for this widget. After $millisecs,
&$timerFunc is called with arguments '...'.
Note: timerFunc returns 1 for continues calling.
timerFunc returns 0 for one shot calling.
smpl:
my $dlg=new pgk::Dialog('my_dialog', 'My title', 2, 2);
$dlg->setTimer(1000, 'main::updateTime', $dlg);
package main;
sub updateTime {
my $window=shift;
my $time=ctime();
$window->setValue($time);
return 1;
}
pre:
post: Timer is added to the current widget. After $millisecs,
&$timerFunc is called with arguments $this, '...'.
Note: timerFunc returns 1 for continues calling.
timerFunc returns 0 for one shot calling.
smpl: my $dlg=new pgk::Dialog('my_dialog', 'My title', 2, 2);
$dlg->addTimer(1000, 'main::updateTime', "My extra argument");
package main;
sub updateTime {
my $self=shift;
my $txt=shift;
my $time=ctime();
$self->setValue($time." $txt");
return 1;
}
post: Property $prop of $widget has been set to $value.
smpl: $widget->setProp('myprop',"My Value");
post: = value of property $prop of $widget.
smpl: my $t=$widget->getProp('myprop');
post: sets property 'widget'.$widget->name() to $widget.
post: =widget of $name, if setWidget has been called before.
=undef, otherwise
post: pgk::Widget base class implements this method by calling
setProp('value',$value).
post: pgk::Widget base class implements this method by calling
getProp('value').
post: shows all PGK widgets associated with the current
widget, including this one.
post: Quits the application, destroying all pgk windows opened.
post: =name of widget.
H.N.M. Oesterholt-Dijkema <hans@oesterholt-dijkema.emailt.nl>
perl
| pgk_xs documentation | view source | Contained in the pgk_xs distribution. |