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
Sets the scheme of the application
Sets the scheme of 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
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for App
impl UnwindSafe for App
Blanket Implementations
Mutably borrows from an owned value. Read more