Gtk.OffscreenWindow

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

Subclasses

None

Methods

Inherited

Gtk.Window (119), Gtk.Bin (1), Gtk.Container (35), Gtk.Widget (278), GObject.Object (37), Gtk.Buildable (10)

Structs

Gtk.ContainerClass (5), Gtk.WidgetClass (12), GObject.ObjectClass (5)

class

new ()

get_pixbuf ()

get_surface ()

Virtual Methods

Inherited

Gtk.Window (5), Gtk.Container (10), Gtk.Widget (82), GObject.Object (7), Gtk.Buildable (10)

Properties

Inherited

Gtk.Window (33), Gtk.Container (3), Gtk.Widget (39)

Style Properties

Inherited

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

Signals

Inherited

Gtk.Window (5), Gtk.Container (4), Gtk.Widget (69), GObject.Object (1)

Fields

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

Gtk.Window

Abstract

No

Structure

Gtk.OffscreenWindowClass

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.

get_pixbuf()[source]
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.

get_surface()[source]
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.