Struct kiss_ui::base::BaseWidget [] [src]

pub struct BaseWidget(_);

A general widget type that can be specialized at runtime via Downcast.

Methods

impl BaseWidget

fn load<N: Borrow<str>>(name: N) -> Option<BaseWidget>

Attempt to load a widget named by name from internal storage.

If successful, the BaseWidget can then be downcast to the original widget type.

Returns None if no widget by that name was found.

Panics

If called before kiss_ui::show_gui() is invoked or after it returns.

fn try_downcast<T>(self) -> Result<T, Self> where T: Downcast

Attempt to downcast this BaseWidget to a more specialized widget type.

This will return an error if the underlying widget class is different than the one it is being cast to.

Trait Implementations

impl Widget for BaseWidget

fn show(self) -> Self

fn hide(self) -> Self

fn set_visible(self, visible: bool) -> Self

fn set_enabled(self, enabled: bool) -> Self

fn set_position(self, x: i32, y: i32) -> Self

fn get_position(self) -> (i32, i32)

fn set_name(self, name: &str) -> Self

fn get_name(&self) -> Option<WidgetStr>

fn get_sibling(self) -> Option<BaseWidget>

fn get_parent(self) -> Option<BaseWidget>

fn get_dialog(self) -> Option<Dialog>

fn get_size_pixels(self) -> (u32, u32)

fn store<N: Into<String>>(self, name: N) -> Option<BaseWidget>

fn to_base(self) -> BaseWidget

impl Copy for BaseWidget

impl Clone for BaseWidget

fn clone(&self) -> Self

fn clone_from(&mut self, source: &Self)