<?xml version="1.0" standalone="no"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
    "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">

<refentry id="gdk-functions">
  <refnamediv>
    <refname>gtk.gdk Functions</refname>
    <refpurpose>the gtk.gdk module functions</refpurpose>
  </refnamediv>

  <refsect1>
    <title>Synopsis</title>

    <refsect2>
      <title><link linkend="class-gdkatom"><classname>gtk.gdk.Atom</classname></link> Functions</title>

      <programlisting><methodsynopsis language="python">
	<methodname><link
linkend="constructor-gdkatom-intern">gtk.gdk.atom_intern</link></methodname>
	<methodparam><parameter role="keyword">name</parameter></methodparam>
	<methodparam><parameter role="keyword">only_if_exists</parameter><initializer>False</initializer></methodparam>
  </methodsynopsis></programlisting>

    </refsect2>

    <refsect2>
      <title><link linkend="class-gdkcolor"><classname>gtk.gdk.Color</classname></link> Functions</title>

      <programlisting><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--color-parse">gtk.gdk.color_parse</link></methodname>
	<methodparam><parameter
		       role="keyword">spec</parameter></methodparam>
      </methodsynopsis></programlisting>

    </refsect2>

    <refsect2>
      <title><link linkend="class-gdkcolormap"><classname>gtk.gdk.Colormap</classname></link> Functions</title>

      <programlisting><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--colormap-get-system">gtk.gdk.colormap_get_system</link></methodname>
	<methodparam></methodparam>
  </methodsynopsis></programlisting>

    </refsect2>

    <refsect2>
      <title><link linkend="class-gdkdevice"><classname>gtk.gdk.Device</classname></link> Functions</title>

      <programlisting><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--devices-list">gtk.gdk.devices_list</link></methodname>
	<methodparam></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--device-get-core-pointer">gtk.gdk.device_get_core_pointer</link></methodname>
	<methodparam></methodparam>
  </methodsynopsis></programlisting>

    </refsect2>

    <refsect2>
      <title><link linkend="class-gdkdisplay"><classname>gtk.gdk.Display</classname></link> Functions</title>

      <programlisting><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--display-get-default">gtk.gdk.display_get_default</link></methodname>
	<methodparam></methodparam>
  </methodsynopsis></programlisting>

    </refsect2>

    <refsect2>
      <title><link linkend="class-gdkdisplaymanager"><classname>gtk.gdk.DisplayManager</classname></link> Functions</title>

      <programlisting><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--display-manager-get">gtk.gdk.display_manager_get</link></methodname>
	<methodparam></methodparam>
  </methodsynopsis></programlisting>

    </refsect2>

    <refsect2>
      <title><link linkend="class-gdkevent"><classname>gtk.gdk.Event</classname></link> Functions</title>

      <programlisting><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--events-pending">gtk.gdk.events_pending</link></methodname>
	<methodparam></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--event-peek">gtk.gdk.event_peek</link></methodname>
	<methodparam></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--event-get">gtk.gdk.event_get</link></methodname>
	<methodparam></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--event-get-graphics-expose">gtk.gdk.event_get_graphics_expose</link></methodname>
	<methodparam><parameter
		       role="keyword">window</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--set-show-events">gtk.gdk.set_show_events</link></methodname>
	<methodparam><parameter
		       role="keyword">show_events</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--get-show-events">gtk.gdk.get_show_events</link></methodname>
	<methodparam></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--event-handler-set">gtk.gdk.event_handler_set</link></methodname>
	<methodparam><parameter>func</parameter></methodparam>
	<methodparam><parameter>data</parameter><initializer>None</initializer></methodparam>
      </methodsynopsis></programlisting>

    </refsect2>

    <refsect2>
      <title><link linkend="class-gdkkeymap"><classname>gtk.gdk.Keymap</classname></link> Functions</title>

      <programlisting><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--keymap-get-default">gtk.gdk.keymap_get_default</link></methodname>
	<methodparam></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--keymap-get-for-display">gtk.gdk.keymap_get_for_display</link></methodname>
	<methodparam><parameter role="keyword">display</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--keyval-name">gtk.gdk.keyval_name</link></methodname>
	<methodparam><parameter role="keyword">keyval</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--keyval-from-name">gtk.gdk.keyval_from_name</link></methodname>
	<methodparam><parameter role="keyword">keyval_name</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--keyval-convert-case">gtk.gdk.keyval_convert_case</link></methodname>
	<methodparam><parameter role="keyword">symbol</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--keyval-to-upper">gtk.gdk.keyval_to_upper</link></methodname>
	<methodparam><parameter role="keyword">keyval</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--keyval-to-lower">gtk.gdk.keyval_to_lower</link></methodname>
	<methodparam><parameter role="keyword">keyval</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--keyval-is-upper">gtk.gdk.keyval_is_upper</link></methodname>
	<methodparam><parameter role="keyword">keyval</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--keyval-is-lower">gtk.gdk.keyval_is_lower</link></methodname>
	<methodparam><parameter role="keyword">keyval</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--keyval-to-unicode">gtk.gdk.keyval_to_unicode</link></methodname>
	<methodparam><parameter role="keyword">keyval</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--unicode-to-keyval">gtk.gdk.unicode_to_keyval</link></methodname>
	<methodparam><parameter role="keyword">wc</parameter></methodparam>
  </methodsynopsis></programlisting>

    </refsect2>

    <refsect2>
      <title><link linkend="class-gdkpangorenderer"><classname>gtk.gdk.PangoRenderer</classname></link> Functions</title>

      <programlisting><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--gdk-pango-renderer-get-default">gtk.gdk.gdk_pango_renderer_get_default</link></methodname>
	<methodparam><parameter role="keyword">screen</parameter></methodparam>
  </methodsynopsis></programlisting>

    </refsect2>

    <refsect2>
      <title><link linkend="class-gdkpixbuf"><classname>gtk.gdk.Pixbuf</classname></link> Functions</title>

    <programlisting><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--pixbuf-new-from-file">gtk.gdk.pixbuf_new_from_file</link></methodname>
	<methodparam><parameter role="keyword">filename</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--pixbuf-new-from-file-at-size">gtk.gdk.pixbuf_new_from_file_at_size</link></methodname>
	<methodparam><parameter role="keyword">filename</parameter></methodparam>
	<methodparam><parameter role="keyword">width</parameter></methodparam>
	<methodparam><parameter role="keyword">height</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--pixbuf-new-from-data">gtk.gdk.pixbuf_new_from_data</link></methodname>
	<methodparam><parameter role="keyword">data</parameter></methodparam>
	<methodparam><parameter role="keyword">colorspace</parameter></methodparam>
	<methodparam><parameter role="keyword">has_alpha</parameter></methodparam>
	<methodparam><parameter role="keyword">bits_per_sample</parameter></methodparam>
	<methodparam><parameter role="keyword">width</parameter></methodparam>
	<methodparam><parameter role="keyword">height</parameter></methodparam>
	<methodparam><parameter role="keyword">rowstride</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--pixbuf-new-from-array">gtk.gdk.pixbuf_new_from_array</link></methodname>
	<methodparam><parameter role="keyword">array</parameter></methodparam>
	<methodparam><parameter role="keyword">colorspace</parameter></methodparam>
	<methodparam><parameter role="keyword">bits_per_sample</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--pixbuf-new-from-xpm-data">gtk.gdk.pixbuf_new_from_xpm_data</link></methodname>
	<methodparam><parameter role="keyword">data</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--pixbuf-new-from-inline">gtk.gdk.pixbuf_new_from_inline</link></methodname>
	<methodparam><parameter role="keyword">data_length</parameter></methodparam>
	<methodparam><parameter role="keyword">data</parameter></methodparam>
	<methodparam><parameter role="keyword">copy_pixels</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--pixbuf-get-formats">gtk.gdk.pixbuf_get_formats</link></methodname>
	<methodparam><parameter role="keyword"></parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--pixbuf-get-file-info">gtk.gdk.pixbuf_get_file_info</link></methodname>
	<methodparam><parameter role="keyword">filename</parameter></methodparam>
  </methodsynopsis></programlisting>

    </refsect2>

    <refsect2>
      <title><link linkend="class-gdkpixbufloader"><classname>gtk.gdk.PixbufLoader</classname> Functions</link></title>

      <programlisting><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--pixbuf-loader-new-with-mime-type">gtk.gdk.pixbuf_loader_new_with_mime_type</link></methodname>
	<methodparam><parameter role="keyword">mime_type</parameter></methodparam>
  </methodsynopsis></programlisting>

    </refsect2>
    
    <refsect2>
      <title><link linkend="class-gdkpixmap"><classname>gtk.gdk.Pixmap</classname></link> Functions</title>

      <programlisting><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--bitmap-create-from-data">gtk.gdk.bitmap_create_from_data</link></methodname>
	<methodparam><parameter role="keyword">drawable</parameter></methodparam>
	<methodparam><parameter role="keyword">data</parameter></methodparam>
	<methodparam><parameter role="keyword">width</parameter></methodparam>
	<methodparam><parameter role="keyword">height</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--pixmap-create-from-data">gtk.gdk.pixmap_create_from_data</link></methodname>
	<methodparam><parameter role="keyword">drawable</parameter></methodparam>
	<methodparam><parameter role="keyword">data</parameter></methodparam>
	<methodparam><parameter role="keyword">width</parameter></methodparam>
	<methodparam><parameter role="keyword">height</parameter></methodparam>
	<methodparam><parameter role="keyword">depth</parameter></methodparam>
	<methodparam><parameter role="keyword">fg</parameter></methodparam>
	<methodparam><parameter role="keyword">bg</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--pixmap-create-from-xpm">gtk.gdk.pixmap_create_from_xpm</link></methodname>
	<methodparam><parameter role="keyword">window</parameter></methodparam>
	<methodparam><parameter role="keyword">transparent_color</parameter></methodparam>
	<methodparam><parameter role="keyword">filename</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--pixmap-colormap-create-from-xpm">gtk.gdk.pixmap_colormap_create_from_xpm</link></methodname>
	<methodparam><parameter role="keyword">window</parameter></methodparam>
	<methodparam><parameter role="keyword">colormap</parameter></methodparam>
	<methodparam><parameter role="keyword">transparent_color</parameter></methodparam>
	<methodparam><parameter role="keyword">filename</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--pixmap-create-from-xpm-d">gtk.gdk.pixmap_create_from_xpm_d</link></methodname>
	<methodparam><parameter role="keyword">window</parameter></methodparam>
	<methodparam><parameter role="keyword">transparent_color</parameter></methodparam>
	<methodparam><parameter role="keyword">data</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--pixmap-colormap-create-from-xpm-d">gtk.gdk.pixmap_colormap_create_from_xpm_d</link></methodname>
	<methodparam><parameter role="keyword">window</parameter></methodparam>
	<methodparam><parameter role="keyword">colormap</parameter></methodparam>
	<methodparam><parameter role="keyword">transparent_color</parameter></methodparam>
	<methodparam><parameter role="keyword">data</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--pixmap-foreign-new">gtk.gdk.pixmap_foreign_new</link></methodname>
	<methodparam><parameter role="keyword">anid</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--pixmap-lookup">gtk.gdk.pixmap_lookup</link></methodname>
	<methodparam><parameter role="keyword">anid</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--pixmap-foreign-new-for-display">gtk.gdk.pixmap_foreign_new_for_display</link></methodname>
	<methodparam><parameter role="keyword">display</parameter></methodparam>
	<methodparam><parameter role="keyword">anid</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--pixmap-lookup-for-display">gtk.gdk.pixmap_lookup_for_display</link></methodname>
	<methodparam><parameter role="keyword">display</parameter></methodparam>
	<methodparam><parameter role="keyword">anid</parameter></methodparam>
  </methodsynopsis></programlisting>

    </refsect2>

    <refsect2>
      <title><link linkend="class-gdkregion"><classname>gtk.gdk.Region</classname></link> Functions</title>

      <programlisting><methodsynopsis language="python">
        <methodname><link
                        linkend="function-gdk--region-rectangle">gtk.gdk.region_rectangle</link></methodname>
        <methodparam><parameter
                         role="keyword">rectangle</parameter></methodparam>
      </methodsynopsis></programlisting>

    </refsect2>

