<?xml version="1.0"?>
<page id="GimpUi.widget_track_monitor"
      type="topic"
      style="function"
      xmlns="http://projectmallard.org/1.0/"
      xmlns:api="http://projectmallard.org/experimental/api/"
      xmlns:ui="http://projectmallard.org/1.0/ui/">
  <info>
    <link xref="index" group="function" type="guide"/>
    <api:function>
      <api:returns>
        <api:type>none</api:type>
      </api:returns>
      <api:name>gimp_widget_track_monitor</api:name>
      <api:arg>
        <api:type>Gtk.Widget</api:type>
        <api:name>widget</api:name>
      </api:arg>
      <api:arg>
        <api:type>GObject.Callback</api:type>
        <api:name>monitor_changed_callback</api:name>
      </api:arg>
      <api:arg>
        <api:type>gpointer</api:type>
        <api:name>user_data</api:name>
      </api:arg>
      <api:arg>
        <api:type>GLib.DestroyNotify</api:type>
        <api:name>user_data_destroy</api:name>
      </api:arg>
    </api:function>
  </info>
  <title>GimpUi.widget_track_monitor</title>
  <synopsis><code mime="text/x-python">
@accepts(Gtk.Widget, GObject.Callback, gpointer, GLib.DestroyNotify)
@returns(none)
def widget_track_monitor(widget, monitor_changed_callback, user_data, user_data_destroy):
    # Python wrapper for gimp_widget_track_monitor()
  </code></synopsis>
  <p>This function behaves as if <link href="../Gtk-3.0/Gtk.Widget.html">Gtk.Widget</link> had a signal</p>  <p>GtkWidget::monitor_changed(GtkWidget *widget, gpointer user_data)</p>  <p>That is emitted whenever <code>widget</code>'s toplevel window is moved from
one monitor to another. This function automatically connects to
the right toplevel <link href="../Gtk-3.0/Gtk.Window.html">Gtk.Window</link>, even across moving <code>widget</code> between
toplevel windows.</p>  <p>Note that this function tracks the toplevel, not <code>widget</code> itself, so
all a window's widgets are always considered to be on the same
monitor. This is because this function is mainly used for fetching
the new monitor's color profile, and it makes little sense to use
different profiles for the widgets of one window.</p>
  <p>Since 2.10</p>
<terms>
<item>
<title><code>widget</code></title>
  <p>a <link href="../Gtk-3.0/Gtk.Widget.html">Gtk.Widget</link></p>
</item>
<item>
<title><code>monitor_changed_callback</code></title>
  <p>the callback when <code>widget</code>'s monitor changes</p>
</item>
<item>
<title><code>user_data</code></title>
  <p>data passed to <code>monitor_changed_callback</code></p>
</item>
<item>
<title><code>user_data_destroy</code></title>
  <p>destroy function for <code>user_data</code>.</p>
</item>
</terms>

</page>
