gtk.gdk.Display — controls the keyboard/mouse pointer grabs and a set of gtk.gdk.Screen objects
class gtk.gdk.Display(gobject.GObject): |
Functions
|
+-- gobject.GObject +-- gtk.gdk.Display |
"closed" | def callback(widget, is_error, user_param1, ...) |
This object is available in PyGTK 2.2 and above.
gtk.gdk.Display objects provide two capabilities:
gtk.gdk.Display objects are the GDK representation of the X Display which can be described as a workstation consisting of a keyboard, a pointing device (such as a mouse) and one or more screens. It is used to open and keep track of various gtk.gdk.Screen objects currently instantiated by the application. It is also used to grab and release the keyboard and the mouse pointer.
|
display_name : | the name of the display to open |
Returns : | a gtk.gdk.Display, or None if the display could not be opened. |
This constructor is available in PyGTK 2.2 and above.
Opens the display with the name specified by display_name and returns a gtk.gdk.Display object wrapping the display..
|
Returns : | a string representing the display name. |
This method is available in PyGTK 2.2 and above.
The get_name() method returns the name of the display.
|
Returns : | the number of display screens. |
This method is available in PyGTK 2.2 and above.
The get_n_screens() method returns the number of screens managed by the display.
|
screen_num : | the screen number |
Returns : | the gtk.gdk.Screen object |
This method is available in PyGTK 2.2 and above.
The get_screen() method returns a gtk.gdk.Screen object for one of the screens of the display.
|
Returns : | the default gtk.gdk.Screen object for display |
This method is available in PyGTK 2.2 and above.
The get_default_screen() method returns the default gtk.gdk.Screen for the display
|
time_ : | a timestamp or 0L for the current time. |
This method is available in PyGTK 2.2 and above.
The pointer_ungrab() method releases any pointer grab held by the display.
|
time_ : | a timestamp or 0L for the current time. |
This method is available in PyGTK 2.2 and above.
The keyboard_ungrab() method releases any keyboard grab held by the display.
|
Returns : | TRUE if an active X pointer grab is in effect |
This method is available in PyGTK 2.2 and above.
The pointer_is_grabbed() method returns TRUE if the pointer is grabbed.
|
This method is available in PyGTK 2.2 and above.
The beep() method emits a short beep on the display.
|
This method is available in PyGTK 2.2 and above.
The sync() method flushes any requests queued for the windowing system and waits until all requests have been handled. This is often used for making sure that the display is synchronized with the current state of the program. This is most useful for X11. On windowing systems where requests are handled synchronously, this method will do nothing.
|
This method is available in PyGTK 2.2 and above.
The close() method closes the connection to the windowing system for the given display, and cleans up associated resources.
|
Returns : | a list of gtk.gdk.Device objects. |
This method is available in PyGTK 2.2 and above.
The list_devices() method returns the list of available input devices attached to the display.
|
Returns : | the next gtk.gdk.Event to be processed, or None if no events are pending.. |
This method is available in PyGTK 2.2 and above.
The get_event() method returns the next gtk.gdk.Event to be processed for the display, fetching events from the windowing system if necessary. The returned gtk.gdk.Event should be freed with the gtk.gdk.Event.free() method
|
Returns : | a copy of the first gtk.gdk.Event on the event queue, or None if no events are in the queue. |
This method is available in PyGTK 2.2 and above.
The peek_event() method returns a copy of the first gtk.gdk.Event in the the display's event queue, without removing the event from the queue. (Note that this method will not get more events from the windowing system. It only checks the events that have already been moved to the GDK event queue.) The returned gtk.gdk.Event should be freed with gtk.gdk.Event.free().
|
event : | a gtk.gdk.Event. |
This method is available in PyGTK 2.2 and above.
The put_event() method appends a copy of the given event onto the front of the event queue for the display.
|
msec : | the double click time in milliseconds (thousandths of a second) |
This method is available in PyGTK 2.2 and above.
The set_double_click_time() method sets the double click time (two clicks within this time interval count as a double click and result in a gtk.gdk._2BUTTON_PRESS event). Applications should not set this, it is a global user-configured setting.
|
Returns : | the core pointer device |
This method is available in PyGTK 2.2 and above.
The get_core_pointer() method returns the core pointer device for the given display
|
Returns : | a 4-tuple containing the screen that the cursor is on, the root window X and Y coordinates of the pointer and the current modifier mask |
This method is available in PyGTK 2.2 and above.
The get_pointer() method returns a 4-tuple containing the gtk.gdk.Screen that the pointer is on, the current location coordinates of the pointer and the current modifier mask for the display. The returned modifier mask is a combination of:
gtk.gdk.SHIFT_MASK | The Shift key. |
gtk.gdk.LOCK_MASK | A Lock key (depending on the modifier mapping of the X server this may either be CapsLock or ShiftLock). |
gtk.gdk.CONTROL_MASK | The Control key. |
gtk.gdk.MOD1_MASK | The fourth modifier key (it depends on the modifier mapping of the X server which key is interpreted as this modifier, but normally it is the Alt key). |
gtk.gdk.MOD2_MASK | The fifth modifier key (it depends on the modifier mapping of the X server which key is interpreted as this modifier). |
gtk.gdk.MOD3_MASK | The sixth modifier key (it depends on the modifier mapping of the X server which key is interpreted as this modifier). |
gtk.gdk.MOD4_MASK | The seventh modifier key (it depends on the modifier mapping of the X server which key is interpreted as this modifier). |
gtk.gdk.MOD5_MASK | The eighth modifier key (it depends on the modifier mapping of the X server which key is interpreted as this modifier). |
gtk.gdk.BUTTON1_MASK | The first mouse button. |
gtk.gdk.BUTTON2_MASK | The second mouse button. |
gtk.gdk.BUTTON3_MASK | The third mouse button. |
gtk.gdk.BUTTON4_MASK | The fourth mouse button. |
gtk.gdk.BUTTON5_MASK | The fifth mouse button. |
gtk.gdk.RELEASE_MASK | Differentiates between (keyval, modifiers) pairs from key press and release events. |
gtk.gdk.MODIFIER_MASK | all of the above |
|
Returns : | a 3-tuple containing the gtk.gdk.Window under the mouse pointer and the x and y coordinates of the window origin |
This method is available in PyGTK 2.2 and above.
The get_window_at_pointer() method returns a 3-tuple containing the gtk.gdk.Window underneath the mouse pointer and the location of that window's origin. Returns None if the window under the mouse pointer is not known to GDK (for example, belongs to another application).
|
This method is available in PyGTK 2.4 and above.
The flush() method flushes any requests queued for the windowing system; this happens automatically when the main loop blocks waiting for new events, but if your application is drawing without returning control to the main loop, you may need to call this method explicitly. A common case where this method needs to be called is when an application is executing drawing commands from a thread other than the thread where the main loop is running.
This is most useful for X11. On windowing systems where requests are handled synchronously, this method will do nothing.
|
distance : | the distance in pixels |
This method is available in PyGTK 2.4 and above.
The set_double_click_distance() method sets the double click distance (two clicks within this distance count as a double click and result in a gtk.gdk.2BUTTON_PRESS event). See the set_double_click_time() method for more information. Applications should not set this, it is a global user-configured setting.
|
Returns : | TRUE if cursors can have alpha channels. |
This method is available in PyGTK 2.4 and above.
The supports_cursor_alpha() method returns TRUE if cursors can use an 8bit alpha channel on the display. Otherwise, cursors are restricted to bilevel alpha (i.e. a mask).
|
Returns : | TRUE if cursors can have multiple colors. |
This method is available in PyGTK 2.4 and above.
The supports_cursor_color() method returns TRUE if multicolored cursors are supported on the display. Otherwise, cursors have only a foreground and a background color.
|
Returns : | the default cursor size. |
This method is available in PyGTK 2.4 and above.
The get_default_cursor_size() method returns the default size to use for cursors on the display.
|
Returns : | a 2-tuple containing the maximal cursor width and height |
This method is available in PyGTK 2.4 and above.
The get_maximal_cursor_size() method returns a 2-tuple containing the maximum width and height to use for cursors on the display.
|
Returns : | The default group leader window for the display |
This method is available in PyGTK 2.4 and above.
The get_default_group() method returns the default group leader window for all toplevel windows on the display. This window is implicitly created by GDK. See the gtk.gdk.Window.set_group() method for more information.
|
Returns : | a gtk.gdk.Display, or None if there is no default display. |
This function is available in PyGTK 2.2 and above.
The gtk.gdk.display_get_default() function returns the default gtk.gdk.Display. This is a convenience function for:
display_manager = gtk.gdk.display_manager_get() display = display.manager.get_default_display() |
|
display : | the display that received the signal |
is_error : | TRUE if the display was closed due to an error |
user_param1 : | the first user parameter (if any) specified with the connect() method |
... : | additional user parameters (if any) |
The "closed" signal is emitted when the connection to the windowing system for display is closed.