<refsect2>
      <title><link linkend="class-gdkscreen"><classname>gtk.gdk.Screen</classname></link> Functions</title>

      <programlisting><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--screen-width">gtk.gdk.screen_width</link></methodname>
	<methodparam></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--screen-height">gtk.gdk.screen_height</link></methodname>
	<methodparam></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--screen-width-mm">gtk.gdk.screen_width_mm</link></methodname>
	<methodparam></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--screen-height-mm">gtk.gdk.screen_height_mm</link></methodname>
	<methodparam></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--screen-get-default">gtk.gdk.screen_get_default</link></methodname>
	<methodparam><parameter role="keyword"></parameter></methodparam>
  </methodsynopsis></programlisting>

    </refsect2>

    <refsect2>
      <title><link linkend="class-gdkvisual"><classname>gtk.gdk.Visual</classname></link> Functions</title>

      <programlisting><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--list-visuals">gtk.gdk.list_visuals</link></methodname>
	<methodparam><parameter role="keyword"></parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--visual-get-best">gtk.gdk.visual_get_best</link></methodname>
	<methodparam><parameter role="keyword"></parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--visual-get-best-depth">gtk.gdk.visual_get_best_depth</link></methodname>
	<methodparam><parameter role="keyword"></parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--visual-get-best-type">gtk.gdk.visual_get_best_type</link></methodname>
	<methodparam><parameter role="keyword"></parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--visual-get-best-with-depth">gtk.gdk.visual_get_best_with_depth</link></methodname>
	<methodparam><parameter role="keyword">depth</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--visual-get-best-with-type">gtk.gdk.visual_get_best_with_type</link></methodname>
	<methodparam><parameter role="keyword">type</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--visual-get-system">gtk.gdk.visual_get_system</link></methodname>
	<methodparam><parameter role="keyword"></parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--query-depths">gtk.gdk.query_depths</link></methodname>
	<methodparam><parameter role="keyword"></parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--query-visual-types">gtk.gdk.query_visual_types</link></methodname>
	<methodparam><parameter role="keyword"></parameter></methodparam>
  </methodsynopsis></programlisting>

    </refsect2>

    <refsect2>
    <title><link linkend="class-gdkwindow"><classname>gtk.gdk.Window</classname></link> Functions</title>

      <programlisting><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--window-foreign-new">gtk.gdk.window_foreign_new</link></methodname>
	<methodparam><parameter role="keyword">anid</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--window-foreign-new-for-display">gtk.gdk.window_foreign_new_for_display</link></methodname>
	<methodparam><parameter role="keyword">display</parameter></methodparam>
	<methodparam><parameter role="keyword">anid</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--get-default-root-window">gtk.gdk.get_default_root_window</link></methodname>
	<methodparam><parameter role="keyword"></parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--window-get-toplevels">gtk.gdk.window_get_toplevels</link></methodname>
	<methodparam><parameter role="keyword"></parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--window-lookup">gtk.gdk.window_lookup</link></methodname>
	<methodparam><parameter role="keyword">anid</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--window-lookup-for-display">gtk.gdkwindow_lookup_for_display.</link></methodname>
	<methodparam><parameter role="keyword">display</parameter></methodparam>
	<methodparam><parameter role="keyword">anid</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--window-process-all-updates">gtk.gdk.window_process_all_updates</link></methodname>
	<methodparam><parameter role="keyword"></parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--gdk-window-set-debug-updates">gtk.gdk.gdk_window_set_debug_updates</link></methodname>
	<methodparam><parameter role="keyword"></parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--window-at-pointer">gtk.gdk.window_at_pointer</link></methodname>
	<methodparam><parameter role="keyword"></parameter></methodparam>
  </methodsynopsis></programlisting>

    </refsect2>

    <refsect2>
      <title>Miscellaneous Functions</title>

      <programlisting><methodsynopsis language="python">
        <methodname><link
                        linkend="function-gdk--pointer-grab">gtk.gdk.pointer_grab</link></methodname>
        <methodparam><parameter
                         role="keyword">window</parameter></methodparam>
        <methodparam><parameter
                         role="keyword">owner_events</parameter>
        <initializer>False</initializer></methodparam>
        <methodparam><parameter
                         role="keyword">event_mask</parameter>
        <initializer>0</initializer></methodparam>
        <methodparam><parameter
                         role="keyword">confine_to</parameter>
        <initializer>None</initializer></methodparam>
        <methodparam><parameter
                         role="keyword">cursor</parameter>
        <initializer>None</initializer></methodparam>
        <methodparam><parameter
                         role="keyword">time</parameter>
        <initializer>0L</initializer></methodparam>
        </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--pointer-ungrab">gtk.gdk.pointer_ungrab</link></methodname>
	<methodparam><parameter
		       role="keyword">time</parameter>
	  <initializer>0L</initializer></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--keyboard-grab">gtk.gdk.keyboard_grab</link></methodname>
	<methodparam><parameter
		       role="keyword">window</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">owner_events</parameter>
	  <initializer>False</initializer></methodparam>
	<methodparam><parameter
		       role="keyword">time</parameter>
	  <initializer>0L</initializer></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--keyboard-ungrab">gtk.gdk.keyboard_ungrab</link></methodname>
	<methodparam><parameter
		       role="keyword">time</parameter>
	  <initializer>0L</initializer></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--pointer-is-grabbed">gtk.gdk.pointer_is_grabbed</link></methodname>
	<methodparam></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--flush">gtk.gdk.flush</link></methodname>
	<methodparam></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--beep">gtk.gdk.beep</link></methodname>
	<methodparam></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--set-double-click-time">gtk.gdk.set_double_click_time</link></methodname>
	<methodparam><parameter
		       role="keyword">msec</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--threads-enter">gtk.gdk.threads_enter</link></methodname>
	<methodparam></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--threads-leave">gtk.gdk.threads_leave</link></methodname>
	<methodparam></methodparam>
  </methodsynopsis><synopsis language="python">
	  <varname><link
