Use this file to discover all available pages before exploring further.
FLTK provides comprehensive text input widgets for capturing user text input, with built-in support for editing, selection, undo/redo, and clipboard operations.
const char* value() const; // Get current textint value(const char *text); // Set textint value(const char *text, int len); // Set with lengthFl_Input *input = new Fl_Input(50, 50, 200, 30, "Name:");input->value("John Doe");printf("Entered: %s\n", input->value());
insert() / replace() - Edit Text
Programmatically modify text content.
input->insert("text"); // Insert at cursorinput->replace(0, 5, "new"); // Replace rangeinput->cut(); // Cut selectioninput->copy(); // Copy to clipboardinput->paste(); // Paste from clipboard
position() - Cursor Position
Get or set the text cursor position.
int position() const; // Get cursor positionint position(int p); // Set cursor positionint position(int p, int m); // Set position and markinput->position(0); // Move to startinput->position(input->size()); // Move to end
size() - Text Length
Get the length of the text.
int size() const; // Returns number of bytes (not characters for UTF-8)if (input->size() > 0) { printf("Has text\n");}
maximum_size() - Limit Input Length
Set maximum number of characters allowed.
void maximum_size(int m);int maximum_size() const;input->maximum_size(50); // Limit to 50 characters
Fl_Input - Single-line textWhite rectangular field with thin border. Displays text cursor when focused.Use for: Names, titles, search boxes, single-line data
Integer Input
Fl_Int_Input - Numbers onlyIdentical appearance to Fl_Input but rejects non-digit input.Use for: Quantities, ages, counts, IDs
Float Input
Fl_Float_Input - Decimal numbersAccepts numbers with decimal points and scientific notation.Use for: Prices, measurements, percentages
Secret Input
Fl_Secret_Input - Hidden charactersDisplays asterisks or dots instead of typed characters.Use for: Passwords, PINs, sensitive data