Struct fltk::menu::SysMenuBar[][src]

pub struct SysMenuBar { /* fields omitted */ }
Expand description

Creates a macOS system menu bar on macOS and a normal menu bar on other systems

Trait Implementations

impl Clone for SysMenuBar[src]

fn clone(&self) -> SysMenuBar[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for SysMenuBar[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl Default for SysMenuBar[src]

fn default() -> Self[src]

Returns the “default value” for a type. Read more

impl IntoIterator for SysMenuBar[src]

type Item = MenuItem

The type of the elements being iterated over.

type IntoIter = IntoIter<Self::Item>

Which kind of iterator are we turning this into?

fn into_iter(self) -> Self::IntoIter[src]

Creates an iterator from a value. Read more

impl MenuExt for SysMenuBar[src]

fn add<F: FnMut(&mut Self) + 'static>(
    &mut self,
    name: &str,
    shortcut: Shortcut,
    flag: MenuFlag,
    cb: F
)
[src]

Add a menu item along with its callback. The characters “&”, “/”, “\”, and “_” (underscore) are treated as special characters in the label string. The “&” character specifies that the following character is an accelerator and will be underlined. The “\” character is used to escape the next character in the string. Labels starting with the “_” (underscore) character cause a divider to be placed after that menu item. Takes the menu item as a closure argument Read more

fn insert<F: FnMut(&mut Self) + 'static>(
    &mut self,
    idx: i32,
    name: &str,
    shortcut: Shortcut,
    flag: MenuFlag,
    cb: F
)
[src]

Inserts a menu item at an index along with its callback. The characters “&”, “/”, “\”, and “_” (underscore) are treated as special characters in the label string. The “&” character specifies that the following character is an accelerator and will be underlined. The “\” character is used to escape the next character in the string. Labels starting with the “_” (underscore) character cause a divider to be placed after that menu item. Takes the menu item as a closure argument Read more

fn add_emit<T: 'static + Clone + Send + Sync>(
    &mut self,
    label: &str,
    shortcut: Shortcut,
    flag: MenuFlag,
    sender: Sender<T>,
    msg: T
)
[src]

Add a menu item along with an emit (sender and message). The characters “&”, “/”, “\”, and “_” (underscore) are treated as special characters in the label string. The “&” character specifies that the following character is an accelerator and will be underlined. The “\” character is used to escape the next character in the string. Labels starting with the “_” (underscore) character cause a divider to be placed after that menu item. Read more

fn insert_emit<T: 'static + Clone + Send + Sync>(
    &mut self,
    idx: i32,
    label: &str,
    shortcut: Shortcut,
    flag: MenuFlag,
    sender: Sender<T>,
    msg: T
)
[src]

Inserts a menu item along with an emit (sender and message). The characters “&”, “/”, “\”, and “_” (underscore) are treated as special characters in the label string. The “&” character specifies that the following character is an accelerator and will be underlined. The “\” character is used to escape the next character in the string. Labels starting with the “_” (underscore) character cause a divider to be placed after that menu item. Read more

fn remove(&mut self, idx: i32)[src]

Remove a menu item by index

fn find_item(&self, name: &str) -> Option<MenuItem>[src]

Get a menu item by name

fn set_item(&mut self, item: &MenuItem) -> bool[src]

Set selected item

fn find_index(&self, label: &str) -> i32[src]

Find an item’s index by its label

fn text_font(&self) -> Font[src]

Return the text font

fn set_text_font(&mut self, c: Font)[src]

Sets the text font

fn text_size(&self) -> i32[src]

Return the text size

fn set_text_size(&mut self, c: i32)[src]

Sets the text size

fn text_color(&self) -> Color[src]

Return the text color

fn set_text_color(&mut self, c: Color)[src]

Sets the text color

fn add_choice(&mut self, text: &str)[src]

Adds a simple text option to the Choice and MenuButton widgets. The characters “&”, “/”, “\”, “|”, and “_” (underscore) are treated as special characters in the label string. The “&” character specifies that the following character is an accelerator and will be underlined. The “\” character is used to escape the next character in the string. Labels starting with the “_” (underscore) character cause a divider to be placed after that menu item. Read more

fn choice(&self) -> Option<String>[src]

Gets the user choice from the Choice and MenuButton widgets

fn value(&self) -> i32[src]

Get index into menu of the last item chosen, returns -1 if no item was chosen

fn set_value(&mut self, v: i32) -> bool[src]

Set index into menu of the last item chosen,return true if the new value is different than the old one

fn clear(&mut self)[src]

Clears the items in a menu, effectively deleting them.

unsafe fn unsafe_clear(&mut self)[src]

Clears the items in a menu, effectively deleting them, and recursively force-cleans capturing callbacks Read more

fn clear_submenu(&mut self, idx: i32) -> Result<(), FltkError>[src]

