Documentation 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.
Overview
TheFl_Browser widget displays a scrolling list of text lines and manages all the storage for the text. It’s useful for showing a vertical list of named objects to the user.
Line numbers start from 1 (zero is reserved for “no line”). Methods do not check if passed line numbers are in range - they must always be greater than zero and ≤ size().
Constructor
Item Management
Removes the specified line from the browser.
Line number to remove (1-based)
Removes all lines from the browser.
Loads the browser with the lines from a file.Returns non-zero on error.
Path to the file to load
Selection
Returns whether a line is selected.Returns 1 if selected, 0 otherwise.
Line number to check (1-based)
Returns the line number of the currently selected line, or 0 if none selected.
Display Control
Scrolls the browser so the specified line is at the top.
Line number to display at top (1-based)
Scrolls the browser so the specified line is in the middle.
Line number to display in middle (1-based)
Scrolls the browser so the specified line is at the bottom.
Line number to display at bottom (1-based)
Checks if a line is currently visible in the display window.Returns 1 if visible, 0 otherwise.
Line number to check (1-based)
Scrolls the browser to make the specified line visible.
Line number to make visible (1-based)
Text Access
Gets or sets the text for a line.Returns pointer to the line’s text.
Line number (1-based)
Gets or sets the user data pointer for a line.Returns the data pointer associated with the line.
Line number (1-based)
Formatting
Gets or sets the format code prefix character (default ’@’).
Gets or sets the column separator character (default ‘\t’).
Gets or sets the array of column widths in pixels. The array must be zero-terminated.
Format Codes
When format_char() is ’@’, you can use these codes at the start of each line:@.- Print rest of line, don’t look for more ’@’ signs@@- Print ’@’ character@l- Use large (24 point) font@m- Use medium large (18 point) font@s- Use small (11 point) font@b- Use bold font@i- Use italic font@for@t- Use fixed-pitch font@c- Center the line@r- Right-justify the text@B###- Fill background with color ###@C###- Use color ### for text@uor@_- Underline the text
Example
Common Patterns
Iterating Through All Items
Using Columns
See Also
- Fl_Select_Browser - Browser with single selection
- Fl_Hold_Browser - Browser that highlights on mouse down
- Fl_Multi_Browser - Browser with multiple selection