gtk-perl tutorial and help



Hi everyone

I am looking for a comprehensive gtk-perl tutorial as I am relatively
new at gtk and perl. Documentation for gtk-perl seems almost distinct,
unless anyone can enlighten me on this!!

For example...

I have created a window that has horizontal and vertical boxes and added
buttons and labels to it. That all seems rather straight forward. What I
now want to do is add a button with a pixmap so when I click on the
button, the pixmap changes!!

I can't seem to find any information on it!!
Can anyone help me with this snippet of code ...

$button_box  = new Gtk::HBox( $false, 0 );
$style = $window->get_style()->bg( 'normal' );

($pixmap, $mask ) = Gtk::Gdk::Pixmap->create_from_xpm_d(
$window->window,$style,@xpm_data );

$pixmapwid = new Gtk::Pixmap( $pixmap, $mask );
$button_box->pack_start( $pixmapwid, $false, $false, 0 );
$pixmapwid->show();

$button = new Gtk::Button();
$button->signal_connect( "clicked", sub {print( "The button was
pressed\n" ); } );
$button->add( $button_box );
$button->show();
$window->add( $button );

When I run this, I get the following error message...

'window is not of type Gtk::Gdk::Window '

The error message was generated from the code..
....create_from_xpm_d( $window->window,$style,@xpm_data );

Any suggestions would be warmly welcomed

Regards

Andy





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