The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Fl::LightButton - Push Button with a Light

Synopsis

    use Fl qw[:button];
    my $button = Fl::LightButton->new(0, 0, 100, 200, 'Hello, World!');
    $button->callback(sub {print q[It's dat boi]} );

Description

The Fl::LightButton class represents a button that displays the "ON" state by turning on a light rather than drawing pushed in.

The shape of the 'light' is initially set to FL_DOWN_BOX. The color of the light when on is controlled by selection_color(), which defaults to FL_YELLOW.

Buttons generate callbacks when they are clicked by the user. You control exactly when and how by changing the values for type() and when().

Methods

Fl::LightButton inherits Fl::Button and Fl::Widget. On top of that, it exposes the following methods...

new(...)

    my $button_a = Fl::LightButton->new(0, 0, 250, 500, 'Important Stuff');
    my $button_b = Fl::LightButton->new(0, 0, 250, 500);

The constructor creates a new light button using the given position, size, and label.

The default box type is FL_NO_BOX, which draws the label without a box to the right of the light.

The selection_color() sets the color of the light. The default is FL_YELLOW.

You can use down_box() to chane the box type of the checkmark. Default is FL_DOWN_BOX.

The destructor removes the button.

LICENSE

Copyright (C) Sanko Robinson.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

AUTHOR

Sanko Robinson <sanko@cpan.org>