Trait kas_core::Window

source ·
pub trait Window: Widget {
    fn title(&self) -> &str;

    fn icon(&self) -> Option<Icon> { ... }
    fn restrict_dimensions(&self) -> (bool, bool) { ... }
    fn handle_closure(&mut self, mgr: &mut EventMgr<'_>) { ... }
}
Expand description

Functionality required by a window

Required Methods§

Get the window title

Provided Methods§

Get the window icon, if any

Default: None

Whether to limit the maximum size of a window

All widgets’ size rules allow calculation of two sizes: the minimum size and the ideal size. Windows are initially sized to the ideal size. This option controls whether the window size is restricted by the calculated minimum size and by the ideal size.

Return value is (restrict_min, restrict_max). Suggested is to use (true, true) for simple dialog boxes and (true, false) for complex windows.

Default: (true, false)

Handle closure of self

This allows for actions on destruction.

Default: do nothing.

Implementors§