Gimp.Display

g GObject.Object GObject.Object Gimp.Display Gimp.Display GObject.Object->Gimp.Display

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

get_by_id (display_id)

class

id_is_valid (display_id)

class

name ()

class

new (image)

delete ()

get_id ()

get_window_handle ()

is_valid ()

present ()

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

id

int

r/w/co

The display id for internal use

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class Gimp.Display(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Gimp.DisplayClass

Functions to create, delete and flush displays (views) on an image.

classmethod get_by_id(display_id)
Parameters:

display_id (int) – The display id.

Returns:

a Gimp.Display for display_id or None if display_id does not represent a valid display. The object belongs to libgimp and you must not modify or unref it.

Return type:

Gimp.Display or None

Returns a Gimp.Display representing display_id.

Note: in most use cases, you should not need to retrieve a Gimp.Display by its ID, which is mostly internal data and not reusable across sessions. Use the appropriate functions for your use case instead.

New in version 3.0.

classmethod id_is_valid(display_id)
Parameters:

display_id (int) – The display ID to check.

Returns:

Whether the display ID is valid.

Return type:

bool

Returns True if the display ID is valid.

This procedure checks if the given display ID is valid and refers to an existing display.

*Note*: in most use cases, you should not use this function. If you got a [class`Gimp`.Display] from the API, you should trust it is valid. This function is mostly for internal usage.

New in version 3.0.

classmethod name()
Returns:

the display name

Return type:

str

Returns the display to be used for plug-in windows.

This is a constant value given at plug-in configuration time. Will return None if GIMP has been started with no GUI, either via “–no-interface” flag, or a console build.

classmethod new(image)
Parameters:

image (Gimp.Image) – The image.

Returns:

The new display.

Return type:

Gimp.Display

Create a new display for the specified image.

Creates a new display for the specified image. If the image already has a display, another is added. Multiple displays are handled transparently by GIMP. The newly created display is returned and can be subsequently destroyed with a call to Gimp.Display.delete(). This procedure only makes sense for use with the GIMP UI, and will result in an execution error if called when GIMP has no UI.

delete()
Returns:

True on success.

Return type:

bool

Delete the specified display.

This procedure removes the specified display. If this is the last remaining display for the underlying image, then the image is deleted also. Note that the display is closed no matter if the image is dirty or not. Better save the image before calling this procedure.

get_id()
Returns:

the display ID.

Return type:

int

Note: in most use cases, you should not need a display’s ID which is mostly internal data and not reusable across sessions.

New in version 3.0.

get_window_handle()
Returns:

The native window handle or None.

Return type:

GLib.Bytes

Get a handle to the native window for an image display.

This procedure returns a handle to the native window for a given image display. It can be different types of data depending on the platform you are running on. For example in the X backend of GDK, a native window handle is an Xlib XID whereas on Wayland, it is a string handle. A value of None is returned for an invalid display or if this function is unimplemented for the windowing system that is being used.

New in version 2.4.

is_valid()
Returns:

Whether the display is valid.

Return type:

bool

Returns True if the display is valid.

This procedure checks if the given display is valid and refers to an existing display.

New in version 2.4.

present()
Returns:

True on success.

Return type:

bool

Present the specified display.

This procedure presents the specified display at the top of the display stack.

New in version 3.0.

Property Details

Gimp.Display.props.id
Name:

id

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The display id for internal use