[−][src]Struct pushrod::core::window::PushrodWindow
This structure contains a window and its corresponding onscreen widgets. These objects are stored in the Pushrod main loop.
Fields
window: PistonWindowA piston_window::PistonWindow object.
widgets: Vec<WidgetContainer>A vector list of Boxed PushrodWidget trait objects.
Methods
impl PushrodWindow[src]
Implementation for a new PushrodWindow. When a new PushrodWindow is added to the
managed window stack in the Pushrod main loop, this object is created to store its
components.
pub fn new(window: PistonWindow) -> Self[src]
Constructor, takes a managed PistonWindow from the piston_window crate. Adds a top-level
widget to the list that is a white container widget. This is the base for all other widgets
tht will be added to the window.
pub fn add_widget(&mut self, widget: Box<dyn Widget>) -> i32[src]
Adds a UI Widget to this window. Widget objects that are added using this method will
be part of the base widget (id = 0), and will be force-redrawn when the parent is
invalidated.
After adding a widget, the ID of the widget is returned.
pub fn add_widget_to_parent(
&mut self,
widget: Box<dyn Widget>,
parent_id: i32
) -> i32[src]
&mut self,
widget: Box<dyn Widget>,
parent_id: i32
) -> i32
Adds a UI Widget to the parent of a window, specified by the parent_id. The parent_id
must be an object that already exists in the stack.
After adding a widget, the ID of the widget is returned.
pub fn get_parent_of(&mut self, widget_id: i32) -> i32[src]
Retrieves the parent of the widget requested. Parent of 0 or -1 will always return 0.
pub fn get_children_of(&self, parent_id: i32) -> Vec<i32>[src]
Retrieves a list of all of the child IDs that list the parent_id as its parent. This
can be used recursively to determine the widget ownership tree, or the redraw order in which
repaint should take place.
pub fn get_widget_id_for_point(&mut self, point: Point) -> i32[src]
Retrieves a PushrodWidget ID for a specified Point. If no ID could be found,
defaults to a -1.
pub fn mouse_entered_for_id(&mut self, id: i32)[src]
Callback to mouse_entered for a Widget by ID.
pub fn mouse_exited_for_id(&mut self, id: i32)[src]
Callback to mouse_exited for a Widget by ID.
pub fn mouse_scrolled_for_id(&mut self, id: i32, point: Point)[src]
Callback to mouse_scrolled for a Widget by ID, with the mouse scroll Point.
pub fn get_widget_for_id(&mut self, id: i32) -> &Box<dyn Widget>[src]
Retrieves a reference to the Boxed Widget object by its ID.
Auto Trait Implementations
impl !Send for PushrodWindow
impl !Sync for PushrodWindow
Blanket Implementations
impl<T, U> Into for T where
U: From<T>, [src]
U: From<T>,
impl<T> From for T[src]
impl<T, U> TryFrom for T where
U: Into<T>, [src]
U: Into<T>,
type Error = !
try_from)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T> Borrow for T where
T: ?Sized, [src]
T: ?Sized,
impl<T, U> TryInto for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
Sets value as a parameter of self.