pub trait WindowBuilderExt {
Show 16 methods
// Required methods
fn as_modal(self, val: bool) -> Self;
fn as_fullscreen(self, val: bool) -> Self;
fn with_icon<T: ImageExt>(self, image: Option<T>) -> Self
where Self: Sized;
fn with_cursor(self, cursor: Cursor) -> Self;
fn with_border(self, flag: bool) -> Self;
unsafe fn with_region(self, region: Region) -> Self;
fn with_size_range(
self,
min_w: i32,
min_h: i32,
max_w: i32,
max_h: i32,
) -> Self;
fn with_hotspot<W: WidgetExt>(self, w: &W) -> Self
where Self: Sized;
fn with_shape<I: ImageExt>(self, image: Option<I>) -> Self
where Self: Sized;
fn with_cursor_image(self, image: RgbImage, hot_x: i32, hot_y: i32) -> Self;
fn with_default_cursor(self, cursor: Cursor) -> Self;
fn with_screen_num(self, n: i32) -> Self;
fn with_opacity(self, val: f64) -> Self;
fn with_xclass(self, s: &str) -> Self;
fn with_override(self) -> Self;
fn with_force_position(self, flag: bool) -> Self;
}Expand description
Adds builder pattern friendly versions of several setter functions
Required Methods§
Sourcefn as_fullscreen(self, val: bool) -> Self
fn as_fullscreen(self, val: bool) -> Self
Makes a window fullscreen
Sourcefn with_icon<T: ImageExt>(self, image: Option<T>) -> Selfwhere
Self: Sized,
fn with_icon<T: ImageExt>(self, image: Option<T>) -> Selfwhere
Self: Sized,
Sets the windows icon. Supported formats are bmp, jpeg, png and rgb.
Sourcefn with_cursor(self, cursor: Cursor) -> Self
fn with_cursor(self, cursor: Cursor) -> Self
Sets the cursor style within the window. Needs to be called after the window is shown
Sourcefn with_border(self, flag: bool) -> Self
fn with_border(self, flag: bool) -> Self
Sets whether the window has a border
Sourceunsafe fn with_region(self, region: Region) -> Self
unsafe fn with_region(self, region: Region) -> Self
Sourcefn with_size_range(self, min_w: i32, min_h: i32, max_w: i32, max_h: i32) -> Self
fn with_size_range(self, min_w: i32, min_h: i32, max_w: i32, max_h: i32) -> Self
Set the window’s minimum width, minimum height, max width and max height. You can pass 0 as max_w and max_h to allow unlimited upward resize of the window.
Sourcefn with_hotspot<W: WidgetExt>(self, w: &W) -> Selfwhere
Self: Sized,
fn with_hotspot<W: WidgetExt>(self, w: &W) -> Selfwhere
Self: Sized,
Set the hotspot widget of the window
Sourcefn with_shape<I: ImageExt>(self, image: Option<I>) -> Selfwhere
Self: Sized,
fn with_shape<I: ImageExt>(self, image: Option<I>) -> Selfwhere
Self: Sized,
Set the shape of the window. Supported image formats are BMP, RGB and Pixmap. The window covers non-transparent/non-black shape of the image. The image must not be scaled(resized) beforehand. The size will be adapted to the window’s size
Sourcefn with_cursor_image(self, image: RgbImage, hot_x: i32, hot_y: i32) -> Self
fn with_cursor_image(self, image: RgbImage, hot_x: i32, hot_y: i32) -> Self
Set the cursor image
Sourcefn with_default_cursor(self, cursor: Cursor) -> Self
fn with_default_cursor(self, cursor: Cursor) -> Self
Set the window’s default cursor
Sourcefn with_screen_num(self, n: i32) -> Self
fn with_screen_num(self, n: i32) -> Self
Set the screen number
Sourcefn with_opacity(self, val: f64) -> Self
fn with_opacity(self, val: f64) -> Self
Set the window’s opacity, Ranges from 0.0 to 1.0, where 1.0 is fully opaque and 0.0 is fully transparent. This should be called on a shown window. On X11, opacity support depends on the window manager and can be queried:
$ xprop -root _NET_SUPPORTED | grep -o _NET_WM_WINDOW_OPACITYSourcefn with_xclass(self, s: &str) -> Self
fn with_xclass(self, s: &str) -> Self
Set the window’s XA_WM_CLASS property. This should be called before showing the window
Sourcefn with_override(self) -> Self
fn with_override(self) -> Self
removes the window border and sets the window on top, by settings the NOBORDER and OVERRIDE flags
Sourcefn with_force_position(self, flag: bool) -> Self
fn with_force_position(self, flag: bool) -> Self
Forces the position of the window
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.