linkend="function-gdk--lock">gtk.gdk.lock</link></varname>
  </synopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--threads-init">gtk.gdk.threads_init</link></methodname>
	<methodparam></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--rgb-ditherable">gtk.gdk.rgb_ditherable</link></methodname>
	<methodparam></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--rgb-get-colormap">gtk.gdk.rgb_get_colormap</link></methodname>
	<methodparam></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--rgb-set-verbose">gtk.gdk.rgb_set_verbose</link></methodname>
	<methodparam><parameter
		       role="keyword">verbose</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--rgb-set-install">gtk.gdk.rgb_set_install</link></methodname>
	<methodparam><parameter
		       role="keyword">install</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--rgb-set-min-colors">gtk.gdk.rgb_set_min_colors</link></methodname>
	<methodparam><parameter
		       role="keyword">min_colors</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--rgb-get-visual">gtk.gdk.rgb_get_visual</link></methodname>
	<methodparam></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--selection-owner-get">gtk.gdk.selection_owner_get</link></methodname>
	<methodparam><parameter
		       role="keyword">selection</parameter></methodparam>
  </methodsynopsis>
  
  <methodsynopsis language="python">
	<methodname><link linkend="function-gdk--selection-owner-get-for-display">gtk.gdk.selection_owner_get_for_display</link></methodname>
	<methodparam><parameter role="keyword">display</parameter></methodparam>
	<methodparam><parameter role="keyword">selection</parameter></methodparam>
  </methodsynopsis>
  
  <methodsynopsis language="python">
	<methodname><link linkend="function-gdk--selection-owner-set-for-display">gtk.gdk.selection_owner_set_for_display</link></methodname>
	<methodparam><parameter role="keyword">display</parameter></methodparam>
	<methodparam><parameter role="keyword">owner</parameter></methodparam>
	<methodparam><parameter role="keyword">selection</parameter></methodparam>
	<methodparam><parameter role="keyword">time</parameter></methodparam>
	<methodparam><parameter role="keyword">send_event</parameter></methodparam>
  </methodsynopsis>
  
  <methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--selection-send-notify">gtk.gdk.selection_send_notify</link></methodname>
	<methodparam><parameter
		       role="keyword">requestor</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">selection</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">target</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">property</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">time</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--set-sm-client-id">gtk.gdk.set_sm_client_id</link></methodname>
	<methodparam><parameter
		       role="keyword">sm_client_id</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--notify-startup-complete">gtk.gdk.notify_startup_complete</link></methodname>
	<methodparam></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--get-program-class">gtk.gdk.get_program_class</link></methodname>
	<methodparam></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--set-program-class">gtk.gdk.set_program_class</link></methodname>
	<methodparam><parameter
		       role="keyword">program_class</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--get-display">gtk.gdk.get_display</link></methodname>
	<methodparam></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--get-display-arg-name">gtk.gdk.get_display_arg_name</link></methodname>
	<methodparam></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--pango-context-get-for-screen">gtk.gdk.pango_context_get_for_screen</link></methodname>
	<methodparam><parameter
		       role="keyword">screen</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--pango-context-get">gtk.gdk.pango_context_get</link></methodname>
  </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--x11-display-get-startup-notification-id">gtk.gdk.x11_display_get_startup_notification_id</link></methodname>
  <methodparam><parameter
		       role="keyword">display</parameter></methodparam>
  </methodsynopsis></programlisting>

    </refsect2>

  </refsect1>

  <refsect1>
    <title>Description</title>

    <para>These functions are part of the <literal>PyGTK</literal> gtk.gdk
