sugar3.graphics.toolbox module

A toolbox holds a group of toolbars in a list. One toolbar is displayed at a time. Toolbars are assigned an index and can be accessed using this index. Indices are generated in the order the toolbars are added.

class sugar3.graphics.toolbox.Toolbox

Bases: gi.repository.Gtk.VBox

Class to represent the toolbox of an activity. Groups a number of toolbars vertically, which can be accessed using their indices. The current toolbar is the only one displayed.

Emits current-toolbar-changed signal when the current toolbar is changed. This signal takes the current page index as an argument.

add_toolbar(name, toolbar)

Adds a toolbar to this toolbox. Toolbar will be added to the end of this toolbox, and it’s index will be 1 greater than the previously added index (index will be 0 if it is the first toolbar added).

Parameters
  • name (string) – name of toolbar to be added

  • toolbar

  • toolbox (Gtk.Toolbar to be appended to this) –

property current_toolbar

Returns current toolbar.

get_current_toolbar()

Returns current toolbar.

remove_toolbar(index)

Removes toolbar at the index specified.

Parameters

index (int) – index of the toolbar to be removed

set_current_toolbar(index)

Sets the current toolbar to that of the index specified and displays it.

Parameters

index (int) – index of toolbar to be set as current toolbar