Tkx::ImageButton - Graphic button megawidget for Tkx
This documentation refers to Tkx::ImageButton version 0.14
use Tkx; use Tkx::ImageButton; my $mw = Tkx::widget->new('.'); my $im_button_1 = $mw->new_tkx_ImageButton( -imagedisplay => Tkx::image_create_photo(-file => 'button1.png'), -imageover => Tkx::image_create_photo(-file => 'button2.png'), -imageclicked => Tkx::image_create_photo(-file => 'button3.png'), -imagedisabled => Tkx::image_create_photo(-file => 'button4.png'); -command => sub { ... }, ); my $im_button_2 = $mw->new_tkx_ImageButton( -imagedisplay => Tkx::image_create_photo(-file => 'button1.png'), -imageover => Tkx::image_create_photo(-file => 'button2.png'), -command => sub { ... }, ); ...
Tkx::ImageButton is a megawidget that implementing graphical button with some options.
The options bellow are passed through the constructor of megawidget.
-imagedisplay => image
Defines an image for the button. Image should be tk photo object.
-imageover => image
Image that be showed when button is mouse overed.
-imageclicked => image
Image for the clicked state.
-imagedisabled => image
Image for the disabled state.
-command => CODEREF
Command that be called when use has pressed the button
-blinkdelay => delay
Blink delay.
-blink => blink state
If the value is greater than 0, button will blinking every -blinkdelay.
Tkx::ImageButton methods.
new
Constructor.
configure
Configure widget properties after constructing.
invoke
Invokes the command associated with the button.
None known at this time.
You can find documentation for this module with the perldoc command.
perldoc Tkx::ImageButton
Written by Alexander Nusov. Inspired by Dave Hickling (Tk-ImageButton).
Copyright (C) 2010, Alexander Nusov <alexander.nusov+cpan <at> gmail.com>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Tkx::ImageButton, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Tkx::ImageButton
CPAN shell
perl -MCPAN -e shell install Tkx::ImageButton
For more information on module installation, please visit the detailed CPAN module installation guide.