Tk-QuickForm

 view release on metacpan or  search on metacpan

lib/Tk/QuickForm/CRadioItem.pm  view on Meta::CPAN

package Tk::QuickForm::CRadioItem;

=head1 NAME

Tk::QuickForm::CRadioItem - Array of Radiobuttons for Tk::QuickForm.

=cut

use strict;
use warnings;
use vars qw($VERSION);
$VERSION = '0.07';

use Tk;
use base qw(Tk::Derived Tk::QuickForm::CBaseClass);
Construct Tk::Widget 'CRadioItem';

=head1 SYNOPSIS

 require Tk::QuickForm::CRadioItem;
 my $bool = $window->CRadioItem(@options)->pack;

=head1 DESCRIPTION

Inherits L<Tk::QuickForm::CBaseClass>.  Providess a row of Radiobuttons for L<Tk::QuickForm>.

You should never create an instance directly like above. This should
be handled by L<Tk::QuickForm>.

=head1 OPTIONS

All options, except I<-variable>, of L<Tk::Radiobutton> are available.

=over 4

=item Switch B<-disables>

Specify a hash with keys of possible button values pointing to a list of fields and notebook pages that should be disabled when the value is selected.

=item Switch B<-enables>

Specify a hash with keys of possible button values pointing to a list of fields and notebook pages that should be enabled when the value is selected.

=item Switch: B<-values>

The list of possible values.

=back

=cut

sub Populate {
	my ($self,$args) = @_;

	my $values = delete $args->{'-values'};
	warn "You need to set the -values option" unless defined $values;
	$self->{VALUES} = $values;

	$self->SUPER::Populate($args);

	
	$self->ConfigSpecs(
		-enables => ['PASSIVE', undef, undef, {}],
		-disables => ['PASSIVE', undef, undef, {}],
		DEFAULT => ['SELF'],
	);
}

sub createHandler {
	my ($self, $var) = @_;
	my $values = $self->{VALUES};
	for (@$values) {
		my $val = $_;
		$self->Radiobutton(
			-command => ['OnClick', $self, $val],



( run in 0.642 second using v1.01-cache-2.11-cpan-d7a12ab2c7f )