Module fltk::app[][src]

Application related methods and functions

Re-exports

pub use crate::enums::*;

Structs

App

Basic Application struct, used to instatiate, set the scheme and run the event loop

Receiver

Creates a receiver struct

Sender

Creates a sender struct

Enums

Scheme

Set the app scheme

Functions

abi_version

Gets FLTK ABI version

add_handler

Adds a custom handler for unhandled events

add_idle

Add an idle callback to run within the event loop Calls to WidgetExt::redraw within the callback require an explicit sleep

add_timeout

Adds a one-shot timeout callback. The timeout duration tm is indicated in seconds

api_version

Gets FLTK API version

awake

Trigger event loop handling in the main thread

awake_callback

Registers a function that will be called by the main thread during the next message handling cycle

awake_msg

Sends a custom message

background

Set the background color

background2

Set the background color for input and text widgets

belowmouse

Gets the widget that is below the mouse cursor This returns an Option which can be specified in the function call

channel

Creates a channel returning a Sender and Receiver structs (mpsc)

crate_version

Gets FLTK crate version

damage

Returns whether any of the widgets were damaged

delay

Delays the current thread by millis. Because std::thread::sleep isn't accurate on windows! Caution: It's a busy wait!

delete_widget

Deletes widgets and their children.

display

Gets the display global variable, fl_display _XDisplay on X11, HINSTANCE on Windows.

dnd

Initiate dnd action

event

Returns the latest captured event

event_button

Returns the captured button event 1 for left key, 2 for middle, 3 for right

event_clicks

Returns the number of clicks

event_coords

Returns the x and y coordinates of the captured event

event_dx

Gets the difference in x axis of the mouse coordinates from the screen to the window

event_dy

Gets the difference in y axis of the mouse coordinates from the screen to the window

event_inside

Returns whether an event occured within a region

event_inside_widget

Returns whether an event occured within a widget

event_is_click

Determines whether an event was a click

event_key

Returns the presed key

event_key_down

Returns whether the key is pressed or held down during the last event

event_length

Returns the duration of an event

event_mouse_button

Returns the captured button event

event_state

Returns the state of the event

event_text

Returns a textual representation of the latest event

event_x

Gets the x coordinate of the mouse in the window

event_x_root

Gets the x coordinate of the mouse in the screen

event_y

Gets the y coordinate of the mouse in the window

event_y_root

Gets the y coordinate of the mouse in the screen

first_window

Returns the first window of the application

focus

Gets the widget which has focus

font_count

Gets the number of loaded fonts

font_index

Finds the index of a font through its name

font_name

Gets the name of a font through its index

fonts

Gets a Vector of loaded fonts

foreground

Set the foreground color

get_font

Get the font's name

get_font_names

Returns a list of available fonts to the application

get_mouse

Gets the mouse coordinates relative to the screen

get_system_colors

Gets the system colors

grab

Get the grabbed window

graphics_context

Get the graphics context, fl_gc

handle

Send a signal to a window returns false if the event was not handled

handle_main

Send a signal to the main window returns false if the event was not handled

init_all

Inits all styles, fonts and images available to FLTK Also initializes global locking

is_event_alt

Returns whether the event is a alt key press

is_event_command

Returns whether the event is a command key press

is_event_ctrl

Returns whether the event is a control key press

is_event_shift

Returns whether the event is a shift press

lock

Locks the main UI thread

next_window

Returns the next window in order

own_colormap

Makes FLTK use its own colormap. This may make FLTK display better

paste

Used for widgets implementing the InputExt, pastes content from the clipboard

program_should_quit

Determines whether a program should quit

pushed

Gets the widget which was pushed

quit

Quit the app

redraw

Redraws everything

register_images

Registers all images supported by SharedImage

remove_timeout

Removes a timeout callback

repeat_timeout

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

run

Runs the event loop

scheme

Gets the scheme of the application

screen_size

Returns a pair of the width and height of the screen

scrollbar_size

Get the app's scrollbar size

set_callback

Sets the callback of a widget

set_damage

Sets the damage to true or false, illiciting a redraw by the application

set_focus

Sets the widget which has focus

set_font

Set the app's font

set_fonts

Initializes loaded fonts of a certain pattern name

set_frame_type

Set the app's default frame type

set_grab

Set the current grab

set_raw_callback

Set a widget callback using a C style API

set_scheme

sets the scheme of the application

set_scrollbar_size

Set the application's scrollbar size

set_visible_focus

Show focus around widgets

set_visual

Sets the visual mode of the application

should_program_quit

Returns whether a quit signal was sent

sleep

Put the thread to sleep for dur seconds

thread_msg

Receives a custom message

unlock

Unlocks the main UI thread

version

Gets FLTK version

visible_focus

Return whether visible focus is shown

wait

Starts waiting for events Calls to redraw within wait require an explicit sleep

wait_for

Waits a maximum of dur seconds or until "something happens".

windows

Returns the apps windows.

Type Definitions

AppScheme

Alias Scheme to AppScheme

Display

The display global variable, fl_display _XDisplay on X11, HINSTANCE on Windows.

GraphicsContext

The current graphics context of the app, fl_gc *mut c_void to HDC on Windows, CGContextRef on MacOS, _XGC on X11

WidgetPtr

Alias Widget ptr