TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/fltk/fltk/llms.txt
Use this file to discover all available pages before exploring further.
Fl namespace is the FLTK global namespace containing state information and global methods for the current application. It provides the event loop, display management, timing functions, and other system-level functionality.
Event Loop Methods
These methods control the main event loop and application execution.run()
Runs the main event loop.wait()
Waits for an event and processes it.Maximum time to wait in seconds (optional)
- For
wait(): non-zero if any windows are displayed - For
wait(double): the time remaining (negative if time expired)
run().
check()
Checks for events without waiting.wait() but returns immediately
Description: Processes all pending events and returns immediately. This is useful for updating the display while performing a long operation.
Example:
ready()
Checks if there are pending events.Timeout and Idle Callbacks
Methods for scheduling deferred and repeated callbacks.add_timeout()
Adds a one-shot timer callback.Time in seconds before callback is called
Function to call when timeout expires
User data passed to callback (optional)
repeat_timeout()
Reschedules a timeout for repeated callbacks.Time in seconds before callback is called again
Function to call when timeout expires
User data passed to callback
remove_timeout()
Removes a timeout callback.Callback function to remove
User data associated with the callback
add_idle()
Adds an idle callback.Function to call when idle
User data passed to callback
remove_idle()
Removes an idle callback.Screen and Display Methods
screen_count()
Returns the number of screens.screen_xywh()
Gets screen dimensions.Output parameters for screen position and size
Screen number (optional)
Mouse position to determine which screen (optional)
screen_scale()
Gets or sets screen scaling factor.Screen number
Scaling factor to set (for setter)
redraw()
Schedules all windows for redrawing.wait() or flush().
flush()
Forces all pending drawing to be completed.Color Methods
set_color()
Sets an entry in the color map.Color index to set
RGB color components (0-255)
RGB color as 32-bit value
get_color()
Gets a color from the color map.Color index to get
Output parameters for RGB components
Scheme Methods
scheme()
Gets or sets the current widget scheme.Scheme name: “none”, “base”, “gtk+”, “gleam”, “plastic”, or “oxy”
- Getter: Current scheme name or NULL for default
- Setter: 1 if successful, 0 if scheme not found
is_scheme()
Checks if a specific scheme is active.Lowercase scheme name to check
Font Methods
set_fonts()
Enumerates available system fonts.X11 font pattern (platform-specific)
get_font()
Gets the name of a font.Font index
set_font()
Changes a font in the table.Font index to change
New font name
Copy font from this index
Window Management
first_window()
Gets the first top-level window.next_window()
Gets the next window in the window list.Current window
modal()
Gets the current modal window.grab()
Gets or sets the window grabbing all events.Window to grab events, or NULL to release
Clipboard Methods
copy()
Copies data to clipboard or selection.Text data to copy
Length of data in bytes
0 = selection buffer, 1 = clipboard, 2 = both
Data type (usually clipboard_plain_text)
paste()
Pastes data from clipboard or selection.Widget that will receive FL_PASTE event
0 = selection buffer, 1 = clipboard
Requested data type
Version Information
api_version()
Returns the API version number.abi_version()
Returns the ABI version number.abi_check()
Checks if ABI version is compatible.ABI version to check against
Related
- Fl_Widget - Base widget class
- Fl_Window - Window class
- Enumerations - Event types and constants