pub unsafe trait WindowExt: GroupExt {
Show 39 methods
// Required methods
fn center_screen(self) -> Self
where Self: Sized;
fn make_modal(&mut self, val: bool);
fn fullscreen(&mut self, val: bool);
fn make_current(&mut self);
fn icon(&self) -> Option<Box<dyn ImageExt>>;
fn set_icon<T: ImageExt>(&mut self, image: Option<T>)
where Self: Sized;
fn set_cursor(&mut self, cursor: Cursor);
fn shown(&self) -> bool;
fn set_border(&mut self, flag: bool);
fn border(&self) -> bool;
fn free_position(&mut self);
fn raw_handle(&self) -> RawHandle;
fn region(&self) -> Region;
unsafe fn set_region(&mut self, region: Region);
fn iconize(&mut self);
fn fullscreen_active(&self) -> bool;
fn decorated_w(&self) -> i32;
fn decorated_h(&self) -> i32;
fn size_range(&mut self, min_w: i32, min_h: i32, max_w: i32, max_h: i32);
fn hotspot<W: WidgetExt>(&mut self, w: &W)
where Self: Sized;
fn set_shape<I: ImageExt>(&mut self, image: Option<I>)
where Self: Sized;
fn shape(&self) -> Option<Box<dyn ImageExt>>;
fn x_root(&self) -> i32;
fn y_root(&self) -> i32;
fn set_cursor_image(&mut self, image: RgbImage, hot_x: i32, hot_y: i32);
fn default_cursor(&mut self, cursor: Cursor);
fn screen_num(&self) -> i32;
fn set_screen_num(&mut self, n: i32);
fn wait_for_expose(&self);
fn opacity(&self) -> f64;
fn set_opacity(&mut self, val: f64);
fn xclass(&self) -> Option<String>;
fn set_xclass(&mut self, s: &str);
fn clear_modal_states(&mut self);
fn set_override(&mut self);
fn is_override(&self) -> bool;
fn force_position(&mut self, flag: bool);
fn set_icon_label(&mut self, label: &str);
fn icon_label(&self) -> Option<String>;
}
Expand description
Defines the methods implemented by all window widgets. More details can be found in the wiki. Windows (which can be found in the window module) implement GroupExt as well.
Safety
fltk-rs traits depend on some FLTK internal code
Warning
fltk-rs traits are non-exhaustive,
to avoid future breakage if you try to implement them manually,
use the Deref and DerefMut pattern or the widget_extends!
macro
Required Methods§
sourcefn center_screen(self) -> Selfwhere
Self: Sized,
fn center_screen(self) -> Selfwhere Self: Sized,
Positions the window to the center of the screen
sourcefn make_modal(&mut self, val: bool)
fn make_modal(&mut self, val: bool)
Makes a window modal, should be called before show
sourcefn fullscreen(&mut self, val: bool)
fn fullscreen(&mut self, val: bool)
Makes a window fullscreen
sourcefn make_current(&mut self)
fn make_current(&mut self)
Makes the window current
sourcefn set_icon<T: ImageExt>(&mut self, image: Option<T>)where
Self: Sized,
fn set_icon<T: ImageExt>(&mut self, image: Option<T>)where Self: Sized,
Sets the windows icon. Supported formats are bmp, jpeg, png and rgb.
sourcefn set_cursor(&mut self, cursor: Cursor)
fn set_cursor(&mut self, cursor: Cursor)
Sets the cursor style within the window. Needs to be called after the window is shown
sourcefn set_border(&mut self, flag: bool)
fn set_border(&mut self, flag: bool)
Sets whether the window has a border
sourcefn free_position(&mut self)
fn free_position(&mut self)
Frees the position of the window
sourcefn raw_handle(&self) -> RawHandle
fn raw_handle(&self) -> RawHandle
Get the raw system handle of the window
sourceunsafe fn set_region(&mut self, region: Region)
unsafe fn set_region(&mut self, region: Region)
sourcefn iconize(&mut self)
fn iconize(&mut self)
Iconifies the window. You can tell that the window is iconized by checking that it’s shown and not visible
sourcefn fullscreen_active(&self) -> bool
fn fullscreen_active(&self) -> bool
Returns whether the window is fullscreen or not
sourcefn decorated_w(&self) -> i32
fn decorated_w(&self) -> i32
Returns the decorated width
sourcefn decorated_h(&self) -> i32
fn decorated_h(&self) -> i32
Returns the decorated height
sourcefn size_range(&mut self, min_w: i32, min_h: i32, max_w: i32, max_h: i32)
fn size_range(&mut self, min_w: i32, min_h: i32, max_w: i32, max_h: i32)
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 hotspot<W: WidgetExt>(&mut self, w: &W)where
Self: Sized,
fn hotspot<W: WidgetExt>(&mut self, w: &W)where Self: Sized,
Set the hotspot widget of the window
sourcefn set_shape<I: ImageExt>(&mut self, image: Option<I>)where
Self: Sized,
fn set_shape<I: ImageExt>(&mut self, image: Option<I>)where 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 set_cursor_image(&mut self, image: RgbImage, hot_x: i32, hot_y: i32)
fn set_cursor_image(&mut self, image: RgbImage, hot_x: i32, hot_y: i32)
Set the cursor image
sourcefn default_cursor(&mut self, cursor: Cursor)
fn default_cursor(&mut self, cursor: Cursor)
Set the window’s default cursor
sourcefn screen_num(&self) -> i32
fn screen_num(&self) -> i32
Get the screen number
sourcefn set_screen_num(&mut self, n: i32)
fn set_screen_num(&mut self, n: i32)
Set the screen number
sourcefn wait_for_expose(&self)
fn wait_for_expose(&self)
wait for the window to be displayed after calling show()
.
More info here
sourcefn set_opacity(&mut self, val: f64)
fn set_opacity(&mut self, val: f64)
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_OPACITY
sourcefn set_xclass(&mut self, s: &str)
fn set_xclass(&mut self, s: &str)
Set the window’s XA_WM_CLASS property. This should be called before showing the window
sourcefn clear_modal_states(&mut self)
fn clear_modal_states(&mut self)
Clear the modal state of the window
sourcefn set_override(&mut self)
fn set_override(&mut self)
removes the window border and sets the window on top, by settings the NOBORDER and OVERRIDE flags
sourcefn is_override(&self) -> bool
fn is_override(&self) -> bool
Checks whether the OVERRIDE flag was set
sourcefn force_position(&mut self, flag: bool)
fn force_position(&mut self, flag: bool)
Forces the position of the window
sourcefn set_icon_label(&mut self, label: &str)
fn set_icon_label(&mut self, label: &str)
Set the icon label
sourcefn icon_label(&self) -> Option<String>
fn icon_label(&self) -> Option<String>
Get the icon label