[−][src]Struct mergui::Context
This manages the GUI. It contains every widget that needs to be drawn and makes sure they are updated properly
Implementations
impl Context
[src]
pub fn new() -> Self
[src]
pub fn add_singular_layer(&mut self) -> SingularLayerId
[src]
same as Context::add_layer but it gives you a layer back that can't be cloned. These are used by widgets that want to take control of an entire layer An example is Widgets::Concealer
pub fn add_layer(&mut self) -> LayerId
[src]
Adds a layer that can hold multiple widgets. Usefull to group widgets together that need to be removed at the same time
pub fn event(&mut self, event: &Event, window: &Window)
[src]
Call this in the event function of the state to update every widget.
pub fn render(&mut self, gfx: &mut Graphics, window: &Window) -> QuickResult<()>
[src]
Call this in the render function of your state to render every widget
pub fn add_widget<R, W, Res>(
&mut self,
widget: R,
layer_id: &LayerId
) -> Result<Response<Res>, ()> where
R: WidgetConfig<Res, W>,
W: Widget + 'static,
Res: Sized,
[src]
&mut self,
widget: R,
layer_id: &LayerId
) -> Result<Response<Res>, ()> where
R: WidgetConfig<Res, W>,
W: Widget + 'static,
Res: Sized,
Adds a widget configuration to a given layer.
Returns an Error if the layer does not exist.
Otherwise, returns a channel to comunicate with the new widget. Note: You can also add a widget using LayerId::add_widget.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Context
impl !Send for Context
impl !Sync for Context
impl Unpin for Context
impl !UnwindSafe for Context
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,