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

NAME

UI::Various::Button - general button widget of UI::Various

SYNOPSIS

    use UI::Various;
    my $main = UI::Various::main();
    $main->window(UI::Various::Button->new(text => 'Quit',
                                           code => sub{ exit(); }));
    $main->mainloop();

ABSTRACT

This module defines the general button widget of an application using UI::Various.

DESCRIPTION

Besides the common attributes inherited from UI::Various::widget the Button widget knows the following additional attributes:

Attributes

code [rw, recommended]

the command invoked by the button

Note that the command gets a reference to the top-level widget (Window or Dialog) as first and a reference to itself as second parameter. This is especially useful to end a dialogue, as those might not return a usable reference on creation, e.g. in Curses.

text [rw, recommended]

the text of the button as string or variable reference

METHODS

Besides the accessors (attributes) described above and by UI::Various::widget and the methods inherited from UI::Various::widget only the constructor is provided by the Button class itself:

new - constructor

see UI::Various::core::construct

SEE ALSO

UI::Various

LICENSE

Copyright (C) Thomas Dorner.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See LICENSE file for more details.

AUTHOR

Thomas Dorner <dorner (at) cpan (dot) org>