ask.h File Reference


Enumerations

enum  {
  BEEP_DEFAULT, BEEP_MESSAGE, BEEP_ERROR, BEEP_QUESTION,
  BEEP_PASSWORD, BEEP_NOTIFICATION
}

Functions

void message (const char *,...)
void alert (const char *,...)
int ask (const char *,...)
int choice (const char *q, const char *b0, const char *b1, const char *b2,...)
int choice_alert (const char *q, const char *b0, const char *b1, const char *b2,...)
const char * input (const char *label, const char *deflt=0,...)
const char * password (const char *label, const char *deflt=0,...)
void beep (int type=BEEP_DEFAULT)
void beep_on_dialog (bool)
bool beep_on_dialog ()

Variables

NamedStyleicon_style
NamedStylemessage_style
const char * no
const char * yes
const char * ok
const char * cancel

Detailed Description


Function Documentation

void alert const char *  fmt,
  ...
 

fl_alert.gif
Same as message() except for the "!" symbol.

int ask const char *  fmt,
  ...
 

fl_ask.gif
Displays a printf-style message in a pop-up box with an "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.

void beep int  type  ) 
 

Generates a simple beep message

bool 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)

void beep_on_dialog bool  b  ) 
 

You can enable beep on default message dialog (like ask, choice, input, ...) by using this function with true (default is false)

int choice const char *  fmt,
const char *  b0,
const char *  b1,
const char *  b2,
  ...
 

fl_choice.gif
Shows the message with three buttons below it marked with the strings b0, b1, and b2. 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 b2.

int choice_alert const char *  fmt,
const char *  b0,
const char *  b1,
const char *  b2,
  ...
 

Same as choice() except a "!" icon is used instead of a "?"

const char* input const char *  fmt,
const char *  defstr,
  ...
 

fl_input.gif
Pops up a window displaying a string, lets the user edit it, and return the new value. The cancel button returns NULL. The returned pointer is only valid until the next time input() is called. Due to back-compatability, the arguments to any printf commands in the label are after the default value.

void message const char *  fmt,
  ...
 

fl_message.gif
Displays a printf-style 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.

const char* password const char *  fmt,
const char *  defstr,
  ...
 

fl_password.gif
Same as input() except an SecretInput field is used.


Variable Documentation

const char* cancel
 

You can change this string to convert fltk to a foreign language.

NamedStyle* 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.

NamedStyle* 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.

const char* no
 

You can change this string to convert fltk to a foreign language.

const char* ok
 

You can change this string to convert fltk to a foreign language.

const char* yes
 

You can change this string to convert fltk to a foreign language.


Sun Jan 7 00:55:16 2007. FLTK ©2006 Bill Spitzak and others.
Permission is granted to reproduce this manual or any portion for any purpose, provided this copyright and permission notice are preserved.