Clears a submenu by index, failure return FltkErrorKind::FailedOperation Read more

unsafe fn unsafe_clear_submenu(&mut self, idx: i32) -> Result<(), FltkError>[src]

Clears a submenu by index, failure return FltkErrorKind::FailedOperation. Also recursively force-cleans capturing callbacks Read more

fn size(&self) -> i32[src]

Get the size of the menu widget

fn text(&self, idx: i32) -> Option<String>[src]

Get the text label of the menu item at index idx

fn at(&self, idx: i32) -> Option<MenuItem>[src]

Get the menu item at an index

fn mode(&self, idx: i32) -> MenuFlag[src]

Set the mode of a menu item by index and flag

fn set_mode(&mut self, idx: i32, flag: MenuFlag)[src]

Get the mode of a menu item

fn end(&mut self)[src]

End the menu

fn set_down_frame(&mut self, f: FrameType)[src]

Set the down_box of the widget

fn down_frame(&self) -> FrameType[src]

Get the down frame type of the widget

fn global(&mut self)[src]

Make a menu globally accessible from any window

impl WidgetBase for SysMenuBar[src]

fn new<T: Into<Option<&'static str>>>(
    x: i32,
    y: i32,
    width: i32,
    height: i32,
    title: T
) -> SysMenuBar
[src]

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

fn delete(wid: Self)[src]

Deletes widgets and their children.

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

transforms a widget pointer to a Widget, for internal use Read more

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

Get a widget from base widget Read more

fn handle<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 should return true, unhandled events should return false. takes the widget as a closure argument Read more

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

Set a custom draw method. takes the widget as a closure argument. macOS requires that WidgetBase::draw actually calls drawing functions Read more

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

INTERNAL: Retrieve the draw data Read more

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

INTERNAL: Retrieve the handle data Read more

impl WidgetExt for SysMenuBar[src]

fn set_pos(&mut self, x: i32, y: i32)[src]

Set to position x, y

fn set_size(&mut self, width: i32, height: i32)[src]

Set to dimensions width and height

fn set_label(&mut self, title: &str)[src]

Sets the widget’s label. labels support special symbols preceded by an @ sign. and for the associated formatting. Read more

fn redraw(&mut self)[src]

Redraws a widget, necessary for resizing and changing positions

fn show(&mut self)[src]

Shows the widget

fn hide(&mut self)[src]

Hides the widget

fn x(&self) -> i32[src]

Returns the x coordinate of the widget

fn y(&self) -> i32[src]

Returns the y coordinate of the widget

fn width(&self) -> i32[src]

Returns the width of the widget

fn height(&self) -> i32[src]

Returns the height of the widget

fn w(&self) -> i32[src]

Returns the width of the widget

fn h(&self) -> i32[src]

Returns the height of the widget

fn label(&self) -> String[src]

Returns the label of the widget

fn measure_label(&self) -> (i32, i32)[src]

Measures the label’s width and height

unsafe fn as_widget_ptr(&self) -> *mut Fl_Widget[src]

transforms a widget to a base Fl_Widget, for internal use Read more

fn activate(&mut self)[src]

Activates the widget

fn deactivate(&mut self)[src]

Deactivates the widget

fn redraw_label(&mut self)[src]

Redraws the label of the widget

fn resize(&mut self, x: i32, y: i32, width: i32, height: i32)[src]

Resizes and/or moves the widget, takes x, y, width and height

fn tooltip(&self) -> Option<String>[src]

Returns the tooltip text

fn set_tooltip(&mut self, txt: &str)[src]

Sets the tooltip text

fn color(&self) -> Color[src]

Returns the widget color

fn set_color(&mut self, color: Color)[src]

Sets the widget’s color

fn label_color(&self) -> Color[src]

Returns the widget label’s color

fn set_label_color(&mut self, color: Color)[src]

Sets the widget label’s color

fn label_font(&self) -> Font[src]

Returns the widget label’s font

fn set_label_font(&mut self, font: Font)[src]

Sets the widget label’s font

fn label_size(&self) -> i32[src]

Returns the widget label’s size

fn set_label_size(&mut self, sz: i32)[src]

Sets the widget label’s size

fn label_type(&self) -> LabelType[src]

Returns the widget label’s type

fn set_label_type(&mut self, typ: LabelType)[src]

Sets the widget label’s type

fn frame(&self) -> FrameType[src]

Returns the widget’s frame type

fn set_frame(&mut self, typ: FrameType)[src]

Sets the widget’s frame type

fn changed(&self) -> bool[src]

Returns whether the widget was changed

fn set_changed(&mut self)[src]

Mark the widget as changed

fn clear_changed(&mut self)[src]

Clears the changed status of the widget

fn align(&self) -> Align[src]

Returns the alignment of the widget

