[−][src]Struct druid::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 set_window_state(&mut self, state: WindowState)
[src]
Sets the state of the window.
pub fn get_window_state(&self) -> WindowState
[src]
Gets the state of the window.
pub fn handle_titlebar(&self, val: bool)
[src]
Informs the system that the current location of the mouse should be treated as part of the
window's titlebar. This can be used to implement a custom titlebar widget. Note that
because this refers to the current location of the mouse, you should probably call this
function in response to every relevant WinHandler::mouse_move
.
This is currently only implemented on Windows.
pub fn show_titlebar(&self, show_titlebar: bool)
[src]
Set whether the window should show titlebar.
pub fn set_position(&self, position: impl Into<Point>)
[src]
Sets the position of the window in pixels, relative to the origin of the virtual screen.
pub fn get_position(&self) -> Point
[src]
Returns the position of the window in pixels, relative to the origin of the virtual screen.
pub fn set_size(&self, size: impl Into<Size>)
[src]
Set the window's size in display points.
The actual window size in pixels will depend on the platform DPI settings.
This should be considered a request to the platform to set the size of the window. The
platform might choose a different size depending on its DPI or other platform-dependent
configuration. To know the actual size of the window you should handle the
WinHandler::size
method.
pub fn get_size(&self) -> Size
[src]
Gets the window size, in pixels.
pub fn set_level(&self, level: WindowLevel)
[src]
Sets the WindowLevel
, the z-order in the Window system / compositor
We do not currently have a getter method, mostly because the system's levels aren't a
perfect one-to-one map to druid_shell
's levels. A getter method may be added in the
future.
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 request_anim_frame(&self)
[src]
Request that prepare_paint
and paint
be called next time there's the opportunity to
render another frame. This differs from invalidate
and invalidate_rect
in that it
doesn't invalidate any part of the window.
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) -> CoreGraphicsText
[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 make_cursor(&self, desc: &CursorDesc) -> Option<Cursor>
[src]
pub fn open_file(
&mut self,
options: FileDialogOptions
) -> Option<FileDialogToken>
[src]
&mut self,
options: FileDialogOptions
) -> Option<FileDialogToken>
Prompt the user to choose a file to open.
This won't block immediately; the file dialog will be shown whenever control returns to
druid-shell
, and the WinHandler::open_file
method will be called when the dialog is
closed.
pub fn save_as(&mut self, options: FileDialogOptions) -> Option<FileDialogToken>
[src]
Prompt the user to choose a path for saving.
This won't block immediately; the file dialog will be shown whenever control returns to
druid-shell
, and the WinHandler::save_as
method will be called when the dialog is
closed.
pub fn show_context_menu(&self, menu: Menu, pos: Point)
[src]
Display a pop-up menu at the given position.
pos
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 DPI scale of the window.
The returned Scale
is a copy and thus its information will be stale after
the platform DPI changes. This means you should not stash it and rely on it later; it is
only guaranteed to be valid for the current pass of the runloop.
Trait Implementations
impl Clone for WindowHandle
[src]
pub fn clone(&self) -> WindowHandle
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Default for WindowHandle
[src]
pub fn default() -> WindowHandle
[src]
impl From<WindowHandle> for WindowHandle
[src]
pub fn from(src: WindowHandle) -> WindowHandle
[src]
Auto Trait Implementations
impl !RefUnwindSafe for WindowHandle
[src]
impl !Send for WindowHandle
[src]
impl !Sync for WindowHandle
[src]
impl Unpin for WindowHandle
[src]
impl UnwindSafe for WindowHandle
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> RoundFrom<T> for T
pub fn round_from(x: T) -> T
impl<T, U> RoundInto<U> for T where
U: RoundFrom<T>,
U: RoundFrom<T>,
pub fn round_into(self) -> U
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,