Struct fltk::app::App[][src]

pub struct App {}
Expand description

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

Implementations

Instantiates an App type

Sets the scheme of the application

Sets the scheme of the application

Gets the scheme of the application

Runs the event loop

Errors

Can error on failure to run the application

Wait for incoming messages. Calls to redraw within wait require an explicit sleep

Loads system fonts

Loads a font from a path. On success, returns a String with the ttf Font Family name. The font’s index is always 16. As such only one font can be loaded at a time. The font name can be used with Font::by_name, and index with Font::by_index.

Examples

use fltk::{prelude::*, *};
let app = app::App::default();
let font = app.load_font("font.ttf").unwrap();
let mut frame = frame::Frame::new(0, 0, 400, 100, "Hello");
frame.set_label_font(enums::Font::by_name(&font));

Errors

Returns ResourceNotFound if the Font file was not found

Set the visual of the application

Errors

Returns FailedOperation if FLTK failed to set the visual mode

Redraws the app

Quit the application

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.