AntTweakBar

 view release on metacpan or  search on metacpan

lib/AntTweakBar.pm  view on Meta::CPAN

=cut

sub new {
    my ($class, $name, %bar_params) = @_;
    croak "AntTweakBar name should be specified"
        unless defined $name;
    my $self = {
        _name    => $name,
        _bar_ptr => _create( $name ),
    };
    bless $self => $class;
    $self->set_bar_params(%bar_params);
    return $self;
}

sub DESTROY {
    my $self = shift;
    _destroy($self->{_bar_ptr});
}


lib/AntTweakBar/Type.pm  view on Meta::CPAN

    my $hash = ref($value) eq 'ARRAY'
        ? { map { ($_ => $value->[$_]) } (0 .. @$value-1) }
        : ref($value) eq 'HASH'
        ? { map { $value->{$_} => $_ } keys %$value }
        : die("New type value should be either hash or array reference");
    my $type_id = AntTweakBar::_register_enum($name, $hash);
    my $self = {
        _name    => $name,
        _type_id => $type_id,
    };
    return bless $self => $class;
}

sub name {
    shift->{_name};
}

1;

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 1.022 second using v1.00-cache-1.14-grep-28634ff-cpan-4d46879620f )