NAME
FLTK::ask - Implementation of message, ask, choice, and input functions
Description
Implementation of FLTK::message(), FLTK::ask(...), FLTK::choice(...), FLTK::input().
Functions
BEEP_DEFAULT
BEEP_ERROR
BEEP_MESSAGE
BEEP_NOTIFICATION
BEEP_PASSWORD
BEEP_QUESTION
alert
FLTK::alert( $string );-
Same as
FLTK::message()except for the "!" symbol.Import this function with the
:dialogor:defaulttags.
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
1if the user hits "Yes",0if they pick "No". TheEnterkey is a shortcut for "Yes" andESCis a shortcut for "No".If
message_window_timeoutis used, then-1will be returned if the timeout expires.Import this function with the
:dialogtag.
beep
FLTK::beep( $type );-
Generates a simple beep message.
Import this function with the
:dialogor:defaulttags.
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).Import this function with the
:dialogtag. 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).Import this function with the
:dialogtag.
choice
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, andanswer_3. Returns0,1, or2depending 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 theEnterkey is pressed.ESCis a shortcut foranswer_1.If
message_window_timeoutis used, then-1will be returned if the timeout expires.Import this function with the
:dialogor:defaulttags.
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 "?"Import this function with the
:dialogor:defaulttags.
icon_style
my $style = FLTK::icon_style( );-
This Style is used for the
50x50icon area on the left of all the popup windows. You can change the colors or font used here.Import this function with the
:dialogtag. FLTK::icon_style( $style );-
Set the icon style.
Import this function with the
:dialogtag.
input
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 timeFLTK::input()is called.If
message_window_timeoutis used, then0will be returned if the timeout expires.Import this function with the
:dialogor:defaulttags.
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
\ncharacters into it. The enter key is a shortcut for the OK button.Import this function with the
:dialogor:defaulttags.
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()ortextsize()to make them print differently.Import this function with the
:dialogtag. FLTK::message_style( $style );-
Set the message style.
Import this function with the
:dialogtag.
password
my $string = FLTK::password( $label, $default_value );-
Same as
FLTK::input()except an FLTK::SecretInput field is used.Import this function with the
:dialogor:defaulttags.
Variables
There are a few variables you my change that affect how FLTK behaves.
$FLTK::message_window_labelThe value of this is used as the title of
message(),alert(),ask(),choice(), etc. windows.$FLTK::noYou can change this string to convert FLTK to a foreign language.
$FLTK::yesYou can change this string to convert FLTK to a foreign language.
$FLTK::okYou can change this string to convert FLTK to a foreign language.
$FLTK::cancelYou can change this string to convert FLTK to a foreign language.
$FLTK::message_window_timeoutSet this to a positive value to cause the
message(),alert(),ask(),choice(), etc. windows to close automatically after this timeout. If the timeout expires,-1will be returned by the functions that return integers. The timeout value is a float in seconds.$FLTK::message_window_scrollableWhen this is set to true, then (all) message windows will use scrollbars if the given message is too long.
Author
Sanko Robinson <sanko@cpan.org> - http://sankorobinson.com/
License and Legal
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.