g Atk.ImplementorIface Atk.ImplementorIface Gtk.Widget Gtk.Widget Atk.ImplementorIface->Gtk.Widget GObject.GInterface GObject.GInterface GObject.GInterface->Atk.ImplementorIface Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable GObject.InitiallyUnowned GObject.InitiallyUnowned GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gtk.Bin Gtk.Bin Gtk.Window Gtk.Window Gtk.Bin->Gtk.Window Gtk.Buildable->Gtk.Widget Gtk.Container Gtk.Container Gtk.Container->Gtk.Bin Gtk.OffscreenWindow Gtk.OffscreenWindow Gtk.Widget->Gtk.Container Gtk.Window->Gtk.OffscreenWindow


Style Properties

Inherited:Gtk.Window (2), Gtk.Widget (17)


Inherited:Gtk.Window (5), Gtk.Container (4), Gtk.Widget (69), GObject.Object (1)
Name Type Access Description
parent_object Gtk.Window r  

Class Details

class Gtk.OffscreenWindow(*args, **kwargs)

Gtk.OffscreenWindow is strictly intended to be used for obtaining snapshots of widgets that are not part of a normal widget hierarchy. Since Gtk.OffscreenWindow is a toplevel widget you cannot obtain snapshots of a full window with it since you cannot pack a toplevel widget in another toplevel.

The idea is to take a widget and manually set the state of it, add it to a Gtk.OffscreenWindow and then retrieve the snapshot as a cairo.Surface or GdkPixbuf.Pixbuf.

Gtk.OffscreenWindow derives from Gtk.Window only as an implementation detail. Applications should not use any API specific to Gtk.Window to operate on this object. It should be treated as a Gtk.Bin that has no parent widget.

When contained offscreen widgets are redrawn, Gtk.OffscreenWindow will emit a Gtk.Widget ::damage-event signal.

classmethod new()[source]
Returns:A pointer to a Gtk.Widget
Return type:Gtk.Widget

Creates a toplevel container widget that is used to retrieve snapshots of widgets without showing them on the screen.

New in version 2.20.

Returns:A GdkPixbuf.Pixbuf pointer, or None.
Return type:GdkPixbuf.Pixbuf or None

Retrieves a snapshot of the contained widget in the form of a GdkPixbuf.Pixbuf. This is a new pixbuf with a reference count of 1, and the application should unreference it once it is no longer needed.

New in version 2.20.

Returns:A cairo.Surface pointer to the offscreen surface, or None.
Return type:cairo.Surface or None

Retrieves a snapshot of the contained widget in the form of a cairo.Surface. If you need to keep this around over window resizes then you should add a reference to it.

New in version 2.20.