Gdk.DisplayManager

g GObject.Object GObject.Object Gdk.DisplayManager Gdk.DisplayManager GObject.Object->Gdk.DisplayManager

Subclasses:None

Methods

Inherited:GObject.Object (37)
Structs:GObject.ObjectClass (5)
class get ()
  get_default_display ()
  list_displays ()
  open_display (name)
  set_default_display (display)

Virtual Methods

Inherited:GObject.Object (7)

Properties

Name Type Flags Short Description
default-display Gdk.Display r/w The default display for GDK

Signals

Inherited:GObject.Object (1)
Name Short Description
display-opened The ::display-opened signal is emitted when a display is opened.

Fields

Inherited:GObject.Object (1)

Class Details

class Gdk.DisplayManager(**kwargs)
Bases:GObject.Object
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.DisplayManager singleton, but that should be rarely necessary. Typically, initializing GTK+ opens a display that you can work with without ever accessing the Gdk.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(), or Gdk.init_check() must have been called first.
Return type:Gdk.DisplayManager

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 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.

list_displays()[source]
Returns:a newly allocated GLib.SList of Gdk.Display objects. Free with g_slist_free() when you are done with it.
Return type:[Gdk.Display]

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, 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:

RUN_LAST

Parameters:

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:Gdk.Display
Default Value:None
Flags:READABLE, WRITABLE

The default display for GDK