| 1 | package Gtk2::Ex::FormFactory::Button; | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | |||
| 5 | use base qw( Gtk2::Ex::FormFactory::Widget ); | ||
| 6 | |||
| 7 | sub get_type { "button" } | ||
| 8 | sub has_label { 1 } | ||
| 9 | |||
| 10 | sub get_clicked_hook { shift->{clicked_hook} } | ||
| 11 | sub get_stock { shift->{stock} } | ||
| 12 | sub get_with_repeat { shift->{with_repeat} } | ||
| 13 | sub get_image { shift->{image} } | ||
| 14 | |||
| 15 | sub set_clicked_hook { shift->{clicked_hook} = $_[1] } | ||
| 16 | sub set_stock { shift->{stock} = $_[1] } | ||
| 17 | sub set_with_repeat { shift->{with_repeat} = $_[1] } | ||
| 18 | sub set_image { shift->{image} = $_[1] } | ||
| 19 | |||
| 20 | sub new { | ||
| 21 | my $class = shift; | ||
| 22 | my %par = @_; | ||
| 23 | my ($stock, $clicked_hook, $with_repeat, $image) = | ||
| 24 | @par{'stock','clicked_hook','with_repeat','image'}; | ||
| 25 | |||
| 26 | my $self = $class->SUPER::new(@_); | ||
| 27 | |||
| 28 | $self->set_stock($stock); | ||
| 29 | $self->set_image($image); | ||
| 30 | $self->set_clicked_hook($clicked_hook); | ||
| 31 | $self->set_with_repeat($with_repeat); | ||
| 32 | |||
| 33 | return $self; | ||
| 34 | } | ||
| 35 | |||
| 36 | 1; | ||
| 37 | |||
| 38 | __END__ |