Bases: gi.repository.Gtk.Toolbar
The Activity toolbar with the Journal entry title and sharing button
Bases: sugar3.graphics.toolbutton.ToolButton
Bases: gi.repository.Gtk.Toolbar
Provides the standard edit toolbar for Activities.
This class only provides the ‘edit’ buttons in a standard layout, your activity will need to either hide buttons which make no sense for your Activity, or you need to connect the button events to your own callbacks:
## Example from Read.activity: # Create the edit toolbar: self._edit_toolbar = EditToolbar(self._view) # Hide undo and redo, they’re not needed self._edit_toolbar.undo.props.visible = False self._edit_toolbar.redo.props.visible = False # Hide the separator too: self._edit_toolbar.separator.props.visible = False
# As long as nothing is selected, copy needs to be insensitive: self._edit_toolbar.copy.set_sensitive(False) # When the user clicks the button, call _edit_toolbar_copy_cb() self._edit_toolbar.copy.connect(‘clicked’, self._edit_toolbar_copy_cb)
# Add the edit toolbar: toolbox.add_toolbar(_(‘Edit’), self._edit_toolbar) # And make it visible: self._edit_toolbar.show()
Bases: gi.repository.Gtk.ToolItem