UI::Various::Button - general button widget of UI::Various
use UI::Various; my $main = UI::Various::main(); $main->window(UI::Various::Button->new(text => 'Quit', code => sub{ exit(); })); $main->mainloop();
This module defines the general button widget of an application using UI::Various.
Besides the common attributes inherited from UI::Various::widget the Button widget knows the following additional attributes:
UI::Various::widget
Button
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.
Window
Dialog
Curses
the text of the button as string or variable reference
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:
see UI::Various::core::construct
UI::Various
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.
Thomas Dorner <dorner (at) cpan (dot) org>
To install UI::Various, copy and paste the appropriate command in to your terminal.
cpanm
cpanm UI::Various
CPAN shell
perl -MCPAN -e shell install UI::Various
For more information on module installation, please visit the detailed CPAN module installation guide.