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§
Provided Methods§
sourcefn restrict_dimensions(&self) -> (bool, bool)
fn restrict_dimensions(&self) -> (bool, bool)
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)
sourcefn handle_closure(&mut self, mgr: &mut EventMgr<'_>)
fn handle_closure(&mut self, mgr: &mut EventMgr<'_>)
Handle closure of self
This allows for actions on destruction.
Default: do nothing.