sugar3.graphics.toggletoolbutton module

STABLE.

class sugar3.graphics.toggletoolbutton.ToggleToolButton(icon_name=None)

Bases: gi.repository.Gtk.ToggleToolButton

UI for toggletoolbutton. A ToggleToolButton is a ToolItem that contains a toggle button, having an icon, a tooltip palette, and an accelerator. Use ToggleToolButton.new() to create a new ToggleToolButton.

Parameters
  • accelerator (string) – keyboard shortcut to be used to

  • button. (hovers over toggle) –

  • here (Find about format) –

  • https – //developer.gnome.org/gtk3/stable/gtk3-Keyboard-Accelerators.html#gtk-accelerator-parse

  • tooltip (string) – tooltip to be displayed when user

  • button.

Keyword Arguments

icon_name (string) – name of themed icon which is to be used.

accelerator

Returns above accelerator string.

create_palette()
do_clicked()

Implementation method for hiding the tooltip when the toggle button is clicked

do_draw(cr)

Implementation method for drawing the toogle tool button

do_get_property(pspec)
do_set_property(pspec, value)
get_accelerator()

Returns above accelerator string.

get_icon_name()

The get_icon_name() method returns the value of the icon_name property that contains the name of a themed icon or None.

get_palette()
get_palette_invoker()
icon_name

The get_icon_name() method returns the value of the icon_name property that contains the name of a themed icon or None.

property palette
palette_invoker
set_accelerator(accelerator)

Sets keyboard shortcut that activates this button.

Parameters
  • accelerator (string) – accelerator to be set. Should be in

  • <modifier>Letter (form) –

  • here (Find about format) –

  • https – //developer.gnome.org/gtk3/stable/gtk3-Keyboard-Accelerators.html#gtk-accelerator-parse

Example

set_accelerator(self, ‘accel’)

set_icon_name(icon_name)

Sets the icon for the tool button from a named themed icon. If it is none then no icon will be shown.

Parameters
  • icon_name (string) – The name for a themed icon.

  • too. (It can be set as 'None') –

Example

set_icon_name(‘view-radial’)

set_palette(palette)
set_palette_invoker(palette_invoker)
set_tooltip(text)

Sets the tooltip of the toogle tool button. Displays when user hovers over the button with cursor.

Parameters

tooltip (string) – tooltip to be added to the button

sugar3.graphics.toggletoolbutton.setup_accelerator(tool_button)