[][src]Trait fltk::prelude::WidgetBase

pub unsafe trait WidgetBase: WidgetExt {
    pub fn new(x: i32, y: i32, width: i32, height: i32, title: &str) -> Self;
pub fn default() -> Self;
pub unsafe fn from_widget_ptr(ptr: *mut Fl_Widget) -> Self;
pub unsafe fn from_widget<W: WidgetExt>(w: W) -> Self;
pub fn handle<F: FnMut(Event) -> bool + 'static>(&mut self, cb: F);
pub fn handle2<F: FnMut(&mut Self, Event) -> bool + 'static>(
        &mut self,
        cb: F
    );
pub fn draw<F: FnMut() + 'static>(&mut self, cb: F);
pub fn draw2<F: FnMut(&mut Self) + 'static>(&mut self, cb: F);
pub unsafe fn draw_data(&mut self) -> Option<Box<dyn FnMut()>>;
pub unsafe fn handle_data(
        &mut self
    ) -> Option<Box<dyn FnMut(Event) -> bool>>; }

Defines the extended methods implemented by all widgets

Required methods

pub fn new(x: i32, y: i32, width: i32, height: i32, title: &str) -> Self[src]

Creates a new widget, takes an x, y coordinates, as well as a width and height, plus a title

Arguments

  • x - The x coordinate in the screen
  • y - The y coordinate in the screen
  • width - The width of the widget
  • heigth - The height of the widget
  • title - The title or label of the widget

pub fn default() -> Self[src]

Creates a default and zero initialized widget

pub unsafe fn from_widget_ptr(ptr: *mut Fl_Widget) -> Self[src]

transforms a widget pointer to a Widget, for internal use

Safety

The pointer must be valid

pub unsafe fn from_widget<W: WidgetExt>(w: W) -> Self[src]

Get a widget from base widget

Safety

The underlying object must be valid

pub fn handle<F: FnMut(Event) -> bool + 'static>(&mut self, cb: F)[src]

Set a custom handler, where events are managed manually, akin to Fl_Widget::handle(int) Handled or ignored events shoult return true, unhandled events should return false

pub fn handle2<F: FnMut(&mut Self, Event) -> bool + 'static>(&mut self, cb: F)[src]

Set a custom handler, where events are managed manually, akin to Fl_Widget::handle(int) Handled or ignored events shoult return true, unhandled events should return false takes the widget as a closure argument

pub fn draw<F: FnMut() + 'static>(&mut self, cb: F)[src]

Set a custom draw method

pub fn draw2<F: FnMut(&mut Self) + 'static>(&mut self, cb: F)[src]

Set a custom draw method takes the widget as a closure argument

pub unsafe fn draw_data(&mut self) -> Option<Box<dyn FnMut()>>[src]

INTERNAL: Retrieve the draw data

Safety

Can return multiple mutable references to the draw_data

pub unsafe fn handle_data(&mut self) -> Option<Box<dyn FnMut(Event) -> bool>>[src]

INTERNAL: Retrieve the handle data

Safety

Can return multiple mutable references to the handle_data

Loading content...

Implementors

impl WidgetBase for Browser[src]

impl WidgetBase for FileBrowser[src]

impl WidgetBase for HoldBrowser[src]

impl WidgetBase for MultiBrowser[src]

impl WidgetBase for SelectBrowser[src]

impl WidgetBase for Button[src]

impl WidgetBase for CheckButton[src]

impl WidgetBase for LightButton[src]

impl WidgetBase for RadioButton[src]

impl WidgetBase for RadioLightButton[src]

impl WidgetBase for RadioRoundButton[src]

impl WidgetBase for RepeatButton[src]

impl WidgetBase for ReturnButton[src]

impl WidgetBase for RoundButton[src]

impl WidgetBase for ToggleButton[src]

impl WidgetBase for Frame[src]

impl WidgetBase for ColorChooser[src]

impl WidgetBase for Group[src]

impl WidgetBase for Pack[src]

impl WidgetBase for Scroll[src]

impl WidgetBase for Tabs[src]

impl WidgetBase for Tile[src]

impl WidgetBase for Wizard[src]

impl WidgetBase for FileInput[src]

impl WidgetBase for FloatInput[src]

impl WidgetBase for Input[src]

impl WidgetBase for IntInput[src]

impl WidgetBase for MultilineInput[src]

impl WidgetBase for SecretInput[src]

impl WidgetBase for Choice[src]

impl WidgetBase for MenuBar[src]

impl WidgetBase for MenuButton[src]

impl WidgetBase for SysMenuBar[src]

impl WidgetBase for Chart[src]

impl WidgetBase for Clock[src]

impl WidgetBase for Progress[src]

impl WidgetBase for Spinner[src]

impl WidgetBase for MultilineOutput[src]

impl WidgetBase for Output[src]

impl WidgetBase for Table[src]

impl WidgetBase for TableRow[src]

impl WidgetBase for SimpleTerminal[src]

impl WidgetBase for TextDisplay[src]

impl WidgetBase for TextEditor[src]

impl WidgetBase for Tree[src]

impl WidgetBase for Adjuster[src]

impl WidgetBase for Counter[src]

impl WidgetBase for Dial[src]

impl WidgetBase for FillDial[src]

impl WidgetBase for FillSlider[src]

impl WidgetBase for HorFillSlider[src]

impl WidgetBase for HorNiceSlider[src]

impl WidgetBase for HorSlider[src]

impl WidgetBase for HorValueSlider[src]

impl WidgetBase for LineDial[src]

impl WidgetBase for NiceSlider[src]

impl WidgetBase for Roller[src]

impl WidgetBase for Scrollbar[src]

impl WidgetBase for Slider[src]

impl WidgetBase for ValueInput[src]

impl WidgetBase for ValueOutput[src]

impl WidgetBase for ValueSlider[src]

impl WidgetBase for Widget[src]

impl WidgetBase for DoubleWindow[src]

impl WidgetBase for MenuWindow[src]

impl WidgetBase for SingleWindow[src]

Loading content...