Trait kas::Window [−][src]
pub trait Window: Widget<Msg = VoidMsg> {
fn title(&self) -> &str;
fn icon(&self) -> Option<Icon>;
fn restrict_dimensions(&self) -> (bool, bool);
fn add_popup(&mut self, mgr: &mut Manager<'_>, id: WindowId, popup: Popup);
fn resize_popups(&mut self, mgr: &mut Manager<'_>);
fn remove_popup(&mut self, mgr: &mut Manager<'_>, id: WindowId);
fn handle_closure(&mut self, _mgr: &mut Manager<'_>) { ... }
}
Expand description
Functionality required by a window
Required methods
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.
fn resize_popups(&mut self, mgr: &mut Manager<'_>)
fn resize_popups(&mut self, mgr: &mut Manager<'_>)
Resize popups
This is called immediately after Layout::set_rect
to resize
existing pop-ups.
fn remove_popup(&mut self, mgr: &mut Manager<'_>, id: WindowId)
fn remove_popup(&mut self, mgr: &mut Manager<'_>, id: WindowId)
Trigger closure of a pop-up
If the given id
refers to a pop-up, it should be closed.
Provided methods
fn handle_closure(&mut self, _mgr: &mut Manager<'_>)
fn handle_closure(&mut self, _mgr: &mut Manager<'_>)
Handle closure of self
This allows for actions on destruction, but doesn’t need to do anything.