pub struct WidgetContainer {
pub widget: RefCell<Box<dyn Widget>>,
pub origin: Vec<i32>,
/* private fields */
}Expand description
This is a container that stores information about a Widget that will be drawn on the screen.
It stores the Widget object, the actual point of origin inside the Window (as a Vec<i32>
of X and Y points), the parent ID of this Widget, if it is being added as a child.
Fields§
§widget: RefCell<Box<dyn Widget>>§origin: Vec<i32>Implementations§
Source§impl WidgetContainer
This is the WidgetContainer object that stores a Widget and its accompanying information:
its name, point of origin, and parent ID.
impl WidgetContainer
This is the WidgetContainer object that stores a Widget and its accompanying information:
its name, point of origin, and parent ID.
Sourcepub fn new(
widget: Box<dyn Widget>,
widget_name: String,
origin: Vec<i32>,
widget_id: i32,
parent_id: i32,
) -> Self
pub fn new( widget: Box<dyn Widget>, widget_name: String, origin: Vec<i32>, widget_id: i32, parent_id: i32, ) -> Self
Creates a new WidgetContainer storage object.
Sourcepub fn get_widget_name(&self) -> String
pub fn get_widget_name(&self) -> String
Retrieves the name of this Widget.
Sourcepub fn get_widget_id(&self) -> i32
pub fn get_widget_id(&self) -> i32
Retrieves the numeric ID of this Widget.
Sourcepub fn get_parent_id(&self) -> i32
pub fn get_parent_id(&self) -> i32
Retrieves the numeric ID of the parent that this Widget refers to. A 0 indicates
no parent is assigned.
Auto Trait Implementations§
impl !Freeze for WidgetContainer
impl !RefUnwindSafe for WidgetContainer
impl !Send for WidgetContainer
impl !Sync for WidgetContainer
impl Unpin for WidgetContainer
impl !UnwindSafe for WidgetContainer
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