sugar3.graphics.palettewindow module

STABLE.

class sugar3.graphics.palettewindow.CursorInvoker(parent=None)

Bases: sugar3.graphics.palettewindow.Invoker

attach(parent)
detach()
get_default_position()
get_rect()
get_toplevel()
class sugar3.graphics.palettewindow.Invoker

Bases: gi.overrides.GObject.Object

ANCHORED = 0
AT_CURSOR = 1
BOTTOM = [(0.0, 0.0, 0.0, 1.0), (-1.0, 0.0, 1.0, 1.0)]
LEFT = [(-1.0, 0.0, 0.0, 0.0), (-1.0, -1.0, 0.0, 1.0)]
RIGHT = [(0.0, 0.0, 1.0, 0.0), (0.0, -1.0, 1.0, 1.0)]
TOP = [(0.0, -1.0, 0.0, 0.0), (-1.0, -1.0, 1.0, 0.0)]
attach(parent)
cache_palette

Whether the invoker will cache the palette after its creation. Defaults to True.

detach()
do_get_property(pspec)
do_set_property(pspec, value)
draw_rectangle(event, palette)
get_alignment(palette_dim)
get_cache_palette()
get_lock_palette()
get_palette()
get_position(palette_dim)
get_position_for_alignment(alignment, palette_dim)
get_toggle_palette()
has_rectangle_gap()
lock_palette

Whether the invoker will lock the Palette and ignore mouse events. Defaults to False.

notify_mouse_enter()
notify_mouse_leave()
notify_popdown()
notify_popup()
notify_right_click(x=None, y=None)

Notify the palette invoker of a right click and expand the palette as required. The x and y args should be that of where the event happened, relative to the root of the screen.

Args
x (float): the x coord of the event relative to the root

of the screen, eg. Gdk.EventTouch.x_root

y (float): the y coord of the event relative to the root

of the screen, eg. Gdk.EventTouch.y_root

notify_toggle_state()
palette
primary_text_clicked()

Implemented by invokers that can be clicked

set_cache_palette(cache_palette)
set_lock_palette(lock_palette)
set_palette(palette)
set_toggle_palette(toggle_palette)
toggle_palette

Whether the invoker will popup/popdown the Palette on button left click/touch tap. Defaults to False.

class sugar3.graphics.palettewindow.MouseSpeedDetector(delay, thresh)

Bases: gi.overrides.GObject.Object

start()
stop()
class sugar3.graphics.palettewindow.PaletteWindow(**kwargs)

Bases: gi.overrides.GObject.Object

Base class for _ToolbarPalette and Palette.

Provides basic management of child widget, invoker, and animation.

destroy()
do_get_property(pspec)
do_set_property(pspec, value)
get_full_size_request()
get_group_id()
get_invoker()
get_rect()
group_id
invoker
is_up()
on_enter()
on_invoker_enter()
on_invoker_leave()
on_leave()
popdown(immediate=False)
popup(immediate=False)
set_group_id(group_id)
set_invoker(invoker)
update_position()
class sugar3.graphics.palettewindow.ToolInvoker(parent=None)

Bases: sugar3.graphics.palettewindow.WidgetInvoker

A palette invoker for toolbar buttons and other items. This invoker will properly align the palette so that is perpendicular to the toolbar (a horizontal toolbar will spawn a palette going downwards). It also draws the highlights specific to a toolitem.

For sugar3.graphics.toolbutton.ToolButton and subclasses, you should not use the toolinvoker directly. Instead, just subclass the tool button and override the create_palette function.

Parameters

parent (Gtk.Widget) – toolitem to connect invoker to

attach_tool(widget)

Attach a toolitem to the invoker. Same behaviour as passing the parent argument to the constructor.

Parameters

widget (Gtk.Widget) – toolitem to connect invoker to

notify_popdown()
notify_popup()
primary_text_clicked()

Implemented by invokers that can be clicked

class sugar3.graphics.palettewindow.TreeViewInvoker

Bases: sugar3.graphics.palettewindow.Invoker

attach_treeview(tree_view)
detach()
get_rect()
get_toplevel()
notify_popdown()
class sugar3.graphics.palettewindow.WidgetInvoker(parent=None, widget=None)

Bases: sugar3.graphics.palettewindow.Invoker

attach_widget(parent, widget=None)
detach()
do_get_property(pspec)
do_set_property(pspec, value)
draw_rectangle(cr, palette)
get_rect()
get_toplevel()
has_rectangle_gap()
notify_popdown()
notify_popup()
widget