sugar3.graphics.popwindow module

Provide a PopWindow class for pop-up windows. Making PopWindow containing Gtk.Toolbar which also contains Gtk.Label and Toolbutton at the end of the Gtk.Toolbar.

It is possible to change props like size and add more widgets PopWindow and also to Gtk.Toolbar.

Example

class sugar3.graphics.popwindow.PopWindow(window_xid=None, **kwargs)

Bases: gi.overrides.Gtk.Window

UI interface for activity Pop-up Windows. PopWindows are the windows that open on the top of the current window. These pop-up windows don’t cover the whole screen. They contain canvas content, alerts messages, a tray and a toolbar.

FULLSCREEN and HALF_WIDTH for setting size of the window.

Kwargs:
size (int,int): size to be set of the window window_xid (xlib.Window): xid of the parent window
FULLSCREEN = (-225, -150)
HALF_WIDTH = (-113, -150)
add_view(widget, expand=True, fill=True, padding=0)

Adds child to the vbox.

Parameters:
  • widget (Gtk.Widget) – widget to be added
  • expand (bool) – True if child is to be given extra space allocated to vbox.
  • fill (bool) – True if space given to child by the expand option is actually allocated to child, rather than just padding it.
  • padding (int) – extra space in pixels to put between child and its neighbors, over and above the global amount specified by spacing in vbox.
Returns:

None

do_get_property(pspec)
do_set_property(pspec, value)
get_title_box()

Getter method for title-box

Returns:Title or Tool Box
Return type:self._title_box ()
get_vbox()

Getter method for canvas

Returns:canvas
Return type:self._vbox (Gtk.Box)
set_size(size)
size
title_box

Getter method for title-box

Returns:Title or Tool Box
Return type:self._title_box ()
vbox

Getter method for canvas

Returns:canvas
Return type:self._vbox (Gtk.Box)
class sugar3.graphics.popwindow.TitleBox

Bases: gi.repository.Gtk.Toolbar

Title box at the top of the pop-up window. Title and close button are added to the box and as needed more widgets can be added using self.add_widget method. This box is optional as the inherited class can remove this block by setting the self._set_title_box to False.

do_get_property(pspec)
do_set_property(pspec, value)
set_title(title)

setter function for ‘title’ property. :param title: title for the pop-up window :type title: str

title