FLTK::ask - Implementation of message, ask, choice, and input functions
Implementation of FLTK::message(), FLTK::ask(...), FLTK::choice(...), FLTK::input().
FLTK::message()
FLTK::ask(...)
FLTK::choice(...)
FLTK::input()
BEEP_DEFAULT
BEEP_DEFAULT( );
Import this function with the :dialog tag.
:dialog
BEEP_ERROR
BEEP_ERROR( );
BEEP_MESSAGE
BEEP_MESSAGE( );
BEEP_NOTIFICATION
BEEP_NOTIFICATION( );
BEEP_PASSWORD
BEEP_PASSWORD( );
BEEP_QUESTION
BEEP_QUESTION( );
alert
FLTK::alert( $string );
Same as FLTK::message() except for the "!" symbol.
Import this function with the :dialog or :default tags.
:default
ask
my $choice = FLTK::ask( $question );
Displays a message in a pop-up box with a "Yes" and "No" button and waits for the user to hit a button. The return value is 1 if the user hits "Yes", 0 if they pick "No". The Enter key is a shortcut for "Yes" and ESC is a shortcut for "No".
1
0
Enter
ESC
If message_window_timeout is used, then -1 will be returned if the timeout expires.
message_window_timeout
-1
beep
FLTK::beep( $type );
Generates a simple beep message.
beep_on_dialog
FLTK::beep_on_dialog( $value );
You can enable beep on default message dialog (like ask, choice, input, ...) by using this function with true (default is false).
choice
input
my $value = FLTK::beep_on_dialog( );
You get the state enable beep on default message dialog (like ask, choice, input, ...) by using this function with true (default is false).
my $choice = FLTK::choice( $question, $answer_1, $answer_2, $answer_3 );
Shows the message with three buttons below it marked with the strings answer_1, answer_2, and answer_3. Returns 0, 1, or 2 depending on which button is hit. If one of the strings begins with the special character '*' then the associated button will be the default which is selected when the Enter key is pressed. ESC is a shortcut for answer_1.
answer_1
answer_2
answer_3
2
choice_alert
my $choice = FLTK::choice_alert( $question, $question, $answer_1, $answer_2, $answer_3 );
Same as choice() except a "!" icon is used instead of a "?"
choice()
icon_style
my $style = FLTK::icon_style( );
This Style is used for the 50x50 icon area on the left of all the popup windows. You can change the colors or font used here.
50x50
FLTK::icon_style( $style );
Set the icon style.
my $string = FLTK::input( $label, $default_value );
Pops up a window displaying a string, lets the user edit it, and return the new value. The cancel button returns undef. The returned pointer is only valid until the next time FLTK::input() is called.
undef
If message_window_timeout is used, then 0 will be returned if the timeout expires.
message
FLTK::message( $string );
Displays a message in a pop-up box with an "OK" button, waits for the user to hit the button. The message will wrap to fit the window, or may be many lines by putting \n characters into it. The enter key is a shortcut for the OK button.
\n
message_style
my $style = FLTK::message_style( );
This Style is used for the label area for all the popup windows. You can change the textfont() or textsize() to make them print differently.
textfont()
textsize()
FLTK::message_style( $style );
Set the message style.
password
my $string = FLTK::password( $label, $default_value );
Same as FLTK::input() except an FLTK::SecretInput field is used.
There are a few variables you my change that affect how FLTK behaves.
$FLTK::message_window_label
The value of this is used as the title of message(), alert(), ask(), choice(), etc. windows.
message()
alert()
ask()
$FLTK::no
You can change this string to convert FLTK to a foreign language.
$FLTK::yes
$FLTK::ok
$FLTK::cancel
$FLTK::message_window_timeout
Set this to a positive value to cause the message(), alert(), ask(), choice(), etc. windows to close automatically after this timeout. If the timeout expires, -1 will be returned by the functions that return integers. The timeout value is a float in seconds.
$FLTK::message_window_scrollable
When this is set to true, then (all) message windows will use scrollbars if the given message is too long.
Sanko Robinson <sanko@cpan.org> - http://sankorobinson.com/
Copyright (C) 2008-2010 by Sanko Robinson <sanko@cpan.org>
This program is free software; you can redistribute it and/or modify it under the terms of The Artistic License 2.0. See the LICENSE file included with this distribution or notes on the Artistic License 2.0 for clarification.
When separated from the distribution, all original POD documentation is covered by the Creative Commons Attribution-Share Alike 3.0 License. See the clarification of the CCA-SA3.0.
To install FLTK, copy and paste the appropriate command in to your terminal.
cpanm
cpanm FLTK
CPAN shell
perl -MCPAN -e shell install FLTK
For more information on module installation, please visit the detailed CPAN module installation guide.