[][src]Struct pushrod::core::main::Pushrod

pub struct Pushrod {
    pub widget_store: RefCell<WidgetStore>,
    // some fields omitted
}

This structure is returned when instantiating a new Pushrod main object. It stores the OpenGL configuration that is desired for drawing, a list of references to a managed set of PushrodWindow objects, registered EventListeners, and PushrodEvent objects that are pending dispatch.

The objects contained within this structure are used by the Pushrod run loop, and are not intended to be modified except through methods in the Pushrod impl.

Fields

widget_store: RefCell<WidgetStore>

Methods

impl Pushrod[src]

Pushrod implementation. Create a Pushrod::new( OpenGL ) object to create a new main loop. Only one of these should be set for the entire application runtime.

Example usage: IN PROGRESS

pub fn new(window: PistonWindow) -> Self[src]

Pushrod Object Constructor. Takes in a single OpenGL configuration type.

pub fn get_factory(&mut self) -> &mut GfxFactory[src]

Retrieves the window GfxFactory factory object for graphics textures.

pub fn add_widget(&mut self, name: &str, widget: Box<dyn Widget>) -> i32[src]

Helper method that adds a Widget to the WidgetStore, returning the ID of the Widget after it has been added.

pub fn add_widget_to_parent(
    &mut self,
    name: &str,
    widget: Box<dyn Widget>,
    parent_id: i32
) -> i32
[src]

Helper method that adds a Widget to the WidgetStore, specifying the parent_id as the parent of which to add this object to. Returns the new ID of the Widget after it has been added.

pub fn run(&mut self, event_handler: &mut dyn PushrodCallbackEvents)[src]

This is the main run loop that is called to process all UI events. This loop is responsible for handling events from the OS, converting them to workable objects, and passing them off to quick callback dispatchers.

The run loop handles events in the following order:

  • Mouse events
    • Movement events
    • Button events
    • Scroll button events
  • Custom events are then dispatched to any registered event listeners
  • Draw loop
    • Draw only widgets whose states have become invalidated
    • Swap display buffers if required

This event is handled window-by-window. Once a window has processed all of its pending events, the next window is then processed. No particular window takes precidence - any window that has events to process gets handled in order.

Auto Trait Implementations

impl !Send for Pushrod

impl !Sync for Pushrod

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 = Infallible

The type returned in the event of a conversion error.

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

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

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

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

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

The type returned in the event of a conversion error.

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