Gdk.DisplayManager - Classes - Gdk 3.0 (original) (raw)
g GObject.Object GObject.Object Gdk.DisplayManager Gdk.DisplayManager GObject.Object->Gdk.DisplayManager
Subclasses:
None
Methods¶
Inherited:
Structs:
class | get () |
---|---|
get_default_display () | |
list_displays () | |
open_display (name) | |
set_default_display (display) |
Virtual Methods¶
Inherited:
Properties¶
Name | Type | Flags | Short Description |
---|---|---|---|
default-display | Gdk.Display | r/w | The default display for GDK |
Signals¶
Inherited:
Name | Short Description |
---|---|
display-opened | The ::display-opened signal is emitted when a display is opened. |
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 the Gdk.DisplayManagersingleton, 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");
Returns:
The global Gdk.DisplayManager singleton;Gdk.parse_args(), Gdk.init(), or Gdk.init_check() must have been called first.
Return type:
Gets the singleton Gdk.DisplayManager object.
When called for the first time, this function consults theGDK_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 use Gdk.set_allowed_backends() to limit what backends can be used.
New in version 2.2.
get_default_display()[source]¶
Returns:
a Gdk.Display, or None if there is no default display.
Return type:
Gdk.Display or None
Gets the default Gdk.Display.
New in version 2.2.
Returns:
a newly allocated GLib.SList of Gdk.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.
Parameters:
name (str) – the name of the display to open
Returns:
a Gdk.Display, or None if the display could not be opened
Return type:
Gdk.Display or None
Opens a display.
New in version 3.0.
set_default_display(display)[source]¶
Parameters:
display (Gdk.Display) – a Gdk.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 signal
- display (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