NAME

pgk -- Perl Gimp Kit, a OO perl gtk interface that works for Windows too

SYNOPSIS

To be done

DESCRIPTION

pgk::Widget

new ($name,$type)

 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.
          

add($widget)

 pre:  $widget is a derivative of pgk::Widget.
 post: $widget has been added to the widgetlist of $self.
 

setHandle($handle)

 pre:  Got $handle from pgk_xs C-function and is a pointer
       to a GTK widget.
 post: $widget is associated with $handle.
 

$handle=getHandle()

 pre:  setHandle(..)
 post: =the GTK widget pointer associated with this pgk widget.
        Can be used in calls to pgk_xs.
        

setEvent($eventFunc,$eventType, ...)

 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.

setTimer($millisecs,$timerFunc, ...)

 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;
       }

addTimer($millisecs, $timerFunc, ...)

 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;    
       }

setProp($prop,$value|@value)

 post: Property $prop of $widget has been set to $value.
 smpl: $widget->setProp('myprop',"My Value");
 

getProp($prop)

 post: = value of property $prop of $widget.
 smpl: my $t=$widget->getProp('myprop');
 

setWidget($widget)

 post: sets property 'widget'.$widget->name() to $widget.
 

getWidget($name)

 post: =widget of $name, if setWidget has been called before.
       =undef,           otherwise

setValue($value)

 post: pgk::Widget base class implements this method by calling
       setProp('value',$value).
       

getValue()

 post: pgk::Widget base class implements this method by calling
       getProp('value').

show()

 post: shows all PGK widgets associated with the current
       widget, including this one.
      

Quit()

 post: Quits the application, destroying all pgk windows opened.
 

name()

 post: =name of widget.
 
 

AUTHOR

H.N.M. Oesterholt-Dijkema <hans@oesterholt-dijkema.emailt.nl>

LICENSE

perl