gtk.gdk.Windowon-screen display areas in the target window
systemSynopsisgtk.gdk.Windowgtk.gdk.Drawablegtk.gdk.Windowparentwidthheightwindow_typeevent_maskwclasstitleNonex-1y-1visualNonecolormapNonecursorNonewmclass_nameNonewmclass_classNoneoverride_redirect-1drag_begintargetsinput_set_extension_eventsmaskmodeproperty_getpropertytypeNonepdeleteFalseproperty_changepropertytypeformatmodedataproperty_deletepropertyselection_convertselectiontargettimeset_keep_abovesettingset_keep_belowsettingdestroyget_window_typeshowhidewithdrawmovexyresizewidthheightmove_resizexywidthheightreparentnew_parentxyclearclear_areaxywidthheightclear_area_exywidthheightraise_lowerfocustimestamp0Lset_user_datauser_dataget_user_dataset_override_redirectoverride_redirectadd_filterfunctiondataNonescrolldxdyshape_combine_maskshape_maskoffset_xoffset_yset_child_shapesmerge_child_shapesis_visibleis_viewableget_stateset_static_gravitiesuse_staticget_type_hintset_type_hinthintset_modal_hintmodalset_skip_taskbar_hintskips_taskbarset_skip_pager_hintskips_pagerset_geometry_hintsmin_width-1min_height-1max_width-1max_height-1base_width-1base_height-1width_inc-1height_inc-1min_aspect-1.0max_aspect-1.0begin_paint_rectrectanglebegin_paint_regionregionend_paintset_titletitleset_roleroleset_transient_forleaderset_backgroundcolorset_back_pixmappixmapparent_relativeset_cursorcursorget_geometryget_positionget_originget_root_originget_frame_extentsget_pointerget_parentget_toplevelget_childrenget_eventsset_eventsevent_maskset_icon_listpixbufsset_iconicon_windowpixmapmaskset_icon_namenameset_groupleaderget_groupset_decorationsdecorationsget_decorationsset_functionsfunctionsiconifydeiconifystickunstickmaximizeunmaximizefullscreenunfullscreenregister_dndbegin_resize_dragedgebuttonroot_xroot_ytimestampbegin_move_dragbuttonroot_xroot_ytimestampinvalidate_rectrectinvalidate_childreninvalidate_regionregioninvalidate_childrenget_update_areafreeze_updatesthaw_updatesprocess_updatesupdate_childrenset_accept_focusaccept_focusenable_synchronized_configureconfigure_finishedset_focus_on_mapfocus_on_mapset_urgency_hinturgentmove_regionregiondxdyshape_combine_regionshape_regionoffset_xoffset_yinput_shape_combine_maskmaskxyinput_shape_combine_regionshape_regionoffset_xoffset_ybeepset_compositedcompositedset_opacityopacityset_startup_idstartup_idremove_redirectionFunctionsgtk.gdk.window_foreign_newanidgtk.gdk.window_foreign_new_for_displaydisplayanidgtk.gdk.get_default_root_windowgtk.gdk.window_get_toplevelsgtk.gdk.window_lookupanidgtk.gdk.window_lookup_for_displaydisplayanidgtk.gdk.window_process_all_updatesgtk.gdk.gdk_window_set_debug_updatessettinggtk.gdk.window_at_pointerAncestry+-- gobject.GObject
+-- gtk.gdk.Drawable
+-- gtk.gdk.Window
Descriptiongtk.gdk.Window is a
rectangular region on the screen. It's a low-level object, used to implement
high-level objects such as gtk.Widget and gtk.Window. A gtk.Window is a
toplevel window, the object a user might think of as a "window" with a
titlebar and so on. A gtk.Window may
contain several gtk.gdk.Window
objects since most widgets use a gtk.gdk.Window.A gtk.gdk.Window
object interacts with the native window system for input and events. Some
gtk.Widget
objects do not have an associated gtk.gdk.Window and
therefore cannot receive events. To receive events on behalf of these
"windowless" widgets a gtk.EventBox must
be used.A gtk.gdk.Window Composited Windows example
import gtk
import cairo
'''
The expose event handler for the event box.
This function simply draws a transparency onto a widget on the area
for which it receives expose events. This is intended to give the
event box a "transparent" background.
In order for this to work properly, the widget must have an RGBA
colourmap. The widget should also be set as app-paintable since it
doesn't make sense for GTK+ to draw a background if we are drawing it
(and because GTK+ might actually replace our transparency with its
default background colour).
'''
def transparent_expose(widget, event):
cr = widget.window.cairo_create()
cr.set_operator(cairo.OPERATOR_CLEAR)
# Ugly but we don't have event.region
region = gtk.gdk.region_rectangle(event.area)
cr.region(region)
cr.fill()
return False
'''
The expose event handler for the window.
This function performs the actual compositing of the event box onto
the already-existing background of the window at 50% normal opacity.
In this case we do not want app-paintable to be set on the widget
since we want it to draw its own (red) background. Because of this,
however, we must ensure that we use g_signal_register_after so that
this handler is called after the red has been drawn. If it was
called before then GTK would just blindly paint over our work.
Note: if the child window has children, then you need a cairo 1.16
feature to make this work correctly.
'''
def window_expose_event(widget, event):
#get our child (in this case, the event box)
child = widget.get_child()
#create a cairo context to draw to the window
cr = widget.window.cairo_create()
#the source data is the (composited) event box
cr.set_source_pixmap (child.window,
child.allocation.x,
child.allocation.y)
#draw no more than our expose event intersects our child
region = gtk.gdk.region_rectangle(child.allocation)
r = gtk.gdk.region_rectangle(event.area)
region.intersect(r)
cr.region (region)
cr.clip()
#composite, with a 50% opacity
cr.set_operator(cairo.OPERATOR_OVER)
cr.paint_with_alpha(0.5)
return False
# Make the widgets
w = gtk.Window()
b = gtk.Button("A Button")
e = gtk.EventBox()
# Put a red background on the window
red = gtk.gdk.color_parse("red")
w.modify_bg(gtk.STATE_NORMAL, red)
# Set the colourmap for the event box.
# Must be done before the event box is realised.
screen = e.get_screen()
rgba = screen.get_rgba_colormap()
e.set_colormap(rgba)
# Set our event box to have a fully-transparent background
# drawn on it. Currently there is no way to simply tell GTK+
# that "transparency" is the background colour for a widget.
e.set_app_paintable(True)
e.connect("expose-event", transparent_expose)
# Put them inside one another
w.set_border_width(10)
w.add(e)
e.add(b)
# Realise and show everything
w.show_all()
# Set the event box GdkWindow to be composited.
# Obviously must be performed after event box is realised.
e.window.set_composited(True)
# Set up the compositing handler.
# Note that we do _after_ so that the normal (red) background is drawn
# by gtk before our compositing occurs.
w.connect_after("expose-event", window_expose_event)
gtk.main()
In this example a button is placed inside of an event box inside of a window.
The event box is set as composited and therefore is no longer automatically
drawn to the screen.
When the contents of the event box change, an expose event is generated on its
parent window (which, in this case, belongs to the toplevel
gtk.Window). The expose
handler for this widget is responsible for merging the changes back on the screen
in the way that it wishes.
In our case, we merge the contents with a 50% transparency. We also set the background
colour of the window to red. The effect is that the background shows through the button.
Constructorgtk.gdk.Windowparentwidthheightwindow_typeevent_maskwclasstitleNonex-1y-1visualNonecolormapNonecursorNonewmclass_nameNonewmclass_classNoneoverride_redirect-1parent :a gtk.gdk.Windowwidth :the width of the window in
pixelsheight :the height of the window in
pixelswindow_type :the window typeevent_mask :the bitmask of events received by the
windowwclass :the class of window - either
gtk.gdk.INPUT_OUTPUT or
gtk.gdk.INPUT_ONLYtitle :the window title if a toplevel
windowx :the x coordinate of the window position relative
to parenty :the y coordinate of the window position relative
to parentvisual :the gtk.gdk.Visual for
the windowcolormap :the gtk.gdk.Colormap
for the windowcursor :the gtk.gdk.Cursor for
the windowwmclass_name :don't use this - see the gtk.Window.set_wmclass()
method for more information.wmclass_class :don't use this - see the gtk.Window.set_wmclass()
method for more information.override_redirect :if True bypass the window
managerReturns :the new gtk.gdk.WindowCreates a new gtk.gdk.Window of
the type and class specified by window_type and
wclass. The window will be a child of the specified
parent and will have the specified
width and height.
event_mask is a bitfield specifying the events that
the window will receive - see the set_events()
method for more information. The value of window_type
must be one of the .The value of wclass must be one of the
.If the optional parameters are not specified the corresponding
attribute values will have default values:x0y0visualthe default system visual - see the gtk.gdk.visual_get_system()
functioncolormapeither the system gtk.gdk.Colormap
if using the system gtk.gdk.Visual (see
the gtk.gdk.colormap_get_system()
function) or a new gtk.gdk.Colormap
using visualcursoruse the parent window's cursoroverride_redirectFalseMethodsgtk.gdk.Window.drag_begindrag_begintargetstargets :a list of offered targetsReturns :a new gtk.gdk.DragContextThe drag_begin() method starts a drag
operation and returns the new gtk.gdk.DragContext
created for it. The list of targets (integer values) supported by the drag
source are specified by targets.gtk.gdk.Window.input_set_extension_eventsinput_set_extension_eventsmaskmodemask :the event mask to be usedmode :the set of extension events to
receiveThe input_set_extension_events() method
enables or disables the extension events specified by
mode for the window when using the event mask
specified by mask. The value of
mode must be one of the .gtk.gdk.Window.property_getproperty_getpropertytype0pdeleteFalseproperty :the property to gettype :the type of property to get or not specified if
any type of property data is acceptable.pdelete :if True, delete the property
after retrieving the data.Returns :a tuple containing the actual property type,
the data format and the dataThe property_get() method returns a
tuple containing the actual property type (as a gtk.gdk.Atom), the
format and the data of the specified property with
the specified type. The value of
type may not be be specified in which case it will be
0 to match any type of property. the returned data will be a string if the
data format is 8; a list of integers if the data format is 16; or, a list of
gtk.gdk.Atom
objects or integers if the data format is 32. If
property cannot be found None is
returned. property and type
(if specified) must be a string or a gtk.gdk.Atom.gtk.gdk.Window.property_changeproperty_changepropertytypeformatmodedataproperty :the property to changetype :the new type of the property. If
mode is gtk.gdk.PROP_MODE_PREPEND
or gtk.gdk.PROP_MODE_APPEND, then this must match the
existing type or an error will occur.format :the new format for the property. If
mode is gtk.gdk.PROP_MODE_PREPEND
or gtk.gdk.PROP_MODE_APPEND, then this must match the
existing format or an error will occur.mode :a value describing how the new data is to be
combined with the current data.data :the data for the propertyThe property_change() method changes
the contents of the specified property to the
specified data with the specified
type and format. The value of
mode must be one of the which describes how the
new data is to be combined with the existing property data.The value of
format must be 8, 16 or
32. property and type must be
a string or a gtk.gdk.Atom.gtk.gdk.Window.property_deleteproperty_deletepropertyproperty :the property to deleteThe property_delete() method deletes
the specified property from the window.
property must be a string or a gtk.gdk.Atom.gtk.gdk.Window.selection_convertselection_convertselectiontargettimeselection :the selection to retrievetarget :the target form of
selectiontime :the timestamp to use when retrieving
selection. The selection owner may refuse the request
if it did not own the selection at the time indicated by the
timestamp.The selection_convert() method converts
the specified selection to the specified
form.gtk.gdk.Window.set_keep_aboveset_keep_abovesettingsetting :xif True keep the window
above other windowsThis method is available in PyGTK 2.4 and above.The set_keep_above() method sets the
"keep-above" setting to the value of setting. If
setting is True the window must be
kept above other windows. If the window is already above, then this method
does nothing.On X11, asks the window manager to keep the window above, if the
window manager supports this operation. Not all window managers support
this, and some deliberately ignore it or don't have a concept of "keep
above", but most standard window managers do.gtk.gdk.Window.set_keep_belowset_keep_belowsettingsetting :if True, keep the window
below other windowsThis method is available in PyGTK 2.4 and above.The set_keep_below() method sets the
"keep-below" setting to the value of setting. If
setting is True the window must be
kept below other windows. If the window was already below, then this
method does nothing.On X11, asks the window manager to keep the window below, if the
window manager supports this operation. Not all window managers support
this, and some deliberately ignore it or don't have a concept of "keep
below" but most standard window managers do.gtk.gdk.Window.destroydestroyThe destroy() method destroys the
window (destroys the server-side resource associated with the window). All
children of the window are also destroyed. There's normally no need to use
this method since windows are automatically destroyed when their reference
count reaches 0.gtk.gdk.Window.get_window_typeget_window_typeReturns :the type of windowThe get_window_type() method returns
the type of the window which is one of the .gtk.gdk.Window.showshowThe show() method maps the window so
it's visible on-screen and also raises it to the top of the window stack
(moves the window to the front of the Z-order). This method is opposite to
the hide()
method. When implementing a gtk.Widget, you
should call this method on the widget's gtk.gdk.Window as
part of the "map" method.gtk.gdk.Window.hidehideThe hide() method withdraws toplevel
windows, so they will no longer be known to the window manager and for all
windows, unmaps them, so they won't be displayed. This is normally done
automatically as part of the gtk.Widget.hide()
method.gtk.gdk.Window.withdrawwithdrawThe withdraw() method withdraws the
window (unmaps it and asks the window manager to forget about it). This is
normally done automatically by the gtk.Widget.hide()
method called on a gtk.Window.gtk.gdk.Window.movemovexyx :the X coordinate relative to the window's
parenty :the Y coordinate relative to the window's
parentThe move() method repositions the
window to the location specified by x and
y relative to its parent window. For toplevel
windows, window managers may ignore or modify the move. You should probably
use the gtk.Window.move()
method on a gtk.Window widget
anyway, instead of using this method. For child windows, the move will
reliably succeed. If you're also planning to resize the window, use the
move_resize()
method to both move and resize simultaneously, for a nicer visual
effect.gtk.gdk.Window.resizeresizewidthheightwidth :the new width of the
windowheight :the new height of the
windowThe resize() method resizes the window
to the specified width and
height. For toplevel windows, this method asks the
window manager to resize the window. However, the window manager may not
allow the resize. You should use the gtk.Window.resize()
method instead of this low-level method. Windows may not be resized smaller
than 1x1. If you're also planning to move the window, use the move_resize()
method to both move and resize simultaneously, for a nicer visual
effect.gtk.gdk.Window.move_resizemove_resizexywidthheightx :the new X position relative to the window's
parenty :the new Y position relative to the window's
parentwidth :the new widthheight :the new heightThe move_resize() method repositions
the window to the location specified by x and
y with the size specified by
width and height. This method
is equivalent to calling the move() and
resize()
methods, except that both operations are performed at once, avoiding strange
visual effects. (i.e. the user may be able to see the window first move,
then resize, if you don't use the move_resize()
method.)gtk.gdk.Window.reparentreparentnew_parentxynew_parent :the new parent gtk.gdk.Window to
move the window intox :the X location inside the new
parenty :the Y location inside the new
parentThe reparent() method reparents the
window into the gtk.gdk.Window
specified new_parent. The window being reparented
will be unmapped as a side effect.gtk.gdk.Window.clearclearThe clear() method clears an entire the
window to the background color or background pixmap.gtk.gdk.Window.clear_areaclear_areaxywidthheightx :the X coordinate of the rectangle to
cleary :the Y coordinate of the rectangle to
clearwidth :the width of the rectangle to
clearheight :the height of the rectangle to
clearThe clear_area() method clears the area
(specified by x, y,
width and height) of the
window to the background color or background pixmap.gtk.gdk.Window.clear_area_eclear_area_exywidthheightx :the X coordinate of the rectangle to
cleary :the Y coordinate of the rectangle to
clearwidth :the width of the rectangle to
clearheight :the height of the rectangle to
clearThe clear_area_e() method is like the
clear_area(),
but also generates an expose event for the cleared area.gtk.gdk.Window.raise_raise_The raise_() method raises the window to
the top of the Z-order (stacking order), so that other windows with the same
parent window appear below the window. If the window is a toplevel, the
window manager may choose to deny the request to move the window in the
Z-order. Therefore, the raise_()
method only requests the restack, it does not guarantee it.
This method is called raise() in
the C API, but was renamed raise_()
since raise is a reserved Python keyword.
gtk.gdk.Window.lowerlowerThe lower() method lowers the window to the bottom of the
Z-order (stacking order), so that other windows with the same parent window
appear above the window. If the window is a toplevel, the window manager may
choose to deny the request to move the window in the Z-order. Therefore, the
lower()
only requests the restack, it does not guarantee it. Note that the show()
method raises the window again, so don't call this method before calling the
show()
method to avoid duplication.gtk.gdk.Window.focusfocustimestamp0Ltimestamp :the timestamp of the event triggering the
window focusThe focus() method sets keyboard focus
to the window. If the window is not on-screen this will not work. In most
cases, the gtk.Window.present()
method should be used on a gtk.Window, rather
than calling this method.gtk.gdk.Window.set_user_dataset_user_datauser_datauser_data :a gtk.WidgetThis method is available in PyGTK 2.4 and above.The set_user_data() method stores the
underlying GTK+ widget of the PyGTK widget that is specified by
user_data as the user data of the window. In general
GTK+ stores the widget that owns a gtk.gdk.Window as
user data on a gtk.Window. So,
custom widget implementations in PyGTK should use this
method to provide that capability. If GTK+ receives an
event for a gtk.gdk.Window, and
the user data for the window is set, GTK+ will assume the
user data is a gtk.Widget, and
forward the event to that widget.In PyGTK 2.4 and above this method will raise the TypeError
exception if user_data is not a gtk.Widget.This method is deprecated for any use other than the above. To
set other user data on a gtk.gdk.Window use
the gobject.GObject.set_data()
method instead.gtk.gdk.Window.get_user_dataget_user_dataReturns :the user data set on the
windowThis method is available in PyGTK 2.4 and above.The get_user_data() method returns the
PyGTK widget that was set as the user data of the window using the set_user_data()
method. This method raises the ValueError exception if the user data is not
set or is not a PyGTK object.gtk.gdk.Window.set_override_redirectset_override_redirectoverride_redirectoverride_redirect :if True the window should be
override redirectThe set_override_redirect() method sets
the "override redirect" attribute on the window to the value specified by
override_redirect. If
override_redirect is True the
window is not under the control of the window manager. This means it won't
have a titlebar, won't be minimizable, etc. - it will be entirely under the
control of the application. The window manager can't see the override
redirect window at all. Override redirect should only be used for
short-lived temporary windows, such as popup menus. gtk.Menu uses an
override redirect window in its implementation, for example. This method
does not work on MS Windows.gtk.gdk.Window.add_filteradd_filterfunctiondataNonefunction :a functiondata :data to pass to
functionThis method is available in PyGTK 2.2 and above.The add_filter() method adds an event
filter function specified by function to the window,
allowing you to intercept events before they reach GDK. This is a low-level
operation and makes it easy to break GDK and/or GTK+, so you have to know
what you're doing. Once added there is no way to remove a filter
function. The function signature is:
def function(event, user_data)
where event is a gtk.gdk.Event and
user_data is data. If
data is not specified then
user_data is not passed to
function.function should return one of the
following values which is on of the .gtk.gdk.Window.scrollscrolldxdydx :the amount to scroll in the X
directiondy :the amount to scroll in the Y
directionThe scroll() method scrolls the
contents of the window, both pixels and children, by the horizontal and
vertical amounts specified by dx and
dy respectively. The window itself does not move.
Portions of the window that the scroll operation brings in from off-screen
areas are invalidated. The invalidated region may be bigger than what would
strictly be necessary. (For X11, a minimum area will be invalidated if the
window has no subwindows, or if the edges of the window's parent do not
extend beyond the edges of the window. In other cases, a multi-step process
is used to scroll the window which may produce temporary visual artifacts
and unnecessary invalidations.)gtk.gdk.Window.shape_combine_maskshape_combine_maskshape_maskoffset_xoffset_yshape_mask :the shape bitmap maskoffset_x :the X position of shape mask with respect to
the windowoffset_y :the Y position of shape mask with respect to
the windowThe shape_combine_mask() method applies
the bitmap mask specified by shape_mask to the window
at the location specified by x and
y. Pixels in the window corresponding to set bits in
the shape_mask will be visible; pixels in the window
corresponding to unset bits in the shape_mask will be
transparent. This method provides a non-rectangular window. If
shape_mask is None, the shape mask
will be unset, and the x/y
parameters are not used.On the X11 platform, this uses an X server extension which is
widely available on most common platforms, but not available on very old X
servers, and occasionally the implementation will be buggy. On servers
without the shape extension, this function will do nothing.gtk.gdk.Window.set_child_shapesset_child_shapesThe set_child_shapes() method sets the
shape mask of the window to the union of shape masks for all children of the
window, ignoring the shape mask of the window itself. Contrast this method
with the merge_child_shapes()
method that includes the shape mask of the window in the masks to be
merged.gtk.gdk.Window.merge_child_shapesmerge_child_shapesThe merge_child_shapes() method merges
the shape masks for any child windows into the shape mask for the window.
i.e. the union of all masks for the window and its children will become the
new mask for the window. See the shape_combine_mask()
method. This method is distinct from the set_child_shapes()
method because it includes the window's shape mask in the set of shapes to
be merged.gtk.gdk.Window.is_visibleis_visibleReturns :True if the window is
mappedThe is_visible() method returns
True if the window has been mapped (with the show()
method.gtk.gdk.Window.is_viewableis_viewableReturns :True if the window is
viewableThe is_viewable() method returns
True if the window and all its ancestors are mapped.
(This is not necessarily "viewable" in the X sense, since we only check as
far as we have gtk.gdk.Window
parents, not to the root window.)gtk.gdk.Window.get_stateget_stateReturns :the window state bitfieldThe get_state() method returns the
bitwise OR of the currently active .gtk.gdk.Window.set_static_gravitiesset_static_gravitiesuse_staticuse_static :if True turn on static
gravityReturns :True if the server supports
static gravityThe set_static_gravities() method sets
the bit gravity of the given window to the value specified by
use_static. If use_static is
True the window uses static gravity and all children get
static subwindow gravity as well. This method returns
True if the window system server supports static
gravity.gtk.gdk.Window.get_type_hintget_type_hintReturns :The type hint set for window.
The get_type_hint() method returns the
type hint set for a window.
gtk.gdk.Window.set_type_hintset_type_hinthinthint :a hint of the function this window will
haveThe set_type_hint() method provides the
specified hint to the window manager about the
functionality of a window. The window manager can use this information when
determining the decoration and behavior of the window. The hint must be set
before the window is mapped. The value of hint must be one of the .gtk.gdk.Window.set_modal_hintset_modal_hintmodalmodal :if True the window is
modal.The set_modal_hint() method sets the
window's modal hint to the value specified by modal.
If modal is True the window is
modal. The window manager can use this information to handle modal windows
in a special way which usually means that the window gets all the input for
the application effectively blocking input to other windows in the
application. . You should only use this on windows for which you have
previously called the set_transient_for()
methodgtk.gdk.Window.set_skip_taskbar_hintset_skip_taskbar_hintmodalskip_taskbar :if True skip the
taskbar.This method is available in PyGTK 2.2 and above.The set_skip_taskbar_hint() method sets
the "skip_taskbar" setting to the value specified by
skips_taskbar. If
skips_taskbar is True the window
should not appear in a task list or window
list. If the window's semantic type as specified with the set_type_hint()
method already fully describes the window, this method should not be called in addition; instead you should allow
the window to be treated according to standard policy for its semantic
type.gtk.gdk.Window.set_skip_pager_hintset_skip_pager_hintskips_pagerskips_pager :if True skip the pagerThis method is available in PyGTK 2.2 and above.The set_skip_pager_hint() method sets
the "skip_pager" setting to the value of skips_pager. If skips_pager is True
the window should not appear in a pager (a
workspace switcher, or other desktop utility program that displays a small
thumbnail representation of the windows on the desktop). If the window's
semantic type as specified with set_type_hint()
already fully describes the window, this method should not be called in addition, instead you should allow
the window to be treated according to standard policy for its semantic
type.gtk.gdk.Window.set_geometry_hintsset_geometry_hintsmin_width-1min_height-1max_width-1max_height-1base_width-1base_height-1width_inc-1height_inc-1min_aspect-1.0max_aspect-1.0min_width :minimum width of window or -1 to use
requisitionmin_height :minimum height of window or -1 to use
requisitionmax_width :maximum width of window or -1 to use
requisitionmax_height :maximum height of window or -1 to use
requisitionbase_width :allowed window widths are
base_width + width_inc * N (where N is any integer) or
-1base_height :allowed window widths are
base_height + height_inc * N (where N is any integer) or
-1width_inc :width resize incrementheight_inc :height resize incrementmin_aspect :minimum width/height ratiomax_aspect :maximum width/height ratioThis method is available in PyGTK 2.2 and above.The set_geometry_hints() method sets
the geometry hints for the window.This method provides hints to the windowing system about
acceptable sizes for a toplevel window. The purpose of this is to constrain
user resizing, but the windowing system will typically (but is not required
to) also constrain the current size of the window to the provided values and
constrain programmatic resizing via gdk_window_resize() or
gdk_window_move_resize().Note that on X11, this effect has no effect on windows of type
GDK_WINDOW_TEMP or windows where override_redirect has been turned on via
the set_override_redirect()
method since these windows are not resizable by the user.gtk.gdk.Window.begin_paint_rectbegin_paint_rectrectanglerectangle :the rectangle you intend to draw
toThe begin_paint_rect() method indicates
that you are beginning the process of redrawing the area specified by
rectangle. A backing store (off-screen buffer) large
enough to contain rectangle will be created. The
backing store will be initialized with the background color or background
pixmap for window. Then, all drawing operations performed on the window will
be diverted to the backing store. When you call the end_paint()
method, the backing store will be copied to the window, making it visible
on-screen. Only the part of window contained in region will be modified; that
is, drawing operations are clipped to rectangle. The
net result of all this is to remove flicker, because the user sees the
finished product appear all at once when you call the end_paint()
method. If you draw to window directly without calling the
begin_paint_rect() method, the user may see flicker
as individual drawing operations are performed in sequence. The clipping and
background initializing features of the
begin_paint_rect() are conveniences for the
programmer, so you can avoid doing that work yourself.gtk.gdk.Window.begin_paint_regionbegin_paint_regionregionregion :the region you intend to draw toThis method is available in PyGTK 2.10 and above.The begin_paint_region() method
indicates that you are beginning the process of redrawing the gtk.gdk.Region
specified by region. A backing store
(off-screen buffer) large enough to contain
region will be created. The backing store will
be initialized with the background color or background pixmap for the
window. Then, all drawing operations performed on the window will be
diverted to the backing store. When you call the end_paint()
method, the backing store will be copied to the window, making it
visible on-screen. Only the part of the window contained in
region will be modified; that is, drawing
operations are clipped to region.The net result of all this is to remove flicker, because the
user sees the finished product appear all at once when you call the
end_paint()
method. If you draw to the window directly without calling the begin_paint_region()
method, the user may see flicker as individual drawing operations are
performed in sequence. The clipping and background initializing
features of the begin_paint_region()
method are conveniences for the programmer, so you can avoid doing
that work yourself.The widget system automatically places calls to the begin_paint_region()
and end_paint()
methods around emissions of the "expose_event" signal. That is, if
you're writing an expose event handler, you can assume that the
exposed area in a gtk.gdk.EXPOSE type gtk.gdk.Event
has already been cleared to the window background, is already set as
the clip region, and already has a backing store. Therefore in most
cases, application code need not call the begin_paint_region()
method. (You can disable the automatic calls around expose events on a
widget-by-widget basis by calling gtk.Widget.set_double_buffered().)If you call this method multiple times before calling the
matching the end_paint()
method, the backing stores are pushed onto a stack. The end_paint()
method copies the topmost backing store on-screen, subtracts the
topmost region from all other regions in the stack, and pops the
stack. All drawing operations affect only the topmost backing store in
the stack. One matching call to the end_paint()
method is required for each call to the begin_paint_region()
method.gtk.gdk.Window.end_paintend_paintThe end_paint() method indicates that
the backing store created by the most recent call to the begin_paint_rect()
method should be copied on-screen and deleted, leaving the next-most-recent
backing store or no backing store at all as the active paint region. It is
an error to call this function without a matching call to the begin_paint_rect()
method first.gtk.gdk.Window.set_titleset_titletitletitle :the new title of the
windowThe set_title() method sets the title
of a toplevel window, to the string specified by
title. If you haven't explicitly set the icon name
for the window (using the set_icon_name()
method), the icon name will be set to title as well.
title must be in UTF-8 encoding (as with all
user-readable strings in PyGTK).gtk.gdk.Window.set_roleset_rolerolerole :a string indicating its
roleThe set_role() method sets the string
specified by role as the window's role. When using
PyGTK, you should generally use the gtk.Window.set_role()
method instead of this low-level function. The window manager and session
manager use a window's role to distinguish it from other kinds of window in
the same application. When an application is restarted after being saved in
a previous session, all windows with the same title and role are treated as
interchangeable. So if you have two windows with the same title that should
be distinguished for session management purposes, you should set the role on
those windows. It doesn't matter what string you use for the role, as long
as you have a different role for each non-interchangeable kind of
window.gtk.gdk.Window.set_transient_forset_transient_forleaderleader :another gtk.gdk.WindowThe set_transient_for() method
indicates to the window manager that the window is a transient dialog
associated with the application window leader. This
allows the window manager to do things like center the window on
leader and keep the window above
leader. See the gtk.Window.set_transient_for()
method if you're using a gtk.Window or gtk.Dialog.gtk.gdk.Window.set_backgroundset_backgroundcolorcolor :an allocated gtk.gdk.ColorThe set_background() method sets the
background gtk.gdk.Color of the
window to the value specified by color. (However,
when using PyGTK, set the background of a widget with the
gtk.Widget.modify_bg()
method from an application - or the gtk.Style.set_background()
method from a custom widget implementation.) The
color must be allocated Also see the set_back_pixmap()
method.gtk.gdk.Window.set_back_pixmapset_back_pixmappixmapparent_relativepixmap :a gtk.gdk.Pixmap, or
Noneparent_relative :if True the tiling origin is
at the origin of the window's parentThe set_back_pixmap() method sets the
background pixmap of the window to the value specified by
pixmap A background pixmap will be tiled, positioning
the first tile at the origin of the window, or if
parent_relative is True, the
tiling will be done based on the origin of the parent window (useful to
align tiles in a parent with tiles in a child). If
pixmap is None the window will
have no background which means it will never have its background filled by
the windowing system. Instead the window will contain whatever pixels were
already in the corresponding area of the display. The windowing system will
normally fill a window with its background when the window is obscured then
exposed, and when you call the clear()
method.gtk.gdk.Window.set_cursorset_cursorcursorcursor :a gtk.gdk.Cursor or
NoneThe set_cursor() method sets the mouse
pointer for a gtk.gdk.Window. Use
either the gtk.gdk.Cursor() or
gtk.gdk.Cursor() constructors
to create the cursor. To make the cursor invisible, use the gtk.gdk.Cursor() constructor to
create a cursor with no pixels in it. Passing None for
the cursor argument to the
set_cursor() method means that the window will use
the cursor of its parent window. Most windows should use this
default.gtk.gdk.Window.get_geometryget_geometryReturns :a 5-tuple containing the X and Y coordinate of
the location of the window relative to its parent and the width and height
of the window and the bit depth of the window.The get_geometry() method returns a
5-tuple containing the window's location and size (x, y, width, height) and
the bit depth of the window. The X and Y coordinates returned are relative
to the parent window of the window, which for toplevels usually means
relative to the window decorations (titlebar, etc.) rather than relative to
the root window (screen-size background window).
On the X11 platform, the geometry is obtained from the X server, so reflects
the latest position of the window; this may be out-of-sync with the position
of the window delivered in the most-recently-processed
GdkEventConfigure. the get_position()
method in contrast gets the position from the most recent configure
event.gtk.gdk.Window.get_positionget_positionReturns :a 2-tuple containing the X and Y coordinates of
the window location.The get_position() returns a 2-tuple
containing the position of the window as reported in the
most-recently-processed GdkEventConfigure. By comparison
with the get_geometry()
method that queries the X server for the current window position, regardless
of what events have been received or processed. The position coordinates are
relative to the window's parent window.gtk.gdk.Window.get_originget_originReturns :a 2-tuple containing the X and Y coordinates of
the windowThe get_origin() method returns a
2-tuple containing the x and y coordinates of the position of a window in
root window coordinates. (Compare this method with the get_position()
and get_geometry()
methods that return the position of a window relative to its parent
window.)gtk.gdk.Window.get_root_originget_root_originReturns :a 2-tuple containing the X and Y coordinates of
the window frame positionThe get_root_origin() method returns a
2-tuple containing the top-left corner of the window manager frame in root
window coordinates.gtk.gdk.Window.get_frame_extentsget_frame_extentsReturns :a gtk.gdk.Rectangle
specifying the bounding box of the window frameThe get_frame_extents() method returns
a gtk.gdk.Rectangle
specifying the bounding box of the window, including window manager
titlebar/borders if any. The frame position is given in root window
coordinates. To get the position of the window itself (rather than the
frame) in root window coordinates, use the get_origin()
method.gtk.gdk.Window.get_pointerget_pointerReturns :a 3-tuple containing the X and Y coordinates of
the mouse pointer and the modifier maskThe get_pointer() method returns a
3-tuple containing the coordinates of the mouse pointer location relative to
the window and the modifier state. The modifier state is a combination of
the .gtk.gdk.Window.get_parentget_parentReturns :the parent gtk.gdk.Window of
the windowThe get_parent() method returns the
parent of the window as set when the gtk.gdk.Window was
created or when the reparent()
method was called.gtk.gdk.Window.get_toplevelget_toplevelReturns :the toplevel gtk.gdk.Window
containing the windowThe get_toplevel() method returns the
toplevel gtk.gdk.Window
that's an ancestor of the window.gtk.gdk.Window.get_childrenget_childrenReturns :the list of child windows inside the
windowThe get_children() method returns the
list of children gtk.gdk.Window
objects of the window. This method only returns children created via
PyGTK, so for example it's useless when used with the
root window; it only returns windows an application created itself.gtk.gdk.Window.get_eventsget_eventsReturns :the event mask for the
windowThe get_events() method returns the
event mask for the window. See the set_events()
method for more detail.gtk.gdk.Window.set_eventsset_eventsevent_maskevent_mask :the event mask for the
windowThe set_events() method sets the event
mask to the value specified by event_mask for the window. The event mask
determines which events will be reported for the window. For example, an
event mask including gtk.gdk.BUTTON_PRESS_MASK means the
window should report button press events. The event mask is the bitwise OR
of the .gtk.gdk.Window.set_icon_listset_icon_listpixbufspixbufs :a list (or tuple) containing pixbufs, of
different sizes.This method is available in PyGTK 2.2 and above.The set_icon_list() method sets the
list of icons for the window. pixbufs is a list or tuple containing gtk.gdk.Pixbuf
objects to be used as the icon images. One of these will be used to
represent the window when it has been iconified. The icon is usually shown
in an icon box or some sort of task bar. Which icon size is shown depends on
the window manager. The window manager can scale the icon but setting
several size icons can give better image quality since the window manager
may only need to scale the icon by a small amount or not at all.gtk.gdk.Window.set_iconset_iconicon_windowpixmapmaskicon_window :a gtk.gdk.Window to
use for the iconpixmap :a gtk.gdk.Pixmap to
use as the iconmask :a 1-bit pixmap (GdkBitmap)
to use as mask for pixmapThe set_icon() method sets the icon of
the window as a gtk.gdk.Pixmap
(specified by pixmap) or gtk.gdk.Window
specified by icon_window). Investigate the gtk.window_set_default_icon_list()()
function first, and then the gtk.Window.set_icon_list()
and gtk.Window.set_icon()
methods. If those don't meet your needs, look at the set_icon_list()
method. Only if all those are too high-level do you want to fall back to the
set_icon().gtk.gdk.Window.set_icon_nameset_icon_namenamename :the name of the window while iconified
(minimized)The set_icon_name() method sets the
name of the window when it is iconified to the value of
name. Windows may have a name used while minimized,
distinct from the name they display in their titlebar. Most of the time this
is a bad idea from a user interface standpoint. But you can set such a name
with this method, if you like.gtk.gdk.Window.set_groupset_groupleaderleader :the group leader gtk.gdk.WindowThe set_group() method sets the group
leader for the window to the gtk.gdk.Window
specified by leader. By default, the group leader
for all toplevel windows is set to a global window implicitly created by
PyGTK. With this method you can override this default.
The group leader window allows the window manager to distinguish all windows
that belong to a single application. It may for example allow users to
minimize or unminimize all windows belonging to an application at once. You
should only set a non-default group window if your application pretends to
be multiple applications. The group leader window may not be changed after a
window has been mapped (with the show()
method for example).gtk.gdk.Window.get_groupget_groupReturns :the group leader gtk.gdk.Window
for the windowThis method is available in PyGTK 2.4 and above.The get_group() method returns the
group leader gtk.gdk.Window for
the window. See the set_group()
method for more information.gtk.gdk.Window.set_decorationsset_decorationsdecorationsdecorations :the decoration hint maskThe set_decorations() method sets the
specified decorations for the window. "Decorations" are the features the
window manager adds to a toplevel gtk.gdk.Window. This
method sets the traditional Motif window manager hints that tell the window
manager which decorations you would like your window to have. Usually you
should use the gtk.Window.set_decorated()
method on a gtk.Window instead
of using this method directly. The value of
decorations is the logical OR of the .gtk.gdk.Window.get_decorationsget_decorationsReturns :the window decorationsThe get_decorations() method returns
the decorations set on the window with the set_decorations
method.gtk.gdk.Window.set_functionsset_functionsfunctionsfunctions :the bitmask of operations to allow on the
windowThe set_functions() method sets the
traditional Motif window manager hint for which operations the window
manager should allow on a toplevel window. However, few window managers do
anything reliable or interesting with this hint. Many ignore it
entirely. The functions argument is the logical OR of
the .gtk.gdk.Window.iconifyiconifyThe iconify() method asks the window
manager to iconify (minimize) the window. The window manager may choose to
ignore the request, but normally will honor it. Using the gtk.Window.iconify()
method is preferred, if you have a gtk.Window
widget.gtk.gdk.Window.deiconifydeiconifyThe deiconify() method asks the window
manager to deiconify (unminimize) the window. On X11 the window manager may
choose to ignore the request to deiconify. Using the gtk.Window.deiconify()
method is preferred. Or better yet, use the gtk.Window.present(),
which raises the window, focuses it, unminimizes it, and puts it on the
current desktop.gtk.gdk.Window.stickstickThe stick() method "pins" a window such
that it's on all workspaces and does not scroll with viewports, for window
managers that have scrollable viewports. (When using a gtk.Window, the
gtk.Window.stick()
method may be more useful.) On the X11 platform, this method depends on
window manager support, so may have no effect with many window managers.
However, PyGTK will do the best it can to convince the
window manager to stick the window. For window managers that don't support
this operation, there's nothing you can do to force it to happen.gtk.gdk.Window.unstickunstickThe unstick() method reverses the
effect of the stick()
method. See the stick()
and gtk.Window.unstick()
methods for more information.gtk.gdk.Window.maximizemaximizeThe maximize() method asks the window
manager to maximize the window, if the window manager supports this
operation. Not all window managers support this, and some deliberately
ignore it or don't have a concept of "maximized"; so you can't rely on the
maximization actually happening. But it will happen with most standard
window managers. If the window was already maximized, then this method does
nothing.gtk.gdk.Window.unmaximizeunmaximizeThe unmaximize() method asks the window
manager to unmaximize the window, if the window manager supports this
operation. Not all window managers support this, and some deliberately
ignore it or don't have a concept of "maximized"; so you can't rely on the
unmaximization actually happening. But it will happen with most standard
window managers. If the window wasn't maximized, then this method does
nothing.gtk.gdk.Window.fullscreenfullscreenThis method is available in PyGTK 2.2 and above.The fullscreen() method moves the window
into fullscreen mode. This means the window covers the entire screen and is
above any panels or task bars.If the window was already fullscreen, then this method does
nothing.On X11, asks the window manager to put the window in a
fullscreen state, if the window manager supports this operation. Not all
window managers support this, and some deliberately ignore it or don't have
a concept of "fullscreen" but most standard window managers do.gtk.gdk.Window.unfullscreenunfullscreenThis method is available in PyGTK 2.2 and above.The unfullscreen() method moves the
window out of fullscreen mode. If the window was not fullscreen, does
nothing.On X11, asks the window manager to move the window out of the
fullscreen state, if the window manager supports this operation. Not all
window managers support this, and some deliberately ignore it or don't have
a concept of "fullscreen" but most standard window managers do.gtk.gdk.Window.register_dndregister_dndThe register_dnd() method registers the
window as a potential drop destination.gtk.gdk.Window.begin_resize_dragbegin_resize_dragedgebuttonroot_xroot_ytimestampedge :the edge or corner from which the drag is
startedbutton :the mouse button being used to
dragroot_x :the root window X coordinate of the mouse click
that began the dragroot_y :the root window Y coordinate of the mouse click
that began the dragtimestamp :the timestamp of the mouse click that began the
drag (use the gtk.gdk.Event.get_time()
method)The begin_resize_drag() method begins a
window resize operation (for a toplevel gtk.gdk.Window) from
the specified edge using the specified
button starting at the location specified by
root_x and root_y. The value
of edge must be one of the .You might use this
method to implement a "window resize grip," for example; in fact the gtk.Statusbar
uses it. The method works best with window managers that support the
Extended Window Manager Hints spec (see http://www.freedesktop.org),
but has a fallback implementation for other window managers.gtk.gdk.Window.begin_move_dragbegin_move_dragbuttonroot_xroot_ytimestampbutton :the button being used to
dragroot_x :the root window X coordinate of the mouse click
that began the dragroot_y :the root window Y coordinate of the mouse click
that began the dragtimestamp :the timestamp of the mouse click that began the
dragThe begin_move_drag() method begins a
window move operation (for a toplevel window) using the specified
button starting at the location specified by
root_x and root_y. You might
use this method to implement a "window move grip," for example. The method
works best with window managers that support the Extended Window Manager
Hints spec (see http://www.freedesktop.org),
but has a fallback implementation for other window managers.gtk.gdk.Window.invalidate_rectinvalidate_rectrectinvalidate_childrenrect :the rectangle to
invalidateinvalidate_children :if True invalidate child
gtk.gdk.Window
objectsThe invalidate_rect() method
invalidates the rectangular region specified by rect. If
invalidate_children is True the
child gtk.gdk.Window
object of the window are also invalidated.gtk.gdk.Window.invalidate_regioninvalidate_regionregioninvalidate_childrenregion :a gtk.gdk.Regioninvalidate_children :If True also invalidate child
windowsThis method is available in PyGTK 2.10 and above.The invalidate_region() method adds the
gtk.gdk.Region
specified by region to the update area for the
window. The update area is the region that needs to be redrawn, or the
"dirty region." The call to the process_updates()
method sends one or more expose events to the window, which together
cover the entire update area. An application would normally redraw the
contents of the window in response to those expose events.PyGTK will call the gtk.gdk.window_process_all_updates()
method on your behalf whenever your program returns to the main loop
and becomes idle, so normally there's no need to do that manually, you
just need to invalidate regions that you know should be
redrawn.The invalidate_children parameter
controls whether the region of each child window that intersects
region will also be invalidated. If
False, then the update area for child windows will
remain unaffected.gtk.gdk.Window.get_update_areaget_update_areaReturns :a gtk.gdk.Region
conatining the update area for the windowThis method is available in PyGTK 2.10 and above.The get_update_area() method returns a
gtk.gdk.Region
containing the update area and transfers ownership of the update area from
the window to the caller of the method. That is, after calling this
method, the window will no longer have an invalid/dirty region; the update
area is removed from the window and passed in the returned gtk.gdk.Region. If
a window has no update area, the get_update_area()
method returns None.gtk.gdk.Window.freeze_updatesfreeze_updatesThe freeze_updates() method temporarily
freezes the window such that it won't receive expose events. The window will
begin receiving expose events again when the thaw_updates()
method is called. If the freeze_updates() method
has been called more than once, the thaw_updates()
method must be called an equal number of times to begin processing
exposes.gtk.gdk.Window.thaw_updatesthaw_updatesThe thaw_updates() method thaws a
window frozen with the freeze_updates()
method.gtk.gdk.Window.process_updatesprocess_updatesupdate_childrenupdate_children :if True process updates for
child windowsThe process_updates() method sends one
or more expose events to the window. The areas in each expose event will
cover the entire update area for the window (see the invalidate_rect()
method for details). Normally PyGTK calls the gtk.gdk.window_process_all_updates()
function on your behalf, so there's no need to call this method unless you
want to force expose events to be delivered immediately and synchronously
(vs. the usual case, where PyGTK delivers them in an idle
handler). Occasionally this is useful to produce nicer scrolling behavior,
for example.gtk.gdk.Window.set_accept_focusset_accept_focusaccept_focusaccept_focus :if True, the window should
receive input focusThis method is available in PyGTK 2.4 and above.The set_accept_focus() method sets the
"accept_focus setting to the value of
accept_focus. If accept_focus
is True the window will accept focus; if
False hints to the desktop environment that the window
doesn't want to receive input focus.On X, it is the responsibility of the window manager to
interpret this hint. ICCCM-compliant window manager usually respect
it.gtk.gdk.Window.enable_synchronized_configureenable_synchronized_configureThis method is available in PyGTK 2.6 and above.The enable_synchronized_configure()
method indicates that the application will cooperate with the window system
in synchronizing the window repaint with the window manager during resizing
operations. After an application calls this method, it must call the configure_finished()
method every time it has finished all processing associated with a set of
Configure events. Toplevel GTK+ windows automatically use this
protocol.On X, calling this function makes window participate in the
_NET_WM_SYNC_REQUEST window manager protocol.gtk.gdk.Window.configure_finishedconfigure_finishedThis method is available in PyGTK 2.6 and above.The configure_finished() method signals
to the window system that the application has finished handling all the
Configure events it has received. Window Managers can use this to better
synchronize the frame repaint with the application. GTK+ applications will
automatically call this function when appropriate.This function can only be called if the enable_synchronized_configure()
method was called previously.gtk.gdk.Window.set_focus_on_mapset_focus_on_mapfocus_on_mapfocus_on_map :if True the window should
receive input focus when mapped.This method is available in PyGTK 2.6 and above.The set_focus_on_map() method sets the
a hint for the desktop environment to the value specified by
focus_on_map. If focus_on_map
is True the window sets a hint for the desktop
environment indicating that it would like to receive input focus when
mapped.On X, it is the responsibility of the window manager to
interpret this hint. Window managers following the freedesktop.org window manager
extension specification should respect it.gtk.gdk.Window.set_urgency_hintset_urgency_hinturgenturgent :if True the window requires
urgent user attention.This method is available in PyGTK 2.10 and above.The set_urgency_hint() method sets the
a hint for the desktop environment to the value specified by
urgent. If urgent is
True the window sets a hint for the desktop environment
indicating that it needs urgent user attention.gtk.gdk.Window.move_regionmove_regionregiondxdyregion :the gtk.gdk.Region to movedx :the distance to move horizontallydy :the distance to move verticallyThis method is available in PyGTK 2.10 and above.The move_region() method moves the part
of window indicated by the gtk.gdk.Region
specified by region by
dy pixels in the Y direction and
dx pixels in the X direction. The portions of
region that are not covered by the new position
of region are invalidated.gtk.gdk.Window.shape_combine_regionshape_combine_regionshape_regionoffset_xoffset_yshape_region :the region of the window to leave
opaqueoffset_x :X position of shape_region
in window coordinatesoffset_y :Y position of shape_region
in window coordinatesThis method is available in PyGTK 2.10 and above.The shape_combine_region() method makes
pixels in the window outside of the gtk.gdk.Region
specified by shape_region transparent, so
that the window may be nonrectangular. See the shape_combine_mask()
method to use a bitmap as the mask.If shape_region is
None, the shape will be unset, so the whole window
will be opaque again. offset_x and
offset_y are ignored if
shape_region is None.This method works on both toplevel and child windows.On the X11 platform, this uses an X server extension which is
widely available on most common platforms, but not available on very
old X servers, and occasionally the implementation will be buggy. On
servers without the shape extension, this method will do
nothing.gtk.gdk.Window.input_shape_combine_maskinput_shape_combine_maskmaskxymask :the shape bitmap maskx :the X position of shape mask with respect to
the windowy :the Y position of shape mask with respect to
the windowThis method is available in PyGTK 2.10 and above.The input_shape_combine_mask() method
is similar to the shape_combine_mask()
method but the shape applies only to event handling. Mouse events
which happen while the pointer position corresponds to an unset bit in
the mask will be passed onto the window below this window.An input shape is typically used with RGBA windows. The alpha
channel of the window defines which pixels are invisible and allows
for nicely antialiased borders, and the input shape controls where the
window is "clickable".On the X11 platform, this requires version 1.1 of the shape
extension.gtk.gdk.Window.input_shape_combine_regioninput_shape_combine_regionshape_regionoffset_xoffset_yshape_region :the region of the window to leave
opaqueoffset_x :X position of shape_region
in window coordinatesoffset_y :Y position of shape_region
in window coordinatesThis method is available in PyGTK 2.10 and above.The input_shape_combine_region() method
is similar to the shape_combine_region()
method, but the shape applies only to event handling. Mouse events
which happen while the pointer position corresponds to an unset bit in
shape_region will be passed onto the window
below this window.An input shape is typically used with RGBA windows. The alpha
channel of the window defines which pixels are invisible and allows
for nicely antialiased borders, and the input shape controls where the
window is "clickable".On the X11 platform, this requires version 1.1 of the shape
extension.gtk.gdk.Window.beepbeepThis method is available in PyGTK 2.12 and above.
Emits a short beep associated to window in the appropriate display,
if supported. Otherwise, emits a short beep on the display just as
gtk.gdk.Display.beep().
gtk.gdk.Window.set_compositedset_compositedcompositedcomposited :True to set the window as compositedThis method is available in PyGTK 2.12 and above.
Sets a GdkWindow as composited, or unsets it. Composited windows do
not automatically have their contents drawn to the screen. Drawing is
redirected to an offscreen buffer and an expose event is emitted on
the parent of the composited window. It is the responsibility of the
parent's expose handler to manually merge the off-screen content onto
the screen in whatever way it sees fit.
It only makes sense for child windows to be composited; see
gtk.gdk.Window.set_opacity()
if you need translucent toplevel windows.
An additional effect of this call is that the area of this window is no longer
clipped from regions marked for invalidation on its parent. Draws done on the
parent window are also no longer clipped by the child.
This call is only supported on some systems (currently, only X11 with
new enough Xcomposite and Xdamage extensions). You must call
gtk.gdk.Display.supports_composite()
to check if setting a window as composited is supported before attempting to do so.
gtk.gdk.Window.set_opacityset_opacityopacityopacity :The opacity value.This method is available in PyGTK 2.12 and above.
Request the windowing system to make window partially transparent, with
opacity 0 being fully transparent and 1 fully opaque.
Values of the opacity parameter are clamped to the [0,1] range.)
On X11, this works only on X screens with a compositing manager running.
For setting up per-pixel alpha, see
gtk.gdk.Screen.get_rgba_colormap().
For making non-toplevel windows translucent, see
gtk.gdk.Window.set_composited().
gtk.gdk.Window.set_startup_idset_startup_idstartup_idstartup_id :A string with startup-notification identifier.This method is available in PyGTK 2.12 and above.
When using GTK+, typically you should use
gtk.Window.set_startup_id()
instead of this low-level function.
gtk.gdk.Window.remove_redirectionremove_redirectionThis method is available in PyGTK 2.14 and above.
When using GTK+, typically you should use
gtk.Window.set_startup_id()
instead of this low-level function.
Functionsgtk.gdk.window_foreign_newgtk.gdk.window_foreign_newanidanid :a native window system IDReturns :the new gtk.gdk.Window
wrapper for the native window or None if the window has
been destroyed.The gtk.gdk.window_foreign_new() function
wraps a native window specified by anid for the default display in a gtk.gdk.Window. This
may fail if the window has been destroyed. For example in the X Window
System backend, a native window handle is an Xlib
XID.gtk.gdk.window_foreign_new_for_displaygtk.gdk.window_foreign_new_for_displaydisplayaniddisplay :a gtk.gdk.Displayanid :a native window system IDReturns :the new gtk.gdk.Window
wrapper for the native window or None if the window has
been destroyed.This function is available in PyGTK 2.2 and above.The
gtk.gdk.window_foreign_new_for_display() function wraps
a native window specified by anid for the gtk.gdk.Display
specified by display in a gtk.gdk.Window. This
may fail if the window has been destroyed. For example in the X Window
System backend, a native window handle is an Xlib
XID.gtk.gdk.get_default_root_windowgtk.gdk.get_default_root_windowReturns : the default root gtk.gdk.WindowThe gtk.gdk.get_default_root_window()
function returns the root gtk.gdk.Window (the
parent window that all other windows are inside) for the default display and
screen.gtk.gdk.window_get_toplevelsgtk.gdk.window_get_toplevelsReturns :a list containing the toplevel gtk.gdk.Window
objectThe gtk.gdk.window_get_toplevels() function
returns a list of all toplevel windows known to PyGTK on
the default screen. A toplevel window is a child of the root window (see the
gtk.gdk.get_default_root_window()
function).gtk.gdk.window_lookupgtk.gdk.window_lookupanidanid :a native window system IDReturns :the gtk.gdk.Window
wrapper for the native window or None if there is
none.The gtk.gdk.window_lookup() function looks
up the gtk.gdk.Window that
wraps the native window handle specified by anid. For
example in the X Window System backend, a native window handle is an Xlib
XID.gtk.gdk.window_lookup_for_displaygtk.gdk.window_lookup_for_displaydisplayaniddisplay :a gtk.gdk.Displayanid :a native window system IDReturns :the gtk.gdk.Window
wrapper for the native window or None if there is
none.This function is available in PyGTK 2.2 and above.The gtk.gdk.window_lookup_for_display()
function looks up the gtk.gdk.Window that
wraps the native window handle specified by anid for
the gtk.gdk.Display
specified by display. For example in the X Window
System backend, a native window handle is an Xlib
XID.gtk.gdk.window_process_all_updatesgtk.gdk.window_process_all_updatesThe gtk.gdk.process_all_updates() function
calls the process_updates()
method for each gtk.gdk.Window in
the application.gtk.gdk.gdk_window_set_debug_updatesgtk.gdk.gdk_window_set_debug_updatessettingsetting :if True enable update
debuggingThe gtk.gdk.gdk_set_debug_updates() function
sets the update debugging flag to the value of
setting. If setting is
True, update debugging is enabled. With update debugging
enabled, calls to the invalidate_rect()
method clear the invalidated rectangle of the screen to a noticeable color,
and PyGTK pauses for a short time before sending exposes
to windows during the process_updates()
method. The net effect is that you can see the invalid region for each
window and watch redraws as they occur. This allows you to diagnose
inefficiencies in your application.In essence, because the
GDK rendering model prevents all flicker, if you are
redrawing the same region 400 times you may never notice, aside from
noticing a speed problem. Enabling update debugging causes
PyGTK to flicker slowly and noticeably, so you can see
exactly what's being redrawn when, in what order.The command line option
passed to PyGTK programs enables this debug option at
application startup time. That's usually more useful than calling
gtk.gdk.gdk_set_debug_updates() yourself, though you might
want to use this function to enable updates sometime after application
startup time.gtk.gdk.window_at_pointergtk.gdk.window_at_pointerReturns :a 3 tuple containing the gtk.gdk.Window
and the pointer location in the window or
None.This function is available in PyGTK 2.4 and above.The gtk.gdk.window_at_pointer() function
returns a 3-tuple containing the gtk.gdk.Window
underneath the mouse pointer, and the location of the pointer in the
window. This function returns None if the window under
the mouse pointer is not known to GDK (if the window belongs to another
application and a gtk.gdk.Window
hasn't been created for it with the gtk.gdk.window_foreign_new()
function)For multi-head-aware widgets or applications use the gtk.gdk.Display.get_window_at_pointer()
method instead.