Trait fltk::prelude::WidgetExt [−][src]
pub unsafe trait WidgetExt {}Show methods
fn set_pos(&mut self, x: i32, y: i32); fn set_size(&mut self, width: i32, height: i32); fn set_label(&mut self, title: &str); fn redraw(&mut self); fn show(&mut self); fn hide(&mut self); fn x(&self) -> i32; fn y(&self) -> i32; fn width(&self) -> i32; fn height(&self) -> i32; fn w(&self) -> i32; fn h(&self) -> i32; fn label(&self) -> String; fn measure_label(&self) -> (i32, i32); unsafe fn as_widget_ptr(&self) -> *mut Fl_Widget; fn with_pos(self, x: i32, y: i32) -> Self
where
Self: Sized; fn with_size(self, width: i32, height: i32) -> Self
where
Self: Sized; fn with_label(self, title: &str) -> Self
where
Self: Sized; fn with_align(self, align: Align) -> Self
where
Self: Sized; fn below_of<W: WidgetExt>(self, w: &W, padding: i32) -> Self
where
Self: Sized; fn above_of<W: WidgetExt>(self, w: &W, padding: i32) -> Self
where
Self: Sized; fn right_of<W: WidgetExt>(self, w: &W, padding: i32) -> Self
where
Self: Sized; fn left_of<W: WidgetExt>(self, w: &W, padding: i32) -> Self
where
Self: Sized; fn center_of<W: WidgetExt>(self, w: &W) -> Self
where
Self: Sized; fn center_of_parent(self) -> Self
where
Self: Sized; fn size_of<W: WidgetExt>(self, w: &W) -> Self
where
Self: Sized; fn size_of_parent(self) -> Self
where
Self: Sized; fn inside<W: WidgetExt>(&self, wid: &W) -> bool
where
Self: Sized; fn get_type<T: WidgetType>(&self) -> T
where
Self: Sized; fn set_type<T: WidgetType>(&mut self, typ: T)
where
Self: Sized; fn set_image<I: ImageExt>(&mut self, image: Option<I>)
where
Self: Sized; fn image(&self) -> Option<Box<dyn ImageExt>>
where
Self: Sized; fn set_deimage<I: ImageExt>(&mut self, image: Option<I>)
where
Self: Sized; fn deimage(&self) -> Option<Box<dyn ImageExt>>
where
Self: Sized; fn set_callback<F: FnMut(&mut Self) + 'static>(&mut self, cb: F)
where
Self: Sized; fn emit<T: 'static + Clone + Send + Sync>(
&mut self,
sender: Sender<T>,
msg: T
)
where
Self: Sized; fn activate(&mut self); fn deactivate(&mut self); fn redraw_label(&mut self); fn resize(&mut self, x: i32, y: i32, width: i32, height: i32); fn tooltip(&self) -> Option<String>; fn set_tooltip(&mut self, txt: &str); fn color(&self) -> Color; fn set_color(&mut self, color: Color); fn label_color(&self) -> Color; fn set_label_color(&mut self, color: Color); fn label_font(&self) -> Font; fn set_label_font(&mut self, font: Font); fn label_size(&self) -> i32; fn set_label_size(&mut self, sz: i32); fn label_type(&self) -> LabelType; fn set_label_type(&mut self, typ: LabelType); fn frame(&self) -> FrameType; fn set_frame(&mut self, typ: FrameType); fn changed(&self) -> bool; fn set_changed(&mut self); fn clear_changed(&mut self); fn align(&self) -> Align; fn set_align(&mut self, align: Align); fn parent(&self) -> Option<Box<dyn GroupExt>>; fn selection_color(&mut self) -> Color; fn set_selection_color(&mut self, color: Color); fn do_callback(&mut self); fn window(&self) -> Option<Box<dyn WindowExt>>; fn top_window(&self) -> Option<Box<dyn WindowExt>>; fn takes_events(&self) -> bool; fn take_focus(&mut self) -> Result<(), FltkError>; fn set_visible_focus(&mut self); fn clear_visible_focus(&mut self); fn visible_focus(&mut self, v: bool); fn has_visible_focus(&mut self) -> bool; fn was_deleted(&self) -> bool; fn damage(&self) -> bool; fn set_damage(&mut self, flag: bool); fn damage_type(&self) -> Damage; fn set_damage_type(&mut self, mask: Damage); fn clear_damage(&mut self); fn set_trigger(&mut self, trigger: CallbackTrigger); fn trigger(&self) -> CallbackTrigger; fn as_window(&self) -> Option<Box<dyn WindowExt>>; fn as_group(&self) -> Option<Box<dyn GroupExt>>; unsafe fn user_data(&self) -> Option<Box<dyn FnMut()>>; unsafe fn into_widget<W: WidgetBase>(&self) -> W
where
Self: Sized; fn visible(&self) -> bool; fn visible_r(&self) -> bool;
Expand description
Defines the methods implemented by all widgets
Required methods
Sets the widget’s label.
labels support special symbols preceded by an @
sign.
and for the associated formatting.
unsafe fn as_widget_ptr(&self) -> *mut Fl_Widget
[src]
unsafe fn as_widget_ptr(&self) -> *mut Fl_Widget
[src]transforms a widget to a base Fl_Widget
, for internal use
Safety
Can return multiple mutable pointers to the same widget
Initialize to position x, y, (should only be called on initialization)
Initialilze to dimensions width and height, (should only be called on initialization)
fn with_label(self, title: &str) -> Self where
Self: Sized,
[src]
fn with_label(self, title: &str) -> Self where
Self: Sized,
[src]Initialize with label/title, (should only be called on initialization)
fn with_align(self, align: Align) -> Self where
Self: Sized,
[src]
fn with_align(self, align: Align) -> Self where
Self: Sized,
[src]Sets the initial alignment of the widget, (should only be called on initialization)
Positions the widget below w, the size of w should be known
Positions the widget above w, the size of w should be known
Positions the widget to the right of w, the size of w should be known
Positions the widget to the left of w, the size of w should be known
Positions the widget to the center of w, the size of w should be known
fn center_of_parent(self) -> Self where
Self: Sized,
[src]
fn center_of_parent(self) -> Self where
Self: Sized,
[src]Positions the widget to the center of its parent
Takes the size of w, the size of w should be known
fn size_of_parent(self) -> Self where
Self: Sized,
[src]
fn size_of_parent(self) -> Self where
Self: Sized,
[src]Takes the size of the parent group or window
Checks whether the self widget is inside another widget
fn get_type<T: WidgetType>(&self) -> T where
Self: Sized,
[src]
fn get_type<T: WidgetType>(&self) -> T where
Self: Sized,
[src]Returns the widget type when applicable
fn set_type<T: WidgetType>(&mut self, typ: T) where
Self: Sized,
[src]
fn set_type<T: WidgetType>(&mut self, typ: T) where
Self: Sized,
[src]Sets the widget type
Sets the image of the widget
Gets the image associated with the widget
fn set_deimage<I: ImageExt>(&mut self, image: Option<I>) where
Self: Sized,
[src]
fn set_deimage<I: ImageExt>(&mut self, image: Option<I>) where
Self: Sized,
[src]Sets the image of the widget
Gets the image associated with the widget
fn set_callback<F: FnMut(&mut Self) + 'static>(&mut self, cb: F) where
Self: Sized,
[src]
fn set_callback<F: FnMut(&mut Self) + 'static>(&mut self, cb: F) where
Self: Sized,
[src]Sets the callback when the widget is triggered (clicks for example) takes the widget as a closure argument
Emits a message on callback using a sender
fn deactivate(&mut self)
[src]
fn deactivate(&mut self)
[src]Deactivates the widget
fn redraw_label(&mut self)
[src]
fn redraw_label(&mut self)
[src]Redraws the label of the widget
Resizes and/or moves the widget, takes x, y, width and height
fn set_tooltip(&mut self, txt: &str)
[src]
fn set_tooltip(&mut self, txt: &str)
[src]Sets the tooltip text
fn label_color(&self) -> Color
[src]
fn label_color(&self) -> Color
[src]Returns the widget label’s color
fn set_label_color(&mut self, color: Color)
[src]
fn set_label_color(&mut self, color: Color)
[src]Sets the widget label’s color
fn label_font(&self) -> Font
[src]
fn label_font(&self) -> Font
[src]Returns the widget label’s font
fn set_label_font(&mut self, font: Font)
[src]
fn set_label_font(&mut self, font: Font)
[src]Sets the widget label’s font
fn label_size(&self) -> i32
[src]
fn label_size(&self) -> i32
[src]Returns the widget label’s size
fn set_label_size(&mut self, sz: i32)
[src]
fn set_label_size(&mut self, sz: i32)
[src]Sets the widget label’s size
fn label_type(&self) -> LabelType
[src]
fn label_type(&self) -> LabelType
[src]Returns the widget label’s type
fn set_label_type(&mut self, typ: LabelType)
[src]
fn set_label_type(&mut self, typ: LabelType)
[src]Sets the widget label’s type
fn set_changed(&mut self)
[src]
fn set_changed(&mut self)
[src]Mark the widget as changed
fn clear_changed(&mut self)
[src]
fn clear_changed(&mut self)
[src]Clears the changed status of the widget
fn selection_color(&mut self) -> Color
[src]
fn selection_color(&mut self) -> Color
[src]Gets the selection color of the widget
fn set_selection_color(&mut self, color: Color)
[src]
fn set_selection_color(&mut self, color: Color)
[src]Sets the selection color of the widget
fn do_callback(&mut self)
[src]
fn do_callback(&mut self)
[src]Runs the already registered callback
fn top_window(&self) -> Option<Box<dyn WindowExt>>
[src]
fn top_window(&self) -> Option<Box<dyn WindowExt>>
[src]Returns the topmost window holding the widget
fn takes_events(&self) -> bool
[src]
fn takes_events(&self) -> bool
[src]Checks whether a widget is capable of taking events
fn take_focus(&mut self) -> Result<(), FltkError>
[src]
fn take_focus(&mut self) -> Result<(), FltkError>
[src]fn set_visible_focus(&mut self)
[src]
fn set_visible_focus(&mut self)
[src]Set the widget to have visible focus
fn clear_visible_focus(&mut self)
[src]
fn clear_visible_focus(&mut self)
[src]Clear visible focus
fn visible_focus(&mut self, v: bool)
[src]
fn visible_focus(&mut self, v: bool)
[src]Set the visible focus using a flag
fn has_visible_focus(&mut self) -> bool
[src]
fn has_visible_focus(&mut self) -> bool
[src]Return whether the widget has visible focus
fn was_deleted(&self) -> bool
[src]
fn was_deleted(&self) -> bool
[src]Check if a widget was deleted
fn set_damage(&mut self, flag: bool)
[src]
fn set_damage(&mut self, flag: bool)
[src]Signal the widget as damaged and it should be redrawn in the next event loop cycle
fn damage_type(&self) -> Damage
[src]
fn damage_type(&self) -> Damage
[src]Return the damage mask
fn set_damage_type(&mut self, mask: Damage)
[src]
fn set_damage_type(&mut self, mask: Damage)
[src]Signal the type of damage a widget received
fn clear_damage(&mut self)
[src]
fn clear_damage(&mut self)
[src]Clear the damaged flag
fn set_trigger(&mut self, trigger: CallbackTrigger)
[src]
fn set_trigger(&mut self, trigger: CallbackTrigger)
[src]Sets the default callback trigger for a widget
fn trigger(&self) -> CallbackTrigger
[src]
fn trigger(&self) -> CallbackTrigger
[src]Return the callback trigger
Return the widget as a window if it’s a window
Return the widget as a group widget if it’s a group widget
INTERNAL: Retakes ownership of the user callback data
Safety
Can return multiple mutable references to the user_data
unsafe fn into_widget<W: WidgetBase>(&self) -> W where
Self: Sized,
[src]
unsafe fn into_widget<W: WidgetBase>(&self) -> W where
Self: Sized,
[src]Upcast a WidgetExt
to a Widget
Safety
Allows for potentially unsafe casts between incompatible widget types