fn set_align(&mut self, align: Align)[src]

Sets the alignment of the widget

fn set_trigger(&mut self, trigger: CallbackTrigger)[src]

Sets the default callback trigger for a widget

fn trigger(&self) -> CallbackTrigger[src]

Return the callback trigger

fn parent(&self) -> Option<Box<dyn GroupExt>>[src]

Returns the parent of the widget

fn selection_color(&mut self) -> Color[src]

Gets the selection color of the widget

fn set_selection_color(&mut self, color: Color)[src]

Sets the selection color of the widget

fn do_callback(&mut self)[src]

Runs the already registered callback

fn window(&self) -> Option<Box<dyn WindowExt>>[src]

Returns the direct window holding the widget

fn top_window(&self) -> Option<Box<dyn WindowExt>>[src]

Returns the topmost window holding the widget

fn takes_events(&self) -> bool[src]

Checks whether a widget is capable of taking events

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

INTERNAL: Retakes ownership of the user callback data Read more

fn take_focus(&mut self) -> Result<(), FltkError>[src]

Make the widget take focus Read more

fn set_visible_focus(&mut self)[src]

Set the widget to have visible focus

fn clear_visible_focus(&mut self)[src]

Clear visible focus

fn visible_focus(&mut self, v: bool)[src]

Set the visible focus using a flag

fn has_visible_focus(&mut self) -> bool[src]

Return whether the widget has visible focus

fn was_deleted(&self) -> bool[src]

Check if a widget was deleted

fn damage(&self) -> bool[src]

Return whether the widget was damaged

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]

Return the damage mask

fn set_damage_type(&mut self, mask: Damage)[src]

Signal the type of damage a widget received

fn clear_damage(&mut self)[src]

Clear the damaged flag

fn as_window(&self) -> Option<Box<dyn WindowExt>>[src]

Return the widget as a window if it’s a window

fn as_group(&self) -> Option<Box<dyn GroupExt>>[src]

Return the widget as a group widget if it’s a group widget

fn below_of<W: WidgetExt>(self, w: &W, padding: i32) -> Self[src]

Positions the widget below w, the size of w should be known

fn above_of<W: WidgetExt>(self, w: &W, padding: i32) -> Self[src]

Positions the widget above w, the size of w should be known

fn right_of<W: WidgetExt>(self, w: &W, padding: i32) -> Self[src]

Positions the widget to the right of w, the size of w should be known

fn left_of<W: WidgetExt>(self, w: &W, padding: i32) -> Self[src]

Positions the widget to the left of w, the size of w should be known

fn center_of<W: WidgetExt>(self, w: &W) -> Self[src]

Positions the widget to the center of w, the size of w should be known

fn center_of_parent(self) -> Self[src]

Positions the widget to the center of its parent

fn size_of<W: WidgetExt>(self, w: &W) -> Self[src]

Takes the size of w, the size of w should be known

fn size_of_parent(self) -> Self[src]

Takes the size of the parent group or window

fn inside<W: WidgetExt>(&self, wid: &W) -> bool[src]

Checks whether the self widget is inside another widget

fn with_pos(self, x: i32, y: i32) -> Self[src]

Initialize to position x, y, (should only be called on initialization)

fn with_size(self, width: i32, height: i32) -> Self[src]

Initialilze to dimensions width and height, (should only be called on initialization)

fn with_label(self, title: &str) -> Self[src]

Initialize with label/title, (should only be called on initialization)

fn with_align(self, align: Align) -> Self[src]

Sets the initial alignment of the widget, (should only be called on initialization)

fn get_type<T: WidgetType>(&self) -> T[src]

Returns the widget type when applicable

fn set_type<T: WidgetType>(&mut self, typ: T)[src]

Sets the widget type

fn set_image<I: ImageExt>(&mut self, image: Option<I>)[src]

Sets the image of the widget

fn image(&self) -> Option<Box<dyn ImageExt>>[src]

Gets the image associated with the widget

fn set_deimage<I: ImageExt>(&mut self, image: Option<I>)[src]

Sets the image of the widget

fn deimage(&self) -> Option<Box<dyn ImageExt>>[src]

Gets the image associated with the widget

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

Sets the callback when the widget is triggered (clicks for example) takes the widget as a closure argument Read more

fn emit<T: 'static + Clone + Send + Sync>(&mut self, sender: Sender<T>, msg: T)[src]

Emits a message on callback using a sender

unsafe fn into_widget<W: WidgetBase>(&self) -> W where
    Self: Sized
[src]

Upcast a WidgetExt to a Widget Read more

fn visible(&self) -> bool[src]

Returns whether a widget is visible

fn visible_r(&self) -> bool[src]

Returns whether a widget or any of its parents are visible (recursively)

impl Send for SysMenuBar[src]

impl Sync for SysMenuBar[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.