[−][src]Struct pushrod::widget::image_widget::ImageWidget
This is the ImageWidget, which draws an image on the screen. The image is loaded into
heap memory (using a Box). This way, larger image objects can be loaded.
Example usage: IN PROGRESS
Methods
impl ImageWidget[src]
Implementation of the constructor for the ImageWidget. Creates a new image object to be
displayed on the screen, given the image filename.
pub fn new(factory: &mut GfxFactory, image_name: String) -> Self[src]
Creates a new ImageWidget object, requiring the current PistonWindow's factory object
(which can be cloned), and the name of the image to load. The image should be in the
project's local assets directory at the top level.
Trait Implementations
impl Widget for ImageWidget[src]
Implementation of the ImageWidget object. Draws an image on the screen based on the
image file you specify.
fn config(&mut self) -> &mut Configurable[src]
fn draw(&mut self, c: Context, g: &mut G2d, clip: &DrawState)[src]
Draws the contents of the widget.
fn invalidate(&mut self)[src]
Indicates that a widget needs to be redrawn/refreshed.
fn clear_invalidate(&mut self)[src]
Clears the invalidation flag.
fn is_invalidated(&mut self) -> bool[src]
Checks to see whether or not the widget needs to be redrawn/refreshed.
fn set_config(&mut self, config: u8, config_value: Config)[src]
fn get_config(&mut self, config: u8) -> Option<&Config>[src]
fn set_point(&mut self, config: u8, x: i32, y: i32)[src]
fn set_size(&mut self, config: u8, w: i32, h: i32)[src]
fn set_color(&mut self, config: u8, color: Color)[src]
fn set_numeric(&mut self, config: u8, value: u64)[src]
fn set_text(&mut self, config: u8, text: String)[src]
fn set_toggle(&mut self, config: u8, flag: bool)[src]
fn handle_event(
&mut self,
_injected: bool,
_event: CallbackEvent
) -> Option<CallbackEvent>[src]
&mut self,
_injected: bool,
_event: CallbackEvent
) -> Option<CallbackEvent>
Handles an event that was sent by the event loop. It is up to the Widget to handle the event, or to ignore it. If this function is not overridden, the event will be ignored, and no event will be returned as a result. This function returns an Option<CallbackEvent>, which can be injected into the run loop. This can be things for Widget interaction that may generate an event that the application needs to respond to, like a button click, or a drag start/end event. Read more
fn inject_event(&mut self, _widget_id: i32) -> Option<CallbackEvent>[src]
Injects an event into the run loop, but only if injects_events returns true.
fn injects_events(&mut self) -> bool[src]
When set to true, this will check only the Widget that is set to inject events at the time the run loop starts. This cannot be toggled on/off by the Widget, as the run loop checks for Widget objects that inject events before the loop starts. This is to use less overhead during the run loop. Read more
fn draw_with_offset(
&mut self,
c: Context,
g: &mut G2d,
clip: &DrawState,
point_offset: Point
)[src]
&mut self,
c: Context,
g: &mut G2d,
clip: &DrawState,
point_offset: Point
)
Sets an alternate context with a drawing offset and size scale, then calls the underlying draw routine. If this is not the desired effect, this routine can be overridden, but this will handle the offset drawing for 90% of the Widget draw routines. Read more
Auto Trait Implementations
impl Send for ImageWidget
impl Sync for ImageWidget
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 = Infallible
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> 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, U> TryInto for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[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.