[][src]Trait gtk::prelude::ToolButtonExt

pub trait ToolButtonExt: 'static {
    fn get_icon_name(&self) -> Option<GString>;
fn get_icon_widget(&self) -> Option<Widget>;
fn get_label(&self) -> Option<GString>;
fn get_label_widget(&self) -> Option<Widget>;
fn get_use_underline(&self) -> bool;
fn set_icon_name(&self, icon_name: Option<&str>);
fn set_icon_widget<P: IsA<Widget>>(&self, icon_widget: Option<&P>);
fn set_label(&self, label: Option<&str>);
fn set_label_widget<P: IsA<Widget>>(&self, label_widget: Option<&P>);
fn set_use_underline(&self, use_underline: bool);
fn connect_clicked<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
fn emit_clicked(&self);
fn connect_property_icon_name_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_icon_widget_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_label_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_label_widget_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_use_underline_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; }

Trait containing all ToolButton methods.

Implementors

MenuToolButton, ToggleToolButton, ToolButton

Required methods

fn get_icon_name(&self) -> Option<GString>

Returns the name of the themed icon for the tool button, see ToolButtonExt::set_icon_name.

Returns

the icon name or None if the tool button has no themed icon

fn get_icon_widget(&self) -> Option<Widget>

Return the widget used as icon widget on self. See ToolButtonExt::set_icon_widget.

Returns

The widget used as icon on self, or None.

fn get_label(&self) -> Option<GString>

Returns the label used by the tool button, or None if the tool button doesn’t have a label. or uses a the label from a stock item. The returned string is owned by GTK+, and must not be modified or freed.

Returns

The label, or None

fn get_label_widget(&self) -> Option<Widget>

Returns the widget used as label on self. See ToolButtonExt::set_label_widget.

Returns

The widget used as label on self, or None.

fn get_use_underline(&self) -> bool

Returns whether underscores in the label property are used as mnemonics on menu items on the overflow menu. See ToolButtonExt::set_use_underline.

Returns

true if underscores in the label property are used as mnemonics on menu items on the overflow menu.

fn set_icon_name(&self, icon_name: Option<&str>)

Sets the icon for the tool button from a named themed icon. See the docs for IconTheme for more details. The ToolButton:icon-name property only has an effect if not overridden by non-None ToolButton:label-widget, ToolButton:icon-widget and ToolButton:stock-id properties.

icon_name

the name of the themed icon

fn set_icon_widget<P: IsA<Widget>>(&self, icon_widget: Option<&P>)

Sets icon as the widget used as icon on self. If icon_widget is None the icon is determined by the ToolButton:stock-id property. If the ToolButton:stock-id property is also None, self will not have an icon.

icon_widget

the widget used as icon, or None

fn set_label(&self, label: Option<&str>)

Sets label as the label used for the tool button. The ToolButton:label property only has an effect if not overridden by a non-None ToolButton:label-widget property. If both the ToolButton:label-widget and ToolButton:label properties are None, the label is determined by the ToolButton:stock-id property. If the ToolButton:stock-id property is also None, self will not have a label.

label

a string that will be used as label, or None.

fn set_label_widget<P: IsA<Widget>>(&self, label_widget: Option<&P>)

Sets label_widget as the widget that will be used as the label for self. If label_widget is None the ToolButton:label property is used as label. If ToolButton:label is also None, the label in the stock item determined by the ToolButton:stock-id property is used as label. If ToolButton:stock-id is also None, self does not have a label.

label_widget

the widget used as label, or None

fn set_use_underline(&self, use_underline: bool)

If set, an underline in the label property indicates that the next character should be used for the mnemonic accelerator key in the overflow menu. For example, if the label property is “_Open” and use_underline is true, the label on the tool button will be “Open” and the item on the overflow menu will have an underlined “O”.

Labels shown on tool buttons never have mnemonics on them; this property only affects the menu item on the overflow menu.

use_underline

whether the button label has the form “_Open”

fn connect_clicked<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

This signal is emitted when the tool button is clicked with the mouse or activated with the keyboard.

fn emit_clicked(&self)

fn connect_property_icon_name_notify<F: Fn(&Self) + 'static>(
    &self,
    f: F
) -> SignalHandlerId

fn connect_property_icon_widget_notify<F: Fn(&Self) + 'static>(
    &self,
    f: F
) -> SignalHandlerId

fn connect_property_label_notify<F: Fn(&Self) + 'static>(
    &self,
    f: F
) -> SignalHandlerId

fn connect_property_label_widget_notify<F: Fn(&Self) + 'static>(
    &self,
    f: F
) -> SignalHandlerId

fn connect_property_use_underline_notify<F: Fn(&Self) + 'static>(
    &self,
    f: F
) -> SignalHandlerId

Loading content...

Implementors

impl<O: IsA<ToolButton>> ToolButtonExt for O[src]

Loading content...