module. All the functions are listed above with links to the function
description. Most functions are associated with a specific object class and
their descriptions are part of the class reference. Those functions that are
not directly associated with a specific class have their descriptions
below.</para>

  </refsect1>

  <refsect1>
    <title>Functions</title>

    <refsect2 id="function-gdk--pointer-grab">
      <title>gtk.gdk.pointer_grab</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>gtk.gdk.pointer_grab</methodname>
	  <methodparam><parameter
			 role="keyword">window</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">owner_events</parameter>
	    <initializer>False</initializer></methodparam>
	  <methodparam><parameter
			 role="keyword">event_mask</parameter>
	    <initializer>0</initializer></methodparam>
	  <methodparam><parameter
			 role="keyword">confine_to</parameter>
	    <initializer>None</initializer></methodparam>
	  <methodparam><parameter
			 role="keyword">cursor</parameter>
	    <initializer>None</initializer></methodparam>
	  <methodparam><parameter
			 role="keyword">time</parameter>
	    <initializer>0L</initializer></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">window</parameter>&nbsp;:</term>
	  <listitem><simpara>the <link
linkend="class-gdkwindow"><classname>gtk.gdk.Window</classname></link> that
will own the grab (the grab window).</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">owner_events</parameter>&nbsp;:</term>
	  <listitem><simpara>if <literal>False</literal> then all pointer
events are reported with respect to <parameter>window</parameter> and are
only reported if selected by <parameter>event_mask</parameter>. If
<literal>True</literal> then pointer events for this application are
reported as normal, but pointer events outside this application are reported
with respect to <parameter>window</parameter> and only if selected by
<parameter>event_mask</parameter>. In either mode, unreported events are
discarded.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">event_mask</parameter>&nbsp;:</term>
	  <listitem><simpara>specifies the event mask, that is used in
accordance with <parameter>owner_events</parameter>.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">confine_to</parameter>&nbsp;:</term>
	  <listitem><simpara>If not <literal>None</literal>, the pointer
will be confined to this <link
linkend="class-gdkwindow"><classname>gtk.gdk.Window</classname></link>
during the grab. If the pointer is outside
<parameter>confine_to</parameter>, it will automatically be moved to the
closest edge of <parameter>confine_to</parameter> and enter and leave events
will be generated as necessary.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">cursor</parameter>&nbsp;:</term>
	  <listitem><simpara>the <link
linkend="class-gdkcursor"><classname>gtk.gdk.Cursor</classname></link> to
display while the grab is active. If this is None then the normal cursors
are used for <parameter>window</parameter> and its descendants, and the
cursor for <parameter>window</parameter> is used for all other
windows.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">time</parameter>&nbsp;:</term>
	  <listitem><simpara>the timestamp of the event that led to this
pointer grab. This usually comes from a <link
linkend="class-gdkevent"><classname>gtk.gdk.Event</classname></link>, though
0L can be used to use the current time if the time isn't
known.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a grab status value</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <function>gtk.gdk.pointer_grab</function>() function grabs
the pointer (usually a mouse) so that all events are passed to this
application until the pointer is ungrabbed with the <link
linkend="function-gdk--pointer-ungrab"><function>gtk.gdk.pointer_ungrab</function>()</link>, 
or the grab window becomes unviewable. This overrides any previous pointer
grab by this client. This function returns a grab status value:</para>

      <variablelist>
	<varlistentry>
	  <term><literal>gtk.gdk.GRAB_SUCCESS</literal></term>
	  <listitem>
	    <simpara>The resource was successfully grabbed.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>gtk.gdk.GRAB_ALREADY_GRABBED</literal></term>
	  <listitem>
	    <simpara>The resource is actively grabbed by another
client.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>gtk.gdk.GRAB_INVALID_TIME</literal></term>
	  <listitem>
	    <simpara>The resource was grabbed more recently than the
specified time.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>gtk.gdk.GRAB_NOT_VIEWABLE</literal></term>
	  <listitem>
	    <simpara>The grab window or the
<parameter>confine_to</parameter> window are not viewable.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>gtk.gdk.GRAB_FROZEN</literal></term>
	  <listitem>
	    <simpara>The resource is frozen by an active grab of another
client.</simpara>
	  </listitem>
	</varlistentry>
      </variablelist>

      <para>Pointer grabs are used for operations that need complete
control over mouse events, even if the mouse leaves the application. For
example it is used for drag and drop, for dragging the handle in the <link
linkend="class-gtkhpaned"><classname>gtk.HPaned</classname></link> and <link
linkend="class-gtkvpaned"><classname>gtk.VPaned</classname></link> widgets.
Note that if the event mask of an X window has selected both button press
and button release events, then a button press event will cause an automatic
pointer grab until the button is released. X does this automatically since
most applications expect to receive button press and release events in
pairs. It is equivalent to a pointer grab on the window with
<parameter>owner_events</parameter> set to <literal>True</literal>.</para>

    </refsect2>

    <refsect2 id="function-gdk--pointer-ungrab">
      <title>gtk.gdk.pointer_ungrab</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>gtk.gdk.pointer_ungrab</methodname>
	  <methodparam><parameter
			 role="keyword">time</parameter>
	    <initializer>0L</initializer></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">time</parameter>&nbsp;:</term>
	  <listitem><simpara>a timestamp from a <link
