Description
Note
This object is available in PyGTK 2.2 and above.
gtk.gdk.Screen
objects are the PyGTK representation of a physical
screen. It is used throughout PyGTK to specify which
screen the top level windows are to be displayed on. It is also used to
query the screen specification and default settings such as the default
colormap (the get_default_colormap()
method), the screen width (the get_width()
method), etc.
Note
a screen may consist of multiple monitors that are merged to
form a large screen area.
Methods
gtk.gdk.Screen.get_default_colormap
def get_default_colormap()
|
Note
This method is available in PyGTK 2.2 and above.
The get_default_colormap() method
returns the default gtk.gdk.Colormap
for the screen.
gtk.gdk.Screen.set_default_colormap
def set_default_colormap(colormap)
|
Note
This method is available in PyGTK 2.2 and above.
The set_default_colormap() method sets
the gtk.gdk.Colormap
specified by colormap as the default colormap for the
screen.
gtk.gdk.Screen.get_system_colormap
def get_system_colormap()
|
Returns : | the default colormap for the screen.
Since: 2.2 |
Note
This method is available in PyGTK 2.2 and above.
The get_system_colormap() method
returns the system's default colormap for the screen
gtk.gdk.Screen.get_system_visual
Note
This method is available in PyGTK 2.2 and above.
The get_system_visual() method returns
the system's default gtk.gdk.Visual for
the screen. This is the visual for the root window of the display.
gtk.gdk.Screen.get_rgb_colormap
Note
This method is available in PyGTK 2.2 and above.
The get_rgb_colormap() method returns
the preferred colormap for rendering image data on the screen. Not a very
useful function; historically, GDK could only render RGB
image data to one colormap and visual, but in the current version it can
render to any colormap and visual. So there's no need to call this
function.
gtk.gdk.Screen.get_rgb_visual
Note
This method is available in PyGTK 2.2 and above.
The get_rgb_visual() method returns a
"preferred visual" chosen for rendering RGB image data on
the screen.
gtk.gdk.Screen.get_root_window
Note
This method is available in PyGTK 2.2 and above.
The get_root_window() method returns
the root gtk.gdk.Window of
the screen.
gtk.gdk.Screen.get_display
Returns : | the display that the screen belongs
to |
Note
This method is available in PyGTK 2.2 and above.
The get_display() method returns the
gtk.gdk.Display
that the screen belongs to.
gtk.gdk.Screen.get_number
Note
This method is available in PyGTK 2.2 and above.
The get_number() method returns the
index of the screen among the screens in its display. (See the get_display()
method)
gtk.gdk.Screen.get_width
Returns : | the width of the screen in
pixels. |
Note
This method is available in PyGTK 2.2 and above.
The get_width() method returns the
width of the screen in pixels
gtk.gdk.Screen.get_height
Returns : | the height of the screen in
pixels. |
Note
This method is available in PyGTK 2.2 and above.
The get_height() method returns the
height of the screen in pixels
gtk.gdk.Screen.get_width_mm
Returns : | the width of the screen in
millimeters. |
Note
This method is available in PyGTK 2.2 and above.
The get_width_mm() method returns the
width of the screen in millimeters. Note that on some X servers this value
will not be correct.
gtk.gdk.Screen.get_height_mm
Returns : | the height of the screen in pixels.
Since: 2.2 |
Note
This method is available in PyGTK 2.2 and above.
The get_height_mm() method returns the
height of the screen in millimeters. Note that on some X servers this value
will not be correct.
gtk.gdk.Screen.list_visuals
Note
This method is available in PyGTK 2.2 and above.
The list_visuals() method returns a list
of the available visuals for the screen. A gtk.gdk.Visual
describes a hardware image data format. For example, a visual might support
24-bit color, or 8-bit color, and might expect pixels to be in a certain
format.
gtk.gdk.Screen.get_toplevel_windows
def get_toplevel_windows()
|
Note
This method is available in PyGTK 2.2 and above.
The get_toplevel_windows() method
returns a list of all toplevel gtk.gdk.Window
objects known to PyGTK on the screen. A toplevel window
is a child of the root window (see the gtk.gdk.get_default_root_window()
function).
gtk.gdk.Screen.make_display_name
Note
This method is available in PyGTK 2.2 and above.
The make_display_name() method
determines the name to pass to gtk.gdk.Display() to get
a gtk.gdk.Display
with this screen as the default screen.
gtk.gdk.Screen.get_n_monitors
Returns : | the number of monitors that the screen consists
of. |
Note
This method is available in PyGTK 2.2 and above.
The get_n_monitors() method returns the
number of monitors that the screen consists of.
gtk.gdk.Screen.get_monitor_geometry
def get_monitor_geometry(monitor_num)
|
monitor_num : | the monitor number. |
Returns : | a gtk.gdk.Rectangle
containing the monitor geometry |
Note
This method is available in PyGTK 2.2 and above.
The get_monitor_geometry() method
returns a gtk.gdk.Rectangle
representing the size and position of the individual monitor within the the
entire screen area.
Note that the size of the entire screen area can be retrieved
via the get_width()
and get_height(). methods.
gtk.gdk.Screen.get_monitor_at_point
def get_monitor_at_point(x, y)
|
x : | an x coordinate in the virtual
screen. |
y : | a y coordinate in the virtual
screen. |
Returns : | the number of the monitor that the point
(x,y) lies in, or a
monitor close to
(x,y) if the point
is not in any monitor. |
Note
This method is available in PyGTK 2.2 and above.
The get_monitor_at_point() method
returns the number of the monitor in which the point
(x,y) is located or the
closest monitor if not in a monitor.
gtk.gdk.Screen.get_monitor_at_window
def get_monitor_at_window(window)
|
window : | a gtk.gdk.Window |
Returns : | the number of the monitor that most of window is located.
Since: 2.2 |
Note
This method is available in PyGTK 2.2 and above.
The get_monitor_at_window() method
returns the number of the monitor that most of the gtk.gdk.Window
specified by window is in. If
window does not intersect any monitors, the closest
monitor to the main bounding rectangle of window is
returned.
gtk.gdk.Screen.broadcast_client_message
def broadcast_client_message(event)
|
Note
This method is available in PyGTK 2.2 and above.
The broadcast_client_message() method
sends a message to all top level windows. On X11, sends an X ClientMessage
event to all toplevel windows on the screen.
Toplevel windows are determined by checking for the
WM_STATE property, as described in the Inter-Client
Communication Conventions Manual (ICCCM). If no windows are found with the
WM_STATE property set, the message is sent to all
children of the root window.
On Windows, broadcasts a message registered with the name
GDK_WIN32_CLIENT_MESSAGE to all top-level windows. The
amount of data is limited to one long, i.e. four bytes.
gtk.gdk.Screen.get_setting
name : | the name of the setting |
Returns : | the value of
setting |
Note
This method is available in PyGTK 2.2 and above.
The get_setting() method returns the
value of the desktop-wide setting (specified by
setting) such as double-click time for the
screen.
Functions
gtk.gdk.screen_width
def gtk.gdk.screen_width()
|
Returns : |
the width of the default screen in pixels. |
The gtk.gdk.screen_width() function
returns the width of the default screen in pixels.
gtk.gdk.screen_height
def gtk.gdk.screen_height()
|
Returns : |
the height of the default screen in pixels. |
The gtk.gdk.screen_height() function
returns the height of the default screen in pixels.
gtk.gdk.screen_width_mm
def gtk.gdk.screen_width_mm()
|
Returns : |
the width of the default screen in millimeters, though it is not
always correct. |
The gtk.gdk.screen_width_mm() function
returns the width of the default screen in millimeters. Note that on many X
servers this value will not be correct.
gtk.gdk.screen_height_mm
def gtk.gdk.screen_height_mm()
|
Returns : |
the height of the default screen in millimeters, though it is not
always correct. |
The gtk.gdk.screen_height_mm() function
returns the height of the default screen in millimeters. Note that on many X
servers this value will not be correct.