pub trait ToolbarExt: 'static {
Show 29 methods fn drop_index(&self, x: i32, y: i32) -> i32; fn item_index(&self, item: &impl IsA<ToolItem>) -> i32; fn n_items(&self) -> i32; fn nth_item(&self, n: i32) -> Option<ToolItem>; fn shows_arrow(&self) -> bool; fn insert(&self, item: &impl IsA<ToolItem>, pos: i32); fn set_drop_highlight_item(
        &self,
        tool_item: Option<&impl IsA<ToolItem>>,
        index_: i32
    ); fn set_icon_size(&self, icon_size: IconSize); fn set_show_arrow(&self, show_arrow: bool); fn set_style(&self, style: ToolbarStyle); fn unset_icon_size(&self); fn unset_style(&self); fn is_icon_size_set(&self) -> bool; fn set_icon_size_set(&self, icon_size_set: bool); fn toolbar_style(&self) -> ToolbarStyle; fn set_toolbar_style(&self, toolbar_style: ToolbarStyle); fn item_expands<T: IsA<Widget>>(&self, item: &T) -> bool; fn set_item_expand<T: IsA<Widget>>(&self, item: &T, expand: bool); fn item_is_homogeneous<T: IsA<Widget>>(&self, item: &T) -> bool; fn set_item_homogeneous<T: IsA<Widget>>(&self, item: &T, homogeneous: bool); fn connect_focus_home_or_end<F: Fn(&Self, bool) -> bool + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn emit_focus_home_or_end(&self, focus_home: bool) -> bool; fn connect_orientation_changed<F: Fn(&Self, Orientation) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_popup_context_menu<F: Fn(&Self, i32, i32, i32) -> Inhibit + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_style_changed<F: Fn(&Self, ToolbarStyle) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_icon_size_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_icon_size_set_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_show_arrow_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_toolbar_style_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
}
Expand description

Trait containing all Toolbar methods.

Implementors

Toolbar

Required Methods

Returns the position corresponding to the indicated point on self. This is useful when dragging items to the toolbar: this function returns the position a new item should be inserted.

x and y are in self coordinates.

x

x coordinate of a point on the toolbar

y

y coordinate of a point on the toolbar

Returns

The position corresponding to the point (x, y) on the toolbar.

Returns the position of item on the toolbar, starting from 0. It is an error if item is not a child of the toolbar.

item

a ToolItem that is a child of self

Returns

the position of item on the toolbar.

Returns the number of items on the toolbar.

Returns

the number of items on the toolbar

Returns the n’th item on self, or None if the toolbar does not contain an n’th item.

n

A position on the toolbar

Returns

The n’th ToolItem on self, or None if there isn’t an n’th item.

Returns whether the toolbar has an overflow menu. See set_show_arrow().

Returns

true if the toolbar has an overflow menu.

Insert a ToolItem into the toolbar at position pos. If pos is 0 the item is prepended to the start of the toolbar. If pos is negative, the item is appended to the end of the toolbar.

item

a ToolItem

pos

the position of the new item

Highlights self to give an idea of what it would look like if item was added to self at the position indicated by index_. If item is None, highlighting is turned off. In that case index_ is ignored.

The tool_item passed to this function must not be part of any widget hierarchy. When an item is set as drop highlight item it can not added to any widget hierarchy or used as highlight item for another toolbar.

tool_item

a ToolItem, or None to turn of highlighting

index_

a position on self

This function sets the size of stock icons in the toolbar. You can call it both before you add the icons and after they’ve been added. The size you set will override user preferences for the default icon size.

This should only be used for special-purpose toolbars, normal application toolbars should respect the user preferences for the size of icons.

icon_size

The IconSize that stock icons in the toolbar shall have.

Sets whether to show an overflow menu when self isn’t allocated enough size to show all of its items. If true, items which can’t fit in self, and which have a proxy menu item set by ToolItemExt::set_proxy_menu_item() or signal::ToolItem::create-menu-proxy, will be available in an overflow menu, which can be opened by an added arrow button. If false, self will request enough size to fit all of its child items without any overflow.

show_arrow

Whether to show an overflow menu

Alters the view of self to display either icons only, text only, or both.

style

the new style for self.

Unsets toolbar icon size set with set_icon_size(), so that user preferences will be used to determine the icon size.

Unsets a toolbar style set with set_style(), so that user preferences will be used to determine the toolbar style.

Is true if the icon-size property has been set.

Is true if the icon-size property has been set.

A keybinding signal used internally by GTK+. This signal can’t be used in application code

focus_home

true if the first item should be focused

Returns

true if the signal was handled, false if not

Emitted when the orientation of the toolbar changes.

orientation

the new Orientation of the toolbar

Emitted when the user right-clicks the toolbar or uses the keybinding to display a popup menu.

Application developers should handle this signal if they want to display a context menu on the toolbar. The context-menu should appear at the coordinates given by x and y. The mouse button number is given by the button parameter. If the menu was popped up using the keybaord, button is -1.

x

the x coordinate of the point where the menu should appear

y

the y coordinate of the point where the menu should appear

button

the mouse button the user pressed, or -1

Returns

return true if the signal was handled, false if not

Emitted when the style of the toolbar changes.

style

the new ToolbarStyle of the toolbar

Implementors