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
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
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
Sends a custom message
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)
Check the contents of the clipboard
Close the current display
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
Returns the latest captured event
Returns the captured button event. 1 for left key, 2 for middle, 3 for right
Returns the number of clicks
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
Flush the main window
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
Gets a Vector
Set the foreground color
Get the app’s frame type
Get the font’s name
Returns a list of available fonts to the application
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
Check whether a timeout is installed
Inits all styles, fonts and images available to FLTK. Also initializes global locking
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
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 textual content from the clipboard
Determines whether a program should quit
Gets the widget which was pushed
Quit the app
Redraws everything
Registers all images supported by SharedImage
Remove an idle function
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:
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
Sets the callback of a widget
Sets the damage to true or false, illiciting a redraw by the application
Sets the widget which has focus
Set the app’s font
Set the app’s font size
Initializes loaded fonts of a certain pattern name
Set the app’s default frame type
Set the current grab
Sets the app’s default selection color
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