[−][src]Trait fltk::prelude::WidgetTrait
Defines the methods implemented by all widgets
Required methods
fn new(x: i32, y: i32, width: i32, height: i32, title: &str) -> Self
Creates a new widget, takes an x, y coordinates, as well as a width and height, plus a title
fn set_label(&mut self, title: &str)
Sets the widget's label
fn redraw(&mut self)
Redraws a widget, necessary for resizing and changing positions
fn show(&mut self)
Shows the widget
fn hide(&mut self)
Hides the widget
fn x(&self) -> i32
Returns the x coordinate of the widget
fn y(&self) -> i32
Returns the y coordinate of the widget
fn width(&self) -> i32
Returns the width of the widget
fn height(&self) -> i32
Returns the height of the widget
fn label(&self) -> String
Returns the label of the widget
fn as_widget_ptr(&self) -> *mut Fl_Widget
transforms a widget to a base Fl_Widget, for internal use
fn activate(&mut self)
Activates the widget
fn deactivate(&mut self)
Deactivates the widget
fn redraw_label(&mut self)
Redraws the label of the widget
fn resize(&mut self, x: i32, y: i32, width: i32, height: i32)
Resizes and/or moves the widget, takes x, y, width and height
fn tooltip(&self) -> String
Returns the tooltip text
fn set_tooltip(&mut self, txt: &str)
Sets the tooltip text
fn get_type<T: WidgetType>(&self) -> T
Returns the widget type
fn set_type<T: WidgetType>(&mut self, typ: T)
Sets the widget type
fn color(&self) -> Color
Returns the widget color
fn set_color(&mut self, color: Color)
Sets the widget's color
fn label_color(&self) -> Color
Returns the widget label's color
fn set_label_color(&mut self, color: Color)
Sets the widget label's color
fn label_font(&self) -> Font
Returns the widget label's font
fn set_label_font(&mut self, font: Font)
Sets the widget label's font
fn label_size(&self) -> usize
Returns the widget label's size
fn set_label_size(&mut self, sz: usize)
Sets the widget label's size
fn label_type<T: WidgetType>(&self) -> T
Returns the widget label's type
fn set_label_type<T: WidgetType>(&mut self, typ: T)
Sets the widget label's type
fn frame<T: WidgetType>(&self) -> T
Returns the widget's frame type
fn set_frame<T: WidgetType>(&mut self, typ: T)
Sets the widget's frame type
fn changed(&self) -> bool
Returns whether the widget was changed
fn set_changed(&mut self)
Mark the widget as changed
fn clear_changed(&mut self)
Mark the widget as unchanged
fn align(&self) -> Align
Returns the alignment of the widget
fn set_align(&mut self, align: Align)
Sets the alignment of the widget
fn set_image<Image: ImageTrait>(&mut self, image: Image)
Sets the image of the widget
fn set_callback<'a>(&'a mut self, cb: Box<dyn FnMut() + 'a>)
Sets the callback when the widget is triggered (clicks for example)
fn set_custom_handler<'a>(&'a mut self, cb: Box<dyn FnMut(Event) -> bool + 'a>)
Set a custom handler, where events are managed manually