[−][src]Trait pushrod::widget::widget::Drawable
Provided methods
fn draw(&mut self, _c: Context, _g: &mut GlGraphics, _clip: &DrawState)
Draws the Widget
's contents. Only gets called if the Widget
is in invalidated
state. Provides a modified Context
object that has an origin of 0x0
in drawing
space for the draw routine. Also provides a mut G2d
object against which to draw,
and a clip
, which is automatically set to provide a clipping area for the Widget
. If
the Widget
draws outside of the clipped bounds, that will not be drawn on the
screen.
fn draw_with_offset(
&mut self,
c: Context,
g: &mut GlGraphics,
clip: &DrawState,
point_offset: Point
)
&mut self,
c: Context,
g: &mut GlGraphics,
clip: &DrawState,
point_offset: Point
)
Draws an object at an offset on the screen. This is a convenience method that is used
by other Widget
s that contain multiple widgets. Draw with offset always uses 0x0 as
the starting drawing coordinates, as this is what will be drawn within the bounds of the
Widget
. (See CheckboxWidget
and ImageButtonWidget
for good examples of this use.)