Gtk.Toolbar

const Gtk = imports.gi.Gtk;

let toolbar = new Gtk.Toolbar({
    icon_size: value,
    icon_size_set: value,
    show_arrow: value,
    toolbar_style: value,
});
  

A toolbar is created with a call to Gtk.new.

A toolbar can contain instances of a subclass of Gtk.ToolItem. To add a Gtk.ToolItem to the a toolbar, use Gtk.insert. To remove an item from the toolbar use Gtk.Container.prototype.remove. To add a button to the toolbar, add an instance of Gtk.ToolButton.

Toolbar items can be visually grouped by adding instances of Gtk.SeparatorToolItem to the toolbar. If the GtkToolbar child property "expand" is #TRUE and the property Gtk.SeparatorToolItem:draw is set to #FALSE, the effect is to force all following items to the end of the toolbar.

Creating a context menu for the toolbar can be done by connecting to the Gtk.popup-context-menu signal.

Hierarchy

  • GObject.Object
    • GObject.InitiallyUnowned
      • Gtk.Widget
        • Gtk.Container
          • Gtk.Toolbar