linkend="class-gdkevent"><classname>gtk.gdk.Event</classname></link> or 0L
to use the current time</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <function>gtk.gdk.pointer_ungrab</function>() function
ungrabs the pointer if it is grabbed by this application.</para>

    </refsect2>

    <refsect2 id="function-gdk--keyboard-grab">
      <title>gtk.gdk.keyboard_grab</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>gtk.gdk.keyboard_grab</methodname>
	  <methodparam><parameter
			 role="keyword">window</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">owner_events</parameter>
	    <initializer>False</initializer></methodparam>
	  <methodparam><parameter
			 role="keyword">time</parameter>
	    <initializer>0L</initializer></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">window</parameter>&nbsp;:</term>
	  <listitem><simpara>the <link
linkend="class-gdkwindow"><classname>gtk.gdk.Window</classname></link> that
will own the grab (the grab window).</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">owner_events</parameter>&nbsp;:</term>
	  <listitem><simpara>if <literal>False</literal> then all keyboard
events are reported with respect to <parameter>window</parameter>. If
<literal>True</literal> then keyboard events for this application are
reported as normal, but keyboard events outside this application are
reported with respect to <parameter>window</parameter>. Both key press and
key release events are always reported, independent of the event mask set by
the application.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">time</parameter>&nbsp;:</term>
	  <listitem><simpara>a timestamp from a <link
linkend="class-gdkevent"><classname>gtk.gdk.Event</classname></link> or 0L
to use the current time</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a grab status value</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <function>gtk.gdk.keyboard_grab</function>() function grabs
the keyboard so that all events are passed to this application until the
keyboard is ungrabbed with the <link
linkend="function-gdk--keyboard-ungrab"><function>gtk.gdk.keyboard_ungrab</function>()</link>) 
function. This overrides any previous keyboard grab by this client.</para>

    </refsect2>

    <refsect2 id="function-gdk--keyboard-ungrab">
      <title>gtk.gdk.keyboard_ungrab</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>gtk.gdk.keyboard_ungrab</methodname>
	  <methodparam><parameter
			 role="keyword">time</parameter>
	    <initializer>0L</initializer></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">time</parameter>&nbsp;:</term>
	  <listitem><simpara>a timestamp from a <link
linkend="class-gdkevent"><classname>gtk.gdk.Event</classname></link> or 0L
to use the current time</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <function>gtk.gdk.keyboard_ungrab</function>() function
ungrabs the keyboard if it is grabbed by this application.</para>

    </refsect2>

    <refsect2 id="function-gdk--pointer-is-grabbed">
      <title>gtk.gdk.pointer_is_grabbed</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>gtk.gdk.pointer_is_grabbed</methodname>
	  <methodparam></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the pointer is
currently grabbed by this application.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <function>gtk.gdk.pointer_is_grabbed</function>() function
returns <literal>True</literal> if the pointer is currently grabbed by this
application. Note that this does not take the implicit pointer grab on
button presses into account.</para>

    </refsect2>

    <refsect2 id="function-gdk--flush">
      <title>gtk.gdk.flush</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>gtk.gdk.flush</methodname>
	  <methodparam><parameter
			 role="keyword"></parameter></methodparam>
	</methodsynopsis></programlisting>

      <para>The <function>gtk.gdk.flush</function>() function flushes the X
output buffer and waits until all requests have been processed by the
server. This is rarely needed by applications.</para>

    </refsect2>

    <refsect2 id="function-gdk--beep">
      <title>gtk.gdk.beep</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>gtk.gdk.beep</methodname>
	  <methodparam></methodparam>
	</methodsynopsis></programlisting>

      <para>The <function>gtk.gdk.beep</function>() function emits a short
beep.</para>

    </refsect2>

    <refsect2 id="function-gdk--set-double-click-time">
      <title>gtk.gdk.set_double_click_time</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>gtk.gdk.set_double_click_time</methodname>
	  <methodparam><parameter
			 role="keyword">msec</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter
role="keyword">msec</parameter>&nbsp;:</term>
	  <listitem><simpara>the double click time in
milliseconds</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <function>gtk.gdk.set_double_click_time</function>()
function set the double click time for the default display. Applications
should NOT set this, it is a global user-configured setting.</para>

    </refsect2>

    <refsect2 id="function-gdk--threads-enter">
      <title>gtk.gdk.threads_enter</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>gtk.gdk.threads_enter</methodname>
	  <methodparam></methodparam>
	</methodsynopsis></programlisting>

      <para>The <function>gtk.gdk.threads_enter</function>() function marks
the beginning of a critical section that only one thread can operate within
at a time. The critical section is guarded by a <literal>GDK</literal>
mutual exclusion lock. Python threads are enabled while waiting for the
<literal>GDK</literal> lock. See the <link
linkend="function-gdk--threads-init"><function>gtk.gtk.threads_init</function>()</link> 
function for more information about threading.</para>

    </refsect2>

    <refsect2 id="function-gdk--threads-leave">
      <title>gtk.gdk.threads_leave</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>gtk.gdk.threads_leave</methodname>
	  <methodparam></methodparam>
	</methodsynopsis></programlisting>

      <para>The <function>gtk.gdk.threads_leave</function>() function marks
the end of a critical section started by the <link
linkend="function-gdk--threads-enter"><function>gtk.gdk.threads_enter</function>()</link> 
function. See the <link
linkend="function-gdk--threads-init"><function>gtk.gtk.threads_init</function>()</link> 
function for more information about threading.</para>

    </refsect2>

    <refsect2 id="function-gdk--lock">
      <title>gtk.gdk.lock</title>

      <programlisting><synopsis language="python">
	  <varname>gtk.gdk.lock</varname>
	</synopsis></programlisting>

      <para>
	The <varname>gtk.gdk.lock</varname> constant is a context manager that calls
	<link linkend="function-gdk--threads-enter"><function>gtk.gdk.threads_enter</function></link>
	and <link linkend="function-gdk--threads-leave"><function>gtk.gdk.threads_leave</function></link>
	in its <function>__enter__</function> and <function>__exit__</function> methods
	correspondingly. It is intended to be used in <literal>with</literal> statement,
	new in Python 2.5. Read statement description for details.
      </para>

    </refsect2>

    <refsect2 id="function-gdk--threads-init">
      <title>gtk.gdk.threads_init</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>gtk.gdk.threads_init</methodname>
	  <methodparam></methodparam>
	</methodsynopsis></programlisting>

      <para>The <function>gtk.gdk.threads_init</function>() function
