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 |
|
|
|
|
Virtual Methods¶
Properties¶
- Inherited:
Style Properties¶
- Inherited:
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 |
r |
Class Details¶
- class Gtk.OffscreenWindow(*args, **kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Gtk.OffscreenWindow
is strictly intended to be used for obtaining snapshots of widgets that are not part of a normal widget hierarchy. SinceGtk.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 acairo.Surface
orGdkPixbuf.Pixbuf
.Gtk.OffscreenWindow
derives fromGtk.Window
only as an implementation detail. Applications should not use any API specific toGtk.Window
to operate on this object. It should be treated as aGtk.Bin
that has no parent widget.When contained offscreen widgets are redrawn,
Gtk.OffscreenWindow
will emit aGtk.Widget
::damage-event
signal.- classmethod new()[source]¶
- Returns:
A pointer to a
Gtk.Widget
- Return type:
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, orNone
.- Return type:
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, orNone
.- Return type:
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.