pub struct WidgetCreated<W: Widget<U>, U: Ui>(/* private fields */);Expand description
Hookable: Triggers when a Widget’s cfg is created
§Arguments
- The
WidgetCfgin question. - The
FileHandleto which it was pushed, if there was one.
§Aliases
Since every Widget implements the HookAlias trait, instead
of writing this in the config crate:
setup_duat!(setup);
use duat::prelude::*;
fn setup() {
hook::add::<WidgetCreated<LineNumbers<Ui>>>(|pa, (ln, handle)| ln.rel_abs());
}You can just write this:
setup_duat!(setup);
use duat::prelude::*;
fn setup() {
hook::add::<LineNumbers<Ui>>(|pa, (ln, handle)| ln.rel_abs());
}Do note that this hook doesn’t let you change the layout of the
pushed Widgets, only their configuration. So if one of these
changes changed the direction where the Widget was pushed,
for example, the layout could get messed up.
If you want to change the layout of the Widgets in a controled
fashion, look at OnFileOpen and OnWindowOpen.
Trait Implementations§
Auto Trait Implementations§
impl<W, U> !Freeze for WidgetCreated<W, U>
impl<W, U> !RefUnwindSafe for WidgetCreated<W, U>
impl<W, U> !Send for WidgetCreated<W, U>
impl<W, U> !Sync for WidgetCreated<W, U>
impl<W, U> Unpin for WidgetCreated<W, U>
impl<W, U> !UnwindSafe for WidgetCreated<W, U>
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
Mutably borrows from an owned value. Read more