pub struct Window(/* private fields */);Expand description
Implementations§
Source§impl Window
impl Window
Sourcepub fn push_inner<W: Widget>(
&self,
pa: &mut Pass,
widget: W,
specs: PushSpecs,
) -> Handle<W>
pub fn push_inner<W: Widget>( &self, pa: &mut Pass, widget: W, specs: PushSpecs, ) -> Handle<W>
Pushes a Widget around the “buffer area” of a Window
When you push a Widget, it is placed on an edge of the
area, and a new parent area may be created to hold both
widgets. If created, that new area will be used for pushing
widgets in the future.
This means that, if you push widget B to the bottom, then you push widget A to the left, you will get this layout:
╭───┬───────────╮
│ │ │
│ A │ Buffers │
│ │ │
├───┴───────────┤
│ B │
╰───────────────╯The Buffers region here represents a central area that all
Windows contain, where all the Buffers are placed
alongside their satellite Widgets. When you push Widgets
to the Window, instead of to a Handle, those widgets are
placed in the outer region, not being associated with any
particular Buffer.
In this case, each Window will have a LogBook on the
left side as well as FooterWidgets on the bottom.
Sourcepub fn push_outer<W: Widget>(
&self,
pa: &mut Pass,
widget: W,
specs: PushSpecs,
) -> Handle<W>
pub fn push_outer<W: Widget>( &self, pa: &mut Pass, widget: W, specs: PushSpecs, ) -> Handle<W>
Pushes a Widget to the edges of a Window
When you push a Widget, it is placed on an edge of the
area, and a new parent area may be created to hold both
widgets. If created, that new area will be used for pushing
widgets in the future.
This means that, if you push widget B to the bottom, then you push widget A to the left, you will get this layout:
╭───┬───────────╮
│ │ │
│ │ Buffers │
│ A │ │
│ ├───────────┤
│ │ B │
╰───┴───────────╯The Buffers region here represents a central area that all
Windows contain, where all the Buffers are placed
alongside their satellite Widgets. When you push Widgets
to the Window, instead of to a Handle, those widgets are
placed in the outer region, not being associated with any
particular Buffer.
In this case, each Window will have a LogBook on the
left side as well as FooterWidgets on the bottom.
Sourcepub fn spawn<W: Widget>(
&self,
pa: &mut Pass,
widget: W,
specs: StaticSpawnSpecs,
) -> Handle<W>
pub fn spawn<W: Widget>( &self, pa: &mut Pass, widget: W, specs: StaticSpawnSpecs, ) -> Handle<W>
Spawns a new static Widget on this Window
This Widget, unlike all other kinds, does not follow changes
in the layout by the resizing or closure of other Widgets.
It instead stays in a single Coord, its width and height
being predefined.
There is one circumstance in which this Widget will move,
however: when the window resizes. In this circumstance, the
Widget will be relocated as to be placed in relatively the
same place on screen, in relation to the bottom right corner
of the screen.
Sourcepub fn handles<'a>(
&'a self,
pa: &'a Pass,
) -> impl Iterator<Item = &'a Handle<dyn Widget>>
pub fn handles<'a>( &'a self, pa: &'a Pass, ) -> impl Iterator<Item = &'a Handle<dyn Widget>>
An Iterator over all Handles in a Window
Each Handle takes care of one Widget, if you want to see
which one exactly is being used, you can use the
Handle::try_downcast and Handle::read_as methods.
If you just want an iterator over the Buffers, then check
out Window::buffers.
Sourcepub fn buffers(&self, pa: &Pass) -> Vec<Handle>
pub fn buffers(&self, pa: &Pass) -> Vec<Handle>
The Buffers in a single Window
They will be ordered by where the "next-buffer" command
focus on. This usually follows the order by which they were
created, but it can be altered if you use the "swap"
command.
If you want an Iterator over all Handles, see
Window::handles.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Window
impl !RefUnwindSafe for Window
impl Send for Window
impl Sync for Window
impl Unpin for Window
impl !UnwindSafe for Window
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.