Gdk.DisplayManager¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r/w |
Signals¶
- Inherited:
Name |
Short Description |
|---|---|
Emitted when a display is opened. |
Fields¶
- Inherited:
Class Details¶
- class Gdk.DisplayManager(**kwargs)¶
- Bases:
- Abstract:
No
Offers notification when displays appear or disappear.
GdkDisplayManageris a singleton object.You can use [func`Gdk`.DisplayManager.get] to obtain the
GdkDisplayManagersingleton, but that should be rarely necessary. Typically, initializing GTK opens a display that you can work with without ever accessing theGdkDisplayManager.The GDK library can be built with support for multiple backends. The
GdkDisplayManagerobject determines which backend is used at runtime.In the rare case that you need to influence which of the backends is being used, you can use [func`Gdk`.set_allowed_backends]. Note that you need to call this function before initializing GTK.
- Backend-specific code
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_WIN32macros, 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:``c #ifdef GDK_WINDOWING_X11
- if (GDK_IS_X11_DISPLAY (display))
- {
// make X11-specific calls here
}
else
#endif #ifdef GDK_WINDOWING_MACOS
- if (GDK_IS_MACOS_DISPLAY (display))
- {
// make Quartz-specific calls here
}
else
- #endif
g_error (“Unsupported GDK backend”);
- classmethod get()[source]¶
- Returns:
The global
GdkDisplayManagersingleton- Return type:
Gets the singleton
GdkDisplayManagerobject.When called for the first time, this function consults the
GDK_BACKENDenvironment variable to find out which of the supported GDK backends to use (in case GDK has been compiled with multiple backends).Applications can use [func`set_allowed_backends`] to limit what backends will be used.
- get_default_display()[source]¶
- Returns:
a
GdkDisplay- Return type:
Gdk.DisplayorNone
Gets the default
GdkDisplay.
- list_displays()[source]¶
- Returns:
a newly allocated
GSListofGdkDisplayobjects- Return type:
List all currently open displays.
- open_display(name)[source]¶
- Parameters:
- Returns:
a
GdkDisplay, orNoneif the display could not be opened- Return type:
Gdk.DisplayorNone
Opens a display.
- set_default_display(display)[source]¶
- Parameters:
display (
Gdk.Display) – aGdkDisplay
Sets display as the default display.
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
Emitted when a display is opened.
Property Details¶
- Gdk.DisplayManager.props.default_display¶
- Name:
default-display- Type:
- Default Value:
- Flags:
The default display.