initializes <literal>PyGTK</literal> to use the Python macros that allow
multiple threads to serialize access to the Python interpreter (using the
Python Global Interpreter Lock (GIL)). In addition, the
<function>gtk.gdk.threads_init</function>() function initializes the
<literal>GDK</literal> global lock (mutex) that serializes thread access to
the <literal>GTK</literal> and <literal>GDK</literal> libraries. Thus there
are two different global locking mechanisms at work that are initialized by
the <function>gtk.gdk.threads_init</function>() function: Python and
<literal>GDK</literal>.</para>

      <para>The <function>gtk.gdk.threads_init</function>() function must be
called before the <link
linkend="function-gtk--main"><function>gtk.main</function>()</link>
function. At this point in the application the Python GIL is held by the
main application thread. (Usually the main thread calls the
<function>gtk.gdk.threads_init</function>() function though any thread could
call it instead.) When the <link
linkend="function-gtk--main"><function>gtk.main</function>()</link> function
is called the GIL is released and other threads may use the Python
interpreter. When <literal>PyGTK</literal> signal handlers are invoked in
the main thread the GIL is reacquired so that the Python interpreter can run
the handler code.</para>
<!--
      <para>The assumptions behind <literal>PyGTK</literal> thread support
were originally:</para>

      <itemizedlist>
	<listitem>
	  <simpara>A GIL count is initialized for each thread to indicate
that it holds the GIL - the assumption being that the thread will be a
Python thread and will hold the GIL when it starts because it is running in
the Python interpreter. <literal>PyGTK</literal> adds the GIL count for each
thread to provide a recursive lock mechanism. That is, a Python thread may
attempt to gain exclusive access to the Python interpreter multiple times
without fear of deadlock.</simpara>
	</listitem>
	<listitem>
	  <simpara>The Python thread that calls the
<function>gtk.main</function>() function releases the GIL allowing other
Python threads to run.</simpara>
	</listitem>
	<listitem>
	  <simpara><literal>PyGTK</literal> does not release the GIL when
calling a <literal>GTK</literal> or <literal>GDK</literal> function. Also it
does not acquire the <literal>GDK</literal> global lock (GGL). This means
that, in effect, Python threads can use the GIL alone to serialize access to
the <literal>GTK</literal> and <literal>GDK</literal> libraries. Of course,
if there are non-Python threads calling <literal>GTK</literal> or
<literal>GDK</literal> functions the GGL must be used.</simpara>
	</listitem>
	<listitem>
	  <simpara>Signal, timeout and idle handlers written in Python that
are invoked from the <literal>GTK</literal> mainloop acquire the GIL
automatically.</simpara>
	</listitem>
      </itemizedlist>

      <para>The <link
linkend="function-gdk- -threads-enter"><function>gtk.gdk.threads_enter</function>()</link> 
and <link
linkend="function-gdk- -threads-leave"><function>gtk.gdk.threads_leave</function>()</link> 
functions use the <literal>GDK</literal> global lock (GGL) to manage access
to the <literal>GTK</literal> and <literal>GDK</literal> libraries. The
intention is to allow only one thread to execute within the
<literal>GTK</literal> and <literal>GDK</literal> code at a time.
Theoretically any time a thread calls a <literal>PyGTK</literal> method or
function it should bracket the call with the <link
linkend="function-gdk- -threads-enter"><function>gtk.gdk.threads_enter</function>()</link> 
and <link
linkend="function-gdk- -threads-leave"><function>gtk.gdk.threads_leave</function>()</link> 
functions. If your application only uses Python threads then this is not
necessary since only the main thread can safely call
<literal>PyGTK</literal> methods or functions. However if your application
has foreign threads that call <literal>GTK</literal> or
<literal>GDK</literal> functions you should use the <link
linkend="function-gdk- -threads-enter"><function>gtk.gdk.threads_enter</function>()</link> 
and <link
linkend="function-gdk- -threads-leave"><function>gtk.gdk.threads_leave</function>()</link> 
functions to serialize access.</para>

      <note>
	<para>Signal handlers are automatically invoked within a
<function>gdk_threads_enter</function>() and
<function>gdk_threads_leave</function>() function pair by
<literal>GTK</literal> so the <link
linkend="function-gdk- -threads-enter"><function>gtk.gdk.threads_enter</function>()</link> 
and <link
linkend="function-gdk- -threads-leave"><function>gtk.gdk.threads_leave</function>()</link> 
functions should not be called within a Python signal handler or the
application will deadlock. However, idle, timeout and input handlers are
executed outside the GGL so these should use the <link
linkend="function-gdk- -threads-enter"><function>gtk.gdk.threads_enter</function>()</link> 
and <link
linkend="function-gdk- -threads-leave"><function>gtk.gdk.threads_leave</function>()</link> 
functions if <literal>PyGTK</literal> methods or functions are
called.</para>
      </note>

      <para>In general the safest strategy is to only call
<literal>PyGTK</literal> methods and functions from the main Python thread
and use idle or timeout handlers (which run in the main thread) to invoke
<literal>PyGTK</literal> calls from other threads.</para>
-->
    </refsect2>

    <refsect2 id="function-gdk--rgb-ditherable">
      <title>gtk.gdk.rgb_ditherable</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>gtk.gdk.rgb_ditherable</methodname>
	  <methodparam></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the <link
linkend="class-gdkvisual"><classname>gtk.gdk.Visual</classname></link> is
ditherable</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <function>gtk.gdk.rgb_ditherable</function>() function
returns <literal>True</literal> if the <link
linkend="class-gdkvisual"><classname>gtk.gdk.Visual</classname></link> is
ditherable. This function may be useful for presenting a user interface
choice to the user about which dither mode is desired; if the display is not
ditherable, it may make sense to gray out or hide the corresponding UI
widget.</para>

    </refsect2>

    <refsect2 id="function-gdk--rgb-get-colormap">
      <title>gtk.gdk.rgb_get_colormap</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>gtk.gdk.rgb_get_colormap</methodname>
	  <methodparam></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the preferred <link
linkend="class-gdkcolormap"><classname>gtk.gdk.Colormap</classname></link>
for rendering image data.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <function>gtk.gdk.rgb_get_colormap</function>() function
returns the preferred <link
linkend="class-gdkcolormap"><classname>gtk.gdk.Colormap</classname></link>.</para>

    </refsect2>

    <refsect2 id="function-gdk--rgb-set-verbose">
      <title>gtk.gdk.rgb_set_verbose</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>gtk.gdk.rgb_set_verbose</methodname>
	  <methodparam><parameter
			 role="keyword">verbose</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">verbose</parameter>&nbsp;:</term>
	  <listitem><simpara>If <literal>True</literal> messages should be
verbose</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <function>gtk.gdk.rgb_set_verbose</function>() function sets
the "verbose" flag to the value specified by <parameter>verbose</parameter>.
If <parameter>verbose</parameter> is <literal>True</literal> messages will
be verbose. This is generally only useful for debugging.</para>

    </refsect2>

    <refsect2 id="function-gdk--rgb-set-install">
      <title>gtk.gdk.rgb_set_install</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>gtk.gdk.rgb_set_install</methodname>
	  <methodparam><parameter
			 role="keyword">install</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">install</parameter>&nbsp;:</term>
	  <listitem><simpara>if <literal>True</literal> set install
