Gdk.DisplayManager¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w |
The default display for GDK |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
The |
Fields¶
- Inherited:
Class Details¶
- class Gdk.DisplayManager(**kwargs)¶
- Bases:
- Abstract:
No
The purpose of the
Gdk.DisplayManager
singleton object is to offer notification when displays appear or disappear or the default display changes.You can use
Gdk.DisplayManager.get
() to obtain theGdk.DisplayManager
singleton, but that should be rarely necessary. Typically, initializing GTK+ opens a display that you can work with without ever accessing theGdk.DisplayManager
.The GDK library can be built with support for multiple backends. The
Gdk.DisplayManager
object determines which backend is used at runtime.When writing backend-specific code that is supposed to work with multiple GDK backends, you have to consider both compile time and runtime. At compile time, use the #GDK_WINDOWING_X11, #GDK_WINDOWING_WIN32 macros, etc. to find out which backends are present in the GDK library you are building your application against. At runtime, use type-check macros like GDK_IS_X11_DISPLAY() to find out which backend is in use:
- Backend-specific code
#ifdef GDK_WINDOWING_X11 if (GDK_IS_X11_DISPLAY (display)) { // make X11-specific calls here } else #endif #ifdef GDK_WINDOWING_QUARTZ if (GDK_IS_QUARTZ_DISPLAY (display)) { // make Quartz-specific calls here } else #endif g_error ("Unsupported GDK backend");
- classmethod get()[source]¶
- Returns:
The global
Gdk.DisplayManager
singleton;Gdk.parse_args
(),Gdk.init
(), orGdk.init_check
() must have been called first.- Return type:
Gets the singleton
Gdk.DisplayManager
object.When called for the first time, this function consults the
GDK_BACKEND
environment variable to find out which of the supported GDK backends to use (in case GDK has been compiled with multiple backends). Applications can useGdk.set_allowed_backends
() to limit what backends can be used.New in version 2.2.
- get_default_display()[source]¶
- Returns:
a
Gdk.Display
, orNone
if there is no default display.- Return type:
Gdk.Display
orNone
Gets the default
Gdk.Display
.New in version 2.2.
- list_displays()[source]¶
- Returns:
a newly allocated
GLib.SList
ofGdk.Display
objects. Free with g_slist_free() when you are done with it.- Return type:
List all currently open displays.
New in version 2.2.
- open_display(name)[source]¶
- Parameters:
name (
str
) – the name of the display to open- Returns:
a
Gdk.Display
, orNone
if the display could not be opened- Return type:
Gdk.Display
orNone
Opens a display.
New in version 3.0.
- set_default_display(display)[source]¶
- Parameters:
display (
Gdk.Display
) – aGdk.Display
Sets display as the default display.
New in version 2.2.
Signal Details¶
- Gdk.DisplayManager.signals.display_opened(display_manager, display)¶
- Signal Name:
display-opened
- Flags:
- Parameters:
display_manager (
Gdk.DisplayManager
) – The object which received the signaldisplay (
Gdk.Display
) – the opened display
The
::display-opened
signal is emitted when a display is opened.New in version 2.2.
Property Details¶
- Gdk.DisplayManager.props.default_display¶
- Name:
default-display
- Type:
- Default Value:
- Flags:
The default display for GDK