Class: Gtk::Toolbar

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Instance Method Summary collapse

Instance Method Details

#get_drop_index(x, y) ⇒ Integer

Returns the position corresponding to the indicated point on toolbar. 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 toolbar coordinates.

Parameters:

  • x (Integer)

    x coordinate of a point on the toolbar

  • y (Integer)

    y coordinate of a point on the toolbar

Returns:

  • (Integer)

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

#get_item_index(item) ⇒ Integer

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

Parameters:

  • item (Gtk::ToolItem)

    a Gtk::ToolItem that is a child of toolbar

Returns:

  • (Integer)

    the position of item on the toolbar.

#get_nth_item(n) ⇒ Gtk::ToolItem

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

Parameters:

  • n (Integer)

    A position on the toolbar

Returns:

  • (Gtk::ToolItem)

    The n’th Gtk::ToolItem on toolbar, or nil if there isn’t an n’th item.

#icon_sizeGtk::IconSize

The size of the icons in a toolbar is normally determined by the toolbar-icon-size setting. When this property is set, it overrides the setting.

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

Returns:

#icon_size=(icon_size) ⇒ Gtk::IconSize

The size of the icons in a toolbar is normally determined by the toolbar-icon-size setting. When this property is set, it overrides the setting.

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

Parameters:

Returns:

#icon_size_set=(icon_size_set) ⇒ TrueClass

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

Parameters:

  • icon_size_set (TrueClass)

Returns:

  • (TrueClass)

    icon-size-set

  • (TrueClass)

    icon-size-set

#icon_size_set?TrueClass

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

Returns:

  • (TrueClass)

    icon-size-set

#insert(item, pos) ⇒ nil

Insert a Gtk::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.

Parameters:

  • item (Gtk::ToolItem)

    a Gtk::ToolItem

  • pos (Integer)

    the position of the new item

Returns:

  • (nil)

#n_itemsInteger

Returns the number of items on the toolbar.

Returns:

  • (Integer)

    the number of items on the toolbar

#newGtk::Widget

Creates a new toolbar.

Returns:

#relief_styleGtk::ReliefStyle

Returns the relief style of buttons on toolbar. See gtk_button_set_relief().

Returns:

#set_drop_highlight_item(tool_item, index_) ⇒ nil

Highlights toolbar to give an idea of what it would look like if item was added to toolbar at the position indicated by index_. If item is nil, 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.

Parameters:

  • tool_item (Gtk::ToolItem)

    a Gtk::ToolItem, or nil to turn of highlighting

  • index_ (Integer)

    a position on toolbar

Returns:

  • (nil)

#show_arrowTrueClass

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

Returns:

  • (TrueClass)

    true if the toolbar has an overflow menu.

#show_arrow=(show_arrow) ⇒ TrueClass

Parameters:

  • show_arrow (TrueClass)

Returns:

  • (TrueClass)

    show-arrow

  • (TrueClass)

    show-arrow

#show_arrow?TrueClass

Returns show-arrow.

Returns:

  • (TrueClass)

    show-arrow

#styleGtk::ToolbarStyle

Retrieves whether the toolbar has text, icons, or both . See gtk_toolbar_set_style().

Returns:

#style=(style) ⇒ nil

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

Parameters:

Returns:

  • (nil)

#toolbar_styleGtk::ToolbarStyle

Returns toolbar-style.

Returns:

#toolbar_style=(toolbar_style) ⇒ Gtk::ToolbarStyle

Parameters:

Returns:

#unset_icon_sizenil

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

Returns:

  • (nil)

#unset_stylenil

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

Returns:

  • (nil)