sugar4.graphics.toggletoolbutton

STABLE.

Classes

ToggleToolButton

UI for toggletoolbutton.

Module Contents

class sugar4.graphics.toggletoolbutton.ToggleToolButton(icon_name=None)[source]

Bases: gi.repository.Gtk.ToggleButton

UI for toggletoolbutton. A ToggleToolButton is a toggle button widget that can be used in toolbars, having an icon, a tooltip palette, and an accelerator. Use ToggleToolButton() to create a new ToggleToolButton.

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

  • button. (hovers over toggle)

  • here (Find about format)

  • https – //docs.gtk.org/gtk4/func.accelerator_parse.html

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

  • button.

Keyword Arguments:

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

__gtype_name__ = 'SugarToggleToolButton'[source]
set_icon_name(icon_name)[source]

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’)

get_icon_name()[source]

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

icon_name[source]
create_palette()[source]
get_palette()[source]
set_palette(palette)[source]
palette[source]
get_palette_invoker()[source]
set_palette_invoker(palette_invoker)[source]
palette_invoker[source]
set_tooltip(text)[source]

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

set_accelerator(accelerator)[source]

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 – //docs.gtk.org/gtk4/func.accelerator_parse.html

Example

set_accelerator(self, ‘accel’)

get_accelerator()[source]

Returns above accelerator string.

accelerator[source]
do_snapshot(snapshot)[source]

Render the toggle tool button using snapshot-based drawing.

do_clicked()[source]

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