[][src]Trait druid::WinCtx

pub trait WinCtx<'a> {
    fn invalidate(&mut self);
fn text_factory(
        &mut self
    ) -> &mut <D2DRenderContext<'a> as RenderContext>::Text;
fn set_cursor(&mut self, cursor: &Cursor);
fn request_timer(&mut self, deadline: Instant) -> TimerToken;
fn open_file_sync(&mut self, options: FileDialogOptions) -> Option<FileInfo>;
fn save_as_sync(&mut self, options: FileDialogOptions) -> Option<FileInfo>; }

A context supplied to most WinHandler methods.

Required methods

fn invalidate(&mut self)

Invalidate the entire window.

TODO: finer grained invalidation.

fn text_factory(&mut self) -> &mut <D2DRenderContext<'a> as RenderContext>::Text

Get a reference to an object that can do text layout.

fn set_cursor(&mut self, cursor: &Cursor)

Set the cursor icon.

fn request_timer(&mut self, deadline: Instant) -> TimerToken

Schedule a timer.

This causes a WinHandler::timer() call at the deadline. The return value is a token that can be used to associate the request with the handler call.

Note that this is not a precise timer. On Windows, the typical resolution is around 10ms. Therefore, it's best used for things like blinking a cursor or triggering tooltips, not for anything requiring precision.

fn open_file_sync(&mut self, options: FileDialogOptions) -> Option<FileInfo>

Prompt the user to chose a file to open.

Blocks while the user picks the file.

fn save_as_sync(&mut self, options: FileDialogOptions) -> Option<FileInfo>

Prompt the user to chose a path for saving.

Blocks while the user picks a file.

Loading content...

Implementors

Loading content...