[][src]Struct druid::WindowHandle

pub struct WindowHandle(_);

A handle to a platform window object.

Implementations

impl WindowHandle[src]

pub fn show(&self)[src]

Make this window visible.

This is part of the initialization process; it should only be called once, when a window is first created.

pub fn close(&self)[src]

Close the window.

pub fn resizable(&self, resizable: bool)[src]

Set whether the window should be resizable

pub fn show_titlebar(&self, show_titlebar: bool)[src]

Set whether the window should show titlebar

pub fn bring_to_front_and_focus(&self)[src]

Bring this window to the front of the window stack and give it focus.

pub fn invalidate(&self)[src]

Request invalidation of the entire window contents.

pub fn invalidate_rect(&self, rect: Rect)[src]

Request invalidation of a region of the window.

pub fn set_title(&self, title: &str)[src]

Set the title for this menu.

pub fn set_menu(&self, menu: Menu)[src]

Set the top-level menu for this window.

pub fn text(&self) -> <CoreGraphicsContext as RenderContext>::Text[src]

Get access to a type that can perform text layout.

pub fn request_timer(&self, deadline: Duration) -> TimerToken[src]

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.

pub fn set_cursor(&mut self, cursor: &Cursor)[src]

Set the cursor icon.

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

Prompt the user to chose a file to open.

Blocks while the user picks the file.

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

Prompt the user to chose a path for saving.

Blocks while the user picks a file.

pub fn show_context_menu(&self, menu: Menu, pos: Point)[src]

Display a pop-up menu at the given position.

Point is in the coordinate space of the window.

pub fn get_idle_handle(&self) -> Option<IdleHandle>[src]

Get a handle that can be used to schedule an idle task.

pub fn get_scale(&self) -> Result<Scale, Error>[src]

Get the Scale information of the window.

The returned Scale is a copy and thus its information will be stale after the platform DPI changes. A correctly behaving application should consider the lifetime of this Scale brief, limited to approximately a single event cycle.

Trait Implementations

impl Clone for WindowHandle[src]

impl Default for WindowHandle[src]

impl From<WindowHandle> for WindowHandle[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> RoundFrom<T> for T

impl<T, U> RoundInto<U> for T where
    U: RoundFrom<T>, 

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.