Module fltk::app [−][src]
Expand description
Application related methods and functions
Structs
Basic Application struct, used to instatiate, set the scheme and run the event loop
Creates a receiver struct
Creates a sender struct
Enums
Types of Clipboard contents
The event clipboard type
Defines Mouse buttons
Event direction with Mousewheel event
Set the app scheme
Functions
Gets FLTK ABI version
Register a callback whenever there is a change to the selection buffer or the clipboard. The clipboard is source 1 and the selection buffer is source 0
Register a callback whenever there is a change to the selection buffer or the clipboard. The clipboard is source 1 and the selection buffer is source 0. A callback via closure cannot be removed!
Adds a custom handler for unhandled events
Add an idle callback to run within the event loop.
Calls to WidgetExt::redraw
within the callback require an explicit sleep
Add an idle callback to run within the event loop.
Calls to WidgetExt::redraw
within the callback require an explicit sleep
Add a system handler
Adds a one-shot timeout callback. The timeout duration tm
is indicated in seconds
Example:
Adds a one-shot timeout callback. The timeout duration tm
is indicated in seconds
Example:
Gets FLTK API version
Trigger event loop handling in the main thread
Registers a function that will be called by the main thread during the next message handling cycle
Set the background color
Set the background color for input and text widgets
Gets the widget that is below the mouse cursor.
This returns an Option
Creates a channel returning a Sender and Receiver structs (mpsc)
Calling this during a big calculation will keep the screen up to date and the interface responsive.
Check the contents of the clipboard
Close the current display
Text editing widget should call this for each FL_KEYBOARD event.
Reset the length of bytes of app::compose()
Return the length of bytes written in app::compose()
Copy text to the clipboard
Copy text to the selection buffer
Gets FLTK crate version
Returns whether any of the widgets were damaged
Deletes widgets and their children.
Gets the display global variable, fl_display
.
_XDisplay
on X11, HINSTANCE
on Windows.
Initiate dnd action
Determines if the currently drawn box is active or inactive
Enable locks. This is called automatically in the beginning of the app initialization
Returns the latest captured event
Returns the captured button event. 1 for left key, 2 for middle, 3 for right
Returns false for a single click and true for more
Returns the number of clicks - 1
Get the clipboard content type
Get the clipboard content if it’s an image
Returns the x and y coordinates of the captured event
The event dispatch function is called after native events are converted to
FLTK events, but before they are handled by FLTK. If the dispatch function
handler is set, it is up to the dispatch function to call
app::handle2(Event, WindowPtr)
or to ignore the event.
Returns the current horizontal mouse scrolling associated with the Mousewheel event.
Returns MouseWheel::None
, Right
or Left
Returns the current horizontal mouse scrolling associated with the Mousewheel event.
Returns MouseWheel::None
, Up
or Down
.
Doesn’t indicate scrolling direction which depends on system preferences
Returns whether an event occured within a region
Returns whether an event occured within a widget
Determines whether an event was a click
Returns the presed key
Returns whether the key is pressed or held down during the last event
Returns the duration of an event
Returns the captured button event
Returns the original key
Returns the state of the event
Returns a textual representation of the latest event
Gets the x coordinate of the mouse in the window
Gets the x coordinate of the mouse in the screen
Gets the y coordinate of the mouse in the window
Gets the y coordinate of the mouse in the screen
Returns the first window of the application
Causes all the windows that need it to be redrawn and graphics forced out through the pipes.
Gets the widget which has focus
Gets the number of loaded fonts
Finds the index of a font through its name
Gets the name of a font through its index
Get the app’s font size
Gets a Vector
Set the foreground color
Get the max border radius for frame types
Fl::box_color. Gets the current frame color within box/frame drawing mode
Get the shadwo width for frames types with shadows
Get the app’s frame type
Get the font’s name
Get the font’s name
Returns a list of available fonts to the application
Get a font’s sizes
Gets the mouse coordinates relative to the screen
Gets the system colors
Get the grabbed window
Get the graphics context, fl_gc
Send a signal to a window. Integral values from 0 to 30 are reserved. Returns Ok(true) if the event was handled. Returns Ok(false) if the event was not handled. Returns Err on error or in use of one of the reserved values.
Send a signal to the main window. Integral values from 0 to 30 are reserved. Returns Ok(true) if the event was handled. Returns Ok(false) if the event was not handled.
Send a signal to a window pointer from event_dispatch. Returns true if the event was handled. Returns false if the event was not handled or ignored.
Checks whether an idle function is installed
Checks whether an idle function is installed
Check whether a timeout is installed
Check whether a timeout is installed
Inits all styles, fonts and images available to FLTK. Also initializes global locking
Set the insertion point
Returns whether the event is a alt key press
Returns whether the event is a command key press
Returns whether the event is a control key press
Returns whether the event is a shift press
Locks the main UI thread
Get the default menu linespacing
Returns the next window in order
Open the current display
Makes FLTK use its own colormap. This may make FLTK display better
Pastes content from the clipboard
Pastes image content from the clipboard
Pastes image content from the selection buffer
Pastes textual content from the clipboard
Pastes textual content from the selection buffer
Determines whether a program should quit
Gets the widget which was pushed
Quit the app
This is similar to app::check() except this does not call app::flush() or any callbacks, which is useful if your program is in a state where such callbacks are illegal.
Redraws everything
Unset the currently grabbed window
Reload the app scheme
Stop calling the specified callback when there are changes to the selection buffer or the clipboard. The clipboard is source 1 and the selection buffer is source 0
Remove an idle function
Remove an idle function
Add a system handler
Removes a timeout callback
Removes a timeout callback
Repeats a timeout callback from the expiration of the previous timeout.
You may only call this method inside a timeout callback.
The timeout duration tm
is indicated in seconds
Example:
Repeats a timeout callback from the expiration of the previous timeout.
You may only call this method inside a timeout callback.
The timeout duration tm
is indicated in seconds
Example:
Reset marked text
Runs the event loop
Gets the scheme of the application
Returns a pair of the x & y coords of the screen
Get the screen count
Get a screen’s dpi resolution
Get the screen number based on its coordinates
Get the screen scale
Return whether scaling the screen is supported
Returns a pair of the width and height of the screen
Get a screen’s working area
Get a screen’s xywh
Get the app’s scrollbar size
Set the background color for input and text widgets
Set the background color
Sets the callback of a widget
Swap a color with a custom RGB value
Sets the damage to true or false, illiciting a redraw by the application
Sets the widget which has focus at the start of the application
Set the app’s font
Set the app’s font size
Initializes loaded fonts of a certain pattern name
Set the foreground color
Set the max border radius for frame types
Fl::set_box_color. Sets the current frame color within box/frame drawing mode
Set the shadwo width for frames types with shadows
Set the app’s default frame type
Set the app’s default frame type without storing the old type
Set the app’s default frame type
Sets the OpenGL visual mode of the application
Set the current grab
Sets the app’s default selection color
Set the menu linespacing
Set a widget callback using a C style API
sets the scheme of the application
Set the screen scale
Set the application’s scrollbar size
Sets the app’s default selection color
Show focus around widgets
Sets the visual mode of the application
Returns whether a quit signal was sent
Put the thread to sleep for dur
seconds
Swap the default frame type with a new frame type
Receives a custom message
Unlocks the main UI thread
Gets FLTK version
Return whether visible focus is shown
Starts waiting for events. Calls to redraw within wait require an explicit sleep
Waits a maximum of dur
seconds or until “something happens”.
Returns true if an event happened (always true on windows).
Returns false if nothing happened.
Returns the apps windows.
Type Definitions
Alias Scheme to AppScheme
The display global variable, fl_display
.
_XDisplay
on X11, HINSTANCE
on Windows.
The current graphics context of the app, fl_gc
.
*mut c_void
to HDC
on Windows, CGContextRef
on macOS, _XGC
on X11
Alias Widget ptr
Alias Window ptr