⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gdk-events.html

📁 最新gtk中文资料集
💻 HTML
📖 第 1 页 / 共 5 页
字号:
</tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3230926"></a><h3><a name="gdk-event-get-state"></a>gdk_event_get_state ()</h3><a class="indexterm" name="id3230940"></a><pre class="programlisting"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a>            gdk_event_get_state                 (<a class="link" href="gdk-Event-Structures.html#GdkEvent">GdkEvent</a> *event,                                                         <a class="link" href="gdk-Windows.html#GdkModifierType">GdkModifierType</a> *state);</pre><p>If the event contains a "state" field, puts that field in <em class="parameter"><code>state</code></em>. Otherwisestores an empty state (0). Returns <ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if there was a state fieldin the event. <em class="parameter"><code>event</code></em> may be <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a>, in which case it's treatedas if the event had no state field.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>event</code></em>&#160;:</span></p></td><td> a <a class="link" href="gdk-Event-Structures.html#GdkEvent"><span class="type">GdkEvent</span></a> or NULL</td></tr><tr><td><p><span class="term"><em class="parameter"><code>state</code></em>&#160;:</span></p></td><td> return location for state</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td><td> <ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if there was a state field in the event </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3231075"></a><h3><a name="gdk-event-get-axis"></a>gdk_event_get_axis ()</h3><a class="indexterm" name="id3231089"></a><pre class="programlisting"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a>            gdk_event_get_axis                  (<a class="link" href="gdk-Event-Structures.html#GdkEvent">GdkEvent</a> *event,                                                         <a class="link" href="gdk-Input-Devices.html#GdkAxisUse">GdkAxisUse</a> axis_use,                                                         <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble">gdouble</a> *value);</pre><p>Extract the axis value for a particular axis use froman event structure.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>event</code></em>&#160;:</span></p></td><td> a <a class="link" href="gdk-Event-Structures.html#GdkEvent"><span class="type">GdkEvent</span></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>axis_use</code></em>&#160;:</span></p></td><td> the axis use to look for</td></tr><tr><td><p><span class="term"><em class="parameter"><code>value</code></em>&#160;:</span></p></td><td> location to store the value found</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td><td> <ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the specified axis was found, otherwise <ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a></td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3231222"></a><h3><a name="gdk-event-get-coords"></a>gdk_event_get_coords ()</h3><a class="indexterm" name="id3231235"></a><pre class="programlisting"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a>            gdk_event_get_coords                (<a class="link" href="gdk-Event-Structures.html#GdkEvent">GdkEvent</a> *event,                                                         <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble">gdouble</a> *x_win,                                                         <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble">gdouble</a> *y_win);</pre><p>Extract the event window relative x/y coordinates from an event.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>event</code></em>&#160;:</span></p></td><td> a <a class="link" href="gdk-Event-Structures.html#GdkEvent"><span class="type">GdkEvent</span></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>x_win</code></em>&#160;:</span></p></td><td> location to put event window x coordinate</td></tr><tr><td><p><span class="term"><em class="parameter"><code>y_win</code></em>&#160;:</span></p></td><td> location to put event window y coordinate</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td><td> <ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the event delivered event window coordinates</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3231359"></a><h3><a name="gdk-event-get-root-coords"></a>gdk_event_get_root_coords ()</h3><a class="indexterm" name="id3231373"></a><pre class="programlisting"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a>            gdk_event_get_root_coords           (<a class="link" href="gdk-Event-Structures.html#GdkEvent">GdkEvent</a> *event,                                                         <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble">gdouble</a> *x_root,                                                         <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble">gdouble</a> *y_root);</pre><p>Extract the root window relative x/y coordinates from an event.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>event</code></em>&#160;:</span></p></td><td> a <a class="link" href="gdk-Event-Structures.html#GdkEvent"><span class="type">GdkEvent</span></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>x_root</code></em>&#160;:</span></p></td><td> location to put root window x coordinate</td></tr><tr><td><p><span class="term"><em class="parameter"><code>y_root</code></em>&#160;:</span></p></td><td> location to put root window y coordinate</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td><td> <ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the event delivered root window coordinates</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3231496"></a><h3><a name="gdk-event-request-motions"></a>gdk_event_request_motions ()</h3><a class="indexterm" name="id3231512"></a><pre class="programlisting">void                gdk_event_request_motions           (<a class="link" href="gdk-Event-Structures.html#GdkEventMotion">GdkEventMotion</a> *event);</pre><p>Request more motion notifies if <em class="parameter"><code>event</code></em> is a motion notify hint event.This function should be used instead of <a class="link" href="gdk-Windows.html#gdk-window-get-pointer"><code class="function">gdk_window_get_pointer()</code></a> torequest further motion notifies, because it also works for extensionevents where motion notifies are provided for devices other than thecore pointer. Coordinate extraction, processing and requesting moremotion events from a <a class="link" href="gdk-Events.html#GDK-MOTION-NOTIFY:CAPS"><code class="literal">GDK_MOTION_NOTIFY</code></a> event usually works like this:</p><p></p><div class="informalexample"><pre class="programlisting">{  // motion_event handler  x = motion_event-&gt;x;  y = motion_event-&gt;y;  ; // handle (x,y) motion  gdk_event_request_motions (motion_event); // handles is_hint events}</pre></div><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>event</code></em>&#160;:</span></p></td><td> a valid <a class="link" href="gdk-Event-Structures.html#GdkEvent"><span class="type">GdkEvent</span></a></td></tr></tbody></table></div><p class="since">Since  2.12</p></div><hr><div class="refsect2" lang="en"><a name="id3231623"></a><h3><a name="gdk-event-handler-set"></a>gdk_event_handler_set ()</h3><a class="indexterm" name="id3231636"></a><pre class="programlisting">void                gdk_event_handler_set               (<a class="link" href="gdk-Events.html#GdkEventFunc">GdkEventFunc</a> func,                                                         <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer">gpointer</a> data,                                                         <ahref="/usr/share/gtk-doc/html/glib/glib-Datasets.html#GDestroyNotify">GDestroyNotify</a> notify);</pre><p>Sets the function to call to handle all events from GDK.</p><p>Note that GTK+ uses this to install its own event handler, so it isusually not useful for GTK+ applications. (Although an applicationcan call this function then call <ahref="/usr/share/gtk-doc/html/gtk/gtk-General.html#gtk-main-do-event"><code class="function">gtk_main_do_event()</code></a> to passevents to GTK+.)</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>func</code></em>&#160;:</span></p></td><td> the function to call to handle events from GDK.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></p></td><td> user data to pass to the function. </td></tr><tr><td><p><span class="term"><em class="parameter"><code>notify</code></em>&#160;:</span></p></td><td> the function to call when the handler function is removed, i.e. when         <a class="link" href="gdk-Events.html#gdk-event-handler-set"><code class="function">gdk_event_handler_set()</code></a> is called with another event handler.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3231761"></a><h3><a name="GdkEventFunc"></a>GdkEventFunc ()</h3><a class="indexterm" name="id3231774"></a><pre class="programlisting">void                (*GdkEventFunc)                     (<a class="link" href="gdk-Event-Structures.html#GdkEvent">GdkEvent</a> *event,                                                         <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer">gpointer</a> data);</pre><p>Specifies the type of function passed to <a class="link" href="gdk-Events.html#gdk-event-handler-set"><code class="function">gdk_event_handler_set()</code></a> to handleall GDK events.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>event</code></em>&#160;:</span></p></td><td>the <a class="link" href="gdk-Event-Structures.html#GdkEvent"><span class="type">GdkEvent</span></a> to process.</td>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -