[][src]Struct pushrod::core::window::PushrodWindow

pub struct PushrodWindow {
    pub window: PistonWindow,
    pub widgets: Vec<WidgetContainer>,
}

This structure contains a window and its corresponding onscreen widgets. These objects are stored in the Pushrod main loop.

Fields

window: PistonWindow

A 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]

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_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

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> SetParameter for T

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
    T: Parameter<Self>, 

Sets value as a parameter of self.

impl<T> Erased for T