mode</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <function>gtk.gdk.rgb_set_install</function>() function sets
the "install" mode to the value of <parameter>install</parameter>. If
<parameter>install</parameter> is <literal>True</literal>, a new "private"
colormap is always installed rather than trying to find a best fit with the
colors already allocated. Ordinarily, a colormap only be installed if a
sufficient cube cannot be allocated. A private colormap has more colors,
leading to better quality display, but also leads to the dreaded "colormap
flashing" effect.</para>

    </refsect2>

    <refsect2 id="function-gdk--rgb-set-min-colors">
      <title>gtk.gdk.rgb_set_min_colors</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>gtk.gdk.rgb_set_min_colors</methodname>
	  <methodparam><parameter
			 role="keyword">min_colors</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter
role="keyword">min_colors</parameter>&nbsp;:</term>
	  <listitem><simpara>the minimum number of
colors.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <function>gtk.gdk.rgb_set_min_colors</function>() function
sets the minimum number of colors for the color cube to the value specified
by <parameter>min_colors</parameter>. Generally, the largest color cube is
allocated. If a color cube at least as large as
<parameter>min_colors</parameter> can't be allocated, a private colormap is
installed. </para>

    </refsect2>

    <refsect2 id="function-gdk--rgb-get-visual">
      <title>gtk.gdk.rgb_get_visual</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>gtk.gdk.rgb_get_visual</methodname>
	  <methodparam></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the <link
linkend="class-gdkvisual"><classname>gtk.gdk.Visual</classname></link> being
used</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <function>gtk.gdk.rgb_get_visual</function>() function
returns the <link
linkend="class-gdkvisual"><classname>gtk.gdk.Visual</classname></link> being
used to render image data on the default screen.</para>

    </refsect2>

    <refsect2 id="function-gdk--selection-owner-get">
      <title>gtk.gdk.selection_owner_get</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>gtk.gdk.selection_owner_get</methodname>
	  <methodparam><parameter
			 role="keyword">selection</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter
role="keyword">selection</parameter>&nbsp;:</term>
	  <listitem><simpara>an atom indentifying a
selection.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the <link
linkend="class-gdkwindow"><classname>gtk.gdk.Window</classname></link> that
owns the selection or None.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <function>gtk.gdk.selection_owner_get</function>() function
returns the <link
linkend="class-gdkwindow"><classname>gtk.gdk.Window</classname></link> that
owns the selection specified by <parameter>selection</parameter> if there is
a selection owner for this window, and if it is a window known to the
current application. Note that the return value may be owned by a different
process if a foreign window was previously created for that window, but a
new foreign window will never be created by this call.</para>

    </refsect2>

    <refsect2 id="function-gdk--selection-owner-get-for-display">
      <title>gtk.gdk.selection_owner_get_for_display</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>gtk.gdk.selection_owner_get_for_display</methodname>
	  <methodparam><parameter role="keyword">display</parameter></methodparam>
	  <methodparam><parameter role="keyword">selection</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">display</parameter>&nbsp;:</term>
	  <listitem><simpara>A <link linkend="class-gdkdisplay"><classname>gtk.gdk.Display</classname></link>.
	  </simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">selection</parameter>&nbsp;:</term>
	  <listitem><simpara>an atom indentifying a selection.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>If there is a selection owner for this window, and it is
	  a window known to the current process, the
	  <link linkend="class-gdkwindow"><classname>gtk.gdk.Window</classname></link> that
	  owns the selection or <literal>None</literal>.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>
	The <function>gtk.gdk.selection_owner_get_for_display</function>() function
	determine the owner of the given selection. 
      </para>
      <para>
	Note that the return value may be owned by a different process if a foreign
	window was previously created for that window, but a new foreign window will
	never be created by this call.
      </para>

    </refsect2>

    <refsect2 id="function-gdk--selection-owner-set-for-display">
      <title>gtk.gdk.selection_owner_set_for_display</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>gtk.gdk.selection_owner_set_for_display</methodname>
	  <methodparam><parameter role="keyword">display</parameter></methodparam>
	  <methodparam><parameter role="keyword">owner</parameter></methodparam>
	  <methodparam><parameter role="keyword">selection</parameter></methodparam>
	  <methodparam><parameter role="keyword">timw</parameter></methodparam>
	  <methodparam><parameter role="keyword">send_event</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">display</parameter>&nbsp;:</term>
	  <listitem><simpara>A <link linkend="class-gdkdisplay"><classname>gtk.gdk.Display</classname></link>.
	  </simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">owner</parameter>&nbsp;:</term>
	  <listitem><simpara>A <link linkend="class-gdkwindow"><classname>gtk.gdk.Window</classname></link>
	  or <literal>None</literal> to indicate that the owner for the given should be unset. 
	  </simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">selection</parameter>&nbsp;:</term>
	  <listitem><simpara>an atom indentifying a selection.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">time</parameter>&nbsp;:</term>
	  <listitem><simpara>timestamp to use when setting the selection. If this is
	  older than the timestamp given last time the owner was set for the given
	  selection, the request will be ignored.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">send_event</parameter>&nbsp;:</term>
	  <listitem><simpara>if <literal>True</literal>, and the new owner is different
	  from the current owner, the current owner will be sent a SelectionClear
	  event.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the selection owner was successfully
	  changed to owner, otherwise <literal>False</literal>.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>
	The <function>gtk.gdk.selection_owner_set_for_display</function>() function
	sets the <link linkend="class-gdkwindow"><classname>gtk.gdk.Window</classname></link>
	owner as the current owner of the selection selection.
      </para>

    </refsect2>

    <refsect2 id="function-gdk--selection-send-notify">
      <title>gtk.gdk.selection_send_notify</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>gtk.gdk.selection_send_notify</methodname>
	  <methodparam><parameter
			 role="keyword">requestor</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">selection</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">target</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">property</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">time</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter
role="keyword">requestor</parameter>&nbsp;:</term>
	  <listitem><simpara>the integer ID of the window to deliver the
response to.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">selection</parameter>&nbsp;:</term>
	  <listitem><simpara>an atom representing the selection that was
requested.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">target</parameter>&nbsp;:</term>
	  <listitem><simpara>an atom representing the target that was
selected. </simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">property</parameter>&nbsp;:</term>
	  <listitem><simpara>an atom representing the property in which the
selection owner stored the data.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">time</parameter>&nbsp;:</term>
	  <listitem><simpara>a timestamp</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <function>gtk.gdk.selection_send_notify</function>()
