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

📄 gdk-cursors.html

📁 最新gtk中文资料集
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<p><br class="example-break"></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>source</code></em>&#160;:</span></p></td><td> the pixmap specifying the cursor.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>mask</code></em>&#160;:</span></p></td><td> the pixmap specifying the mask, which must be the same size as    <em class="parameter"><code>source</code></em>.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>fg</code></em>&#160;:</span></p></td><td> the foreground color, used for the bits in the source which are 1.   The color does not have to be allocated first. </td></tr><tr><td><p><span class="term"><em class="parameter"><code>bg</code></em>&#160;:</span></p></td><td> the background color, used for the bits in the source which are 0.   The color does not have to be allocated first.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>x</code></em>&#160;:</span></p></td><td> the horizontal offset of the 'hotspot' of the cursor. </td></tr><tr><td><p><span class="term"><em class="parameter"><code>y</code></em>&#160;:</span></p></td><td> the vertical offset of the 'hotspot' of the cursor.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td><td> a new <a class="link" href="gdk-Cursors.html#GdkCursor"><span class="type">GdkCursor</span></a>.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3173727"></a><h3><a name="gdk-cursor-new-from-pixbuf"></a>gdk_cursor_new_from_pixbuf ()</h3><a class="indexterm" name="id3173744"></a><pre class="programlisting"><a class="link" href="gdk-Cursors.html#GdkCursor">GdkCursor</a>*          gdk_cursor_new_from_pixbuf          (<a class="link" href="GdkDisplay.html" title="GdkDisplay">GdkDisplay</a> *display,                                                         <ahref="/usr/share/gtk-doc/html/gdk-pixbuf/gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf">GdkPixbuf</a> *pixbuf,                                                         <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint">gint</a> x,                                                         <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint">gint</a> y);</pre><p>Creates a new cursor from a pixbuf. </p><p>Not all GDK backends support RGBA cursors. If they are not supported, a monochrome approximation will be displayed. The functions <a class="link" href="GdkDisplay.html#gdk-display-supports-cursor-alpha"><code class="function">gdk_display_supports_cursor_alpha()</code></a> and <a class="link" href="GdkDisplay.html#gdk-display-supports-cursor-color"><code class="function">gdk_display_supports_cursor_color()</code></a> can be used to determinewhether RGBA cursors are supported; <a class="link" href="GdkDisplay.html#gdk-display-get-default-cursor-size"><code class="function">gdk_display_get_default_cursor_size()</code></a> and <a class="link" href="GdkDisplay.html#gdk-display-get-maximal-cursor-size"><code class="function">gdk_display_get_maximal_cursor_size()</code></a> give information about cursor sizes.</p><p>On the X backend, support for RGBA cursors requires asufficently new version of the X Render extension.</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>display</code></em>&#160;:</span></p></td><td> the <a class="link" href="GdkDisplay.html" title="GdkDisplay"><span class="type">GdkDisplay</span></a> for which the cursor will be created</td></tr><tr><td><p><span class="term"><em class="parameter"><code>pixbuf</code></em>&#160;:</span></p></td><td> the <ahref="/usr/share/gtk-doc/html/gdk-pixbuf/gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a> containing the cursor image</td></tr><tr><td><p><span class="term"><em class="parameter"><code>x</code></em>&#160;:</span></p></td><td> the horizontal offset of the 'hotspot' of the cursor. </td></tr><tr><td><p><span class="term"><em class="parameter"><code>y</code></em>&#160;:</span></p></td><td> the vertical offset of the 'hotspot' of the cursor.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td><td> a new <a class="link" href="gdk-Cursors.html#GdkCursor"><span class="type">GdkCursor</span></a>.</td></tr></tbody></table></div><p class="since">Since  2.4</p></div><hr><div class="refsect2" lang="en"><a name="id3173959"></a><h3><a name="gdk-cursor-new-from-name"></a>gdk_cursor_new_from_name ()</h3><a class="indexterm" name="id3173975"></a><pre class="programlisting"><a class="link" href="gdk-Cursors.html#GdkCursor">GdkCursor</a>*          gdk_cursor_new_from_name            (<a class="link" href="GdkDisplay.html" title="GdkDisplay">GdkDisplay</a> *display,                                                         const <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar">gchar</a> *name);</pre><p>Creates a new cursor by looking up <em class="parameter"><code>name</code></em> in the current cursortheme.</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>display</code></em>&#160;:</span></p></td><td> the <a class="link" href="GdkDisplay.html" title="GdkDisplay"><span class="type">GdkDisplay</span></a> for which the cursor will be created</td></tr><tr><td><p><span class="term"><em class="parameter"><code>name</code></em>&#160;:</span></p></td><td> the name of the cursor</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td><td> a new <a class="link" href="gdk-Cursors.html#GdkCursor"><span class="type">GdkCursor</span></a>, or <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a> if there is no cursor with   the given name </td></tr></tbody></table></div><p class="since">Since  2.8</p></div><hr><div class="refsect2" lang="en"><a name="id3174098"></a><h3><a name="gdk-cursor-new-for-display"></a>gdk_cursor_new_for_display ()</h3><a class="indexterm" name="id3174115"></a><pre class="programlisting"><a class="link" href="gdk-Cursors.html#GdkCursor">GdkCursor</a>*          gdk_cursor_new_for_display          (<a class="link" href="GdkDisplay.html" title="GdkDisplay">GdkDisplay</a> *display,                                                         <a class="link" href="gdk-Cursors.html#GdkCursorType">GdkCursorType</a> cursor_type);</pre><p>Creates a new cursor from the set of builtin cursors.Some useful ones are:</p><div class="itemizedlist"><ul type="disc"><li><p> <img src="right_ptr.png"> <a class="link" href="gdk-Cursors.html#GDK-RIGHT-PTR:CAPS"><span class="type">GDK_RIGHT_PTR</span></a> (right-facing arrow)</p></li><li><p> <img src="crosshair.png"> <a class="link" href="gdk-Cursors.html#GDK-CROSSHAIR:CAPS"><span class="type">GDK_CROSSHAIR</span></a> (crosshair)</p></li><li><p> <img src="xterm.png"> <a class="link" href="gdk-Cursors.html#GDK-XTERM:CAPS"><span class="type">GDK_XTERM</span></a> (I-beam)</p></li><li><p><img src="watch.png"> <a class="link" href="gdk-Cursors.html#GDK-WATCH:CAPS"><span class="type">GDK_WATCH</span></a> (busy)</p></li><li><p><img src="fleur.png"> <a class="link" href="gdk-Cursors.html#GDK-FLEUR:CAPS"><span class="type">GDK_FLEUR</span></a> (for moving objects)</p></li><li><p><img src="hand1.png"> <a class="link" href="gdk-Cursors.html#GDK-HAND1:CAPS"><span class="type">GDK_HAND1</span></a> (a right-pointing hand)</p></li><li><p><img src="hand2.png"> <a class="link" href="gdk-Cursors.html#GDK-HAND2:CAPS"><span class="type">GDK_HAND2</span></a> (a left-pointing hand)</p></li><li><p><img src="left_side.png"> <a class="link" href="gdk-Cursors.html#GDK-LEFT-SIDE:CAPS"><span class="type">GDK_LEFT_SIDE</span></a> (resize left side)</p></li><li><p><img src="right_side.png"> <a class="link" href="gdk-Cursors.html#GDK-RIGHT-SIDE:CAPS"><span class="type">GDK_RIGHT_SIDE</span></a> (resize right side)</p></li><li><p><img src="top_left_corner.png"> <a class="link" href="gdk-Cursors.html#GDK-TOP-LEFT-CORNER:CAPS"><span class="type">GDK_TOP_LEFT_CORNER</span></a> (resize northwest corner)</p></li><li><p><img src="top_right_corner.png"> <a class="link" href="gdk-Cursors.html#GDK-TOP-RIGHT-CORNER:CAPS"><span class="type">GDK_TOP_RIGHT_CORNER</span></a> (resize northeast corner)</p></li><li><p><img src="bottom_left_corner.png"> <a class="link" href="gdk-Cursors.html#GDK-BOTTOM-LEFT-CORNER:CAPS"><span class="type">GDK_BOTTOM_LEFT_CORNER</span></a> (resize southwest corner)</p></li><li><p><img src="bottom_right_corner.png"> <a class="link" href="gdk-Cursors.html#GDK-BOTTOM-RIGHT-CORNER:CAPS"><span class="type">GDK_BOTTOM_RIGHT_CORNER</span></a> (resize southeast corner)</p></li><li><p><img src="top_side.png"> <a class="link" href="gdk-Cursors.html#GDK-TOP-SIDE:CAPS"><span class="type">GDK_TOP_SIDE</span></a> (resize top side)</p></li><li><p><img src="bottom_side.png"> <a class="link" href="gdk-Cursors.html#GDK-BOTTOM-SIDE:CAPS"><span class="type">GDK_BOTTOM_SIDE</span></a> (resize bottom side)</p></li><li><p><img src="sb_h_double_arrow.png"> <a class="link" href="gdk-Cursors.html#GDK-SB-H-DOUBLE-ARROW:CAPS"><span class="type">GDK_SB_H_DOUBLE_ARROW</span></a> (move vertical splitter)</p></li><li><p><img src="sb_v_double_arrow.png"> <a class="link" href="gdk-Cursors.html#GDK-SB-V-DOUBLE-ARROW:CAPS"><span class="type">GDK_SB_V_DOUBLE_ARROW</span></a> (move horizontal splitter)</p></li></ul></div><p></p><p>To make the cursor invisible, use <a class="link" href="gdk-Cursors.html#gdk-cursor-new-from-pixmap"><code class="function">gdk_cursor_new_from_pixmap()</code></a> to createa cursor with no pixels in it.</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>display</code></em>&#160;:</span></p></td><td> the <a class="link" href="GdkDisplay.html" title="GdkDisplay"><span class="type">GdkDisplay</span></a> for which the cursor will be created</td></tr><tr><td><p><span class="term"><em class="parameter"><code>cursor_type</code></em>&#160;:</span></p></td><td> cursor to create</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td><td> a new <a class="link" href="gdk-Cursors.html#GdkCursor"><span class="type">GdkCursor</span></a></td></tr></tbody></table></div><p class="since">Since  2.2</p></div><hr><div class="refsect2" lang="en"><a name="id3174590"></a><h3><a name="gdk-cursor-get-display"></a>gdk_cursor_get_display ()</h3><a class="indexterm" name="id3174605"></a><pre class="programlisting"><a class="link" href="GdkDisplay.html" title="GdkDisplay">GdkDisplay</a>*         gdk_cursor_get_display              (<a class="link" href="gdk-Cursors.html#GdkCursor">GdkCursor</a> *cursor);</pre><p>Returns the display on which the <a class="link" href="gdk-Cursors.html#GdkCursor"><span class="type">GdkCursor</span></a> is defined.</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>cursor</code></em>&#160;:</span></p></td><td> a <a class="link" href="gdk-Cursors.html#GdkCursor"><span class="type">GdkCursor</span></a>.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td><td> the <a class="link" href="GdkDisplay.html" title="GdkDisplay"><span class="type">GdkDisplay</span></a> associated to <em class="parameter"><code>cursor</code></em></td></tr></tbody></table></div><p class="since">Since  2.2</p></div><hr><div class="refsect2" lang="en"><a name="id3174702"></a><h3><a name="gdk-cursor-get-image"></a>gdk_cursor_get_image ()</h3><a class="indexterm" name="id3174718"></a><pre class="programlisting"><ahref="/usr/share/gtk-doc/html/gdk-pixbuf/gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf">GdkPixbuf</a>*          gdk_cursor_get_image                (<a class="link" href="gdk-Cursors.html#GdkCursor">GdkCursor</a> *cursor);</pre><p>Returns a <ahref="/usr/share/gtk-doc/html/gdk-pixbuf/gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a> with the image used to display the cursor.</p><p>Note that depending on the capabilities of the windowing system and on the cursor, GDK may not be able to obtain the image data. In this case, <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a> is returned.</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>cursor</code></em>&#160;:</span></p></td><td> a <a class="link" href="gdk-Cursors.html#GdkCursor"><span class="type">GdkCursor</span></a></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td><td> a <ahref="/usr/share/gtk-doc/html/gdk-pixbuf/gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a> representing <em class="parameter"><code>cursor</code></em>, or <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a></td></tr></tbody></table></div><p class="since">Since  2.8</p></div><hr><div class="refsect2" lang="en"><a name="id3174841"></a><h3><a name="gdk-cursor-ref"></a>gdk_cursor_ref ()</h3><a class="indexterm" name="id3174854"></a><pre class="programlisting"><a class="link" href="gdk-Cursors.html#GdkCursor">GdkCursor</a>*          gdk_cursor_ref                      (<a class="link" href="gdk-Cursors.html#GdkCursor">GdkCursor</a> *cursor);</pre><p>Adds a reference to <em class="parameter"><code>cursor</code></em>.</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>cursor</code></em>&#160;:</span></p></td><td> a <a class="link" href="gdk-Cursors.html#GdkCursor"><span class="type">GdkCursor</span></a></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td><td> Same <em class="parameter"><code>cursor</code></em> that was passed in</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3174934"></a><h3><a name="gdk-cursor-unref"></a>gdk_cursor_unref ()</h3><a class="indexterm" name="id3174946"></a><pre class="programlisting">void                gdk_cursor_unref                    (<a class="link" href="gdk-Cursors.html#GdkCursor">GdkCursor</a> *cursor);</pre><p>Removes a reference from <em class="parameter"><code>cursor</code></em>, deallocating the cursorif no references remain.</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>cursor</code></em>&#160;:</span></p></td><td> a <a class="link" href="gdk-Cursors.html#GdkCursor"><span class="type">GdkCursor</span></a></td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3175011"></a><h3><a name="gdk-cursor-destroy"></a>gdk_cursor_destroy</h3><a class="indexterm" name="id3175026"></a><pre class="programlisting">#define gdk_cursor_destroy             gdk_cursor_unref</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p><code class="literal">gdk_cursor_destroy</code> is deprecated and should not be used in newly-written code.</p></div><p>Destroys a cursor, freeing any resources allocated for it.</p></div></div><div class="refsect1" lang="en"><a name="id3175056"></a><div class="refsect2" lang="en"><a name="id3175058"></a></div><hr><div class="refsect2" lang="en"><a name="id3175059"></a></div></div></div></body></html>

⌨️ 快捷键说明

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