function sends a response to a SelectionRequest event.</para>

    </refsect2>

    <refsect2 id="function-gdk--set-sm-client-id">
      <title>gtk.gdk.set_sm_client_id</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>gtk.gdk.set_sm_client_id</methodname>
	  <methodparam><parameter
			 role="keyword">sm_client_id</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter
role="keyword">sm_client_id</parameter>&nbsp;:</term>
	  <listitem><simpara>the client id string assigned by the session
manager when the connection was opened</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <function>gtk.gdk.set_sm_client_id</function>() function
sets the <literal>SM_CLIENT_ID</literal> property on the application's
leader window so that the window manager can save the application's state
using the X11R6 ICCCM session management protocol. See the X Session
Management Library documentation for more information on session management
and the Inter-Client Communication Conventions Manual (ICCCM) for
information on the <literal>WM_CLIENT_LEADER</literal> property. (Both
documents are part of the X Window System distribution.)</para>

    </refsect2>

    <refsect2 id="function-gdk--notify-startup-complete">
      <title>gtk.gdk.notify_startup_complete</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>gtk.gdk.notify_startup_complete</methodname>
	</methodsynopsis></programlisting>

      <note>
        <para>This function is available in PyGTK 2.8 and above</para>
      </note>

      <para>The <function>gtk.gdk.notify_startup_complete</function>()
function indicates to the GUI environment that the application has finished
loading. If the applications opens windows, this function is normally called
after opening the application's initial set of windows.</para>

      <para>GTK+ will call this function automatically after opening the
first <link
linkend="class-gtkwindow"><classname>gtk.Window</classname></link> unless
the <link
linkend="function-gtk--window-set-auto-startup-notification"><function>gtk.window_set_auto_startup_notification</function>()</link>
function is called to disable that feature.</para>

    </refsect2>

    <refsect2 id="function-gdk--get-program-class">
      <title>gtk.gdk.get_program_class</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>gtk.gdk.get_program_class</methodname>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the program class</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
        <para>This function is available in PyGTK 2.8 and above</para>
      </note>

      <para>The <function>gtk.gdk.get_program_class</function>() function
returns the program class. Unless the program class has explicitly been set
with the <link
linkend="function-gdk--set-program-class"><function>gtk.gdk.set_program_class</function>()</link>
function or with the <option>--class</option> commandline option, the
default value is the program name with the first character converted to
uppercase.</para>

    </refsect2>

    <refsect2 id="function-gdk--set-program-class">
      <title>gtk.gdk.set_program_class</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>gtk.gdk.set_program_class</methodname>
	  <methodparam><parameter
			 role="keyword">program_class</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter
role="keyword">program_class</parameter>&nbsp;:</term>
	  <listitem><simpara>a string containing the program
class</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
        <para>This function is available in PyGTK 2.8 and above</para>
      </note>

      <para>The <function>gtk.gdk.set_program_class</function>() function
sets the program class to the string contained in
<parameter>program_class</parameter>. The <literal>X11</literal> backend
uses the program class to set the class name part of the
<literal>WM_CLASS</literal> property on toplevel windows.</para>

    </refsect2>

    <refsect2 id="function-gdk--get-display">
      <title>gtk.gdk.get_display</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>gtk.gdk.get_display</methodname>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the name of the display</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
        <para>This function is available in PyGTK 2.8 and above</para>
      </note>

      <para>The <function>gtk.gdk.get_display</function>() function returns
the name of the display, which is usually derived from the
<envar>DISPLAY</envar> environment variable or the
<option>--display</option> command line option.</para>

    </refsect2>

    <refsect2 id="function-gdk--get-display-arg-name">
      <title>gtk.gdk.get_display_arg_name</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>gtk.gdk.get_display_arg_name</methodname>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara> the display name, if specified explicitly, or
<literal>None</literal>.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
        <para>This function is available in PyGTK 2.8 and above</para>
      </note>

      <para>The <function>gtk.gdk.get_display_arg_name</function>() function
returns the display name specified in the command line arguments, if any or
<literal>None</literal> if the display name was not explicitly set.</para>

    </refsect2>

    <refsect2 id="function-gdk--pango-context-get-for-screen">
      <title>gtk.gdk.pango_context_get_for_screen</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>gtk.gdk.pango_context_get_for_screen</methodname>
	  <methodparam><parameter
			 role="keyword">screen</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">screen</parameter>&nbsp;:</term>
	  <listitem><simpara>a <link
linkend="class-gdkscreen"><classname>gtk.gdk.Screen</classname></link></simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a new <link
linkend="class-pangocontext"><classname>pango.Context</classname></link>
object</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
        <para>This function is available in PyGTK 2.8 and above</para>
      </note>

      <para>The
<function>gtk.gdk.pango_context_get_for_screen</function>() function
creates a new <link
linkend="class-pangocontext"><classname>pango.Context</classname></link>
object for the <link
linkend="class-gdkscreen"><classname>gtk.gdk.Screen</classname></link>
specified by <parameter>screen</parameter>. Normally you should use the
<link
linkend="method-gtkwidget--get-pango-context"><methodname>get_pango_context</methodname>()</link>
method instead of this function, to get the appropriate Pango context for
the widget you intend to render text onto.</para>

    </refsect2>

    <refsect2 id="function-gdk--pango-context-get">
      <title>gtk.gdk.pango_context_get</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>gtk.gdk.pango_context_get</methodname>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a new <link
linkend="class-pangocontext"><classname>pango.Context</classname></link>
for the default display.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
        <para>This function is available in PyGTK 2.8 and above</para>
      </note>

      <para>The <function>gtk.gdk.pango_context_get</function>()
function creates a new <link
linkend="class-pangocontext"><classname>pango.Context</classname></link> for
the default display. Normally you should use the <link
linkend="method-gtkwidget--get-pango-context"><methodname>get_pango_context</methodname>()</link>
method instead of this function, to get the appropriate Pango context for
the widget you intend to render text onto.</para>

    </refsect2>
    
    <refsect2 id="function-gdk--x11-display-get-startup-notification-id">
      <title>gtk.gdk.x11_display_get_startup_notification_id</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>gtk.gdk.x11_display_get_startup_notification_id</methodname>
	  <methodparam><parameter
			 role="keyword">display</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">display</parameter>&nbsp;:</term>
	  <listitem><simpara>a <link
linkend="class-gdkdisplay"><classname>gtk.gdk.Display</classname></link></simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the startup notification ID for <parameter>display</parameter>
      </simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
        <para>This function is available in PyGTK 2.12 and above</para>
      </note>

      <para>The
<function>gtk.gdk.x11_display_get_startup_notification_id</function>() function
gets the startup notification ID for a display.</para>

    </refsect2>

  </refsect1>

</refentry>
