gtkscrolledwindow.html

来自「最新gtk中文资料集」· HTML 代码 · 共 948 行 · 第 1/4 页

HTML
948
字号
</div><div class="refsect1" lang="en"><a name="id4121542"></a><h2>Details</h2><div class="refsect2" lang="en"><a name="id4121552"></a><h3><a name="GtkScrolledWindow-struct"></a>GtkScrolledWindow</h3><a class="indexterm" name="id4121566"></a><pre class="programlisting">typedef struct {  GtkWidget *hscrollbar;  GtkWidget *vscrollbar;} GtkScrolledWindow;</pre><p>There are no public fields in the <a class="link" href="GtkScrolledWindow.html" title="GtkScrolledWindow"><span class="type">GtkScrolledWindow</span></a> struct; it should only be accessed using the functions below.</p></div><hr><div class="refsect2" lang="en"><a name="id4121592"></a><h3><a name="gtk-scrolled-window-new"></a>gtk_scrolled_window_new ()</h3><a class="indexterm" name="id4121605"></a><pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a>*          gtk_scrolled_window_new             (<a class="link" href="GtkAdjustment.html" title="GtkAdjustment">GtkAdjustment</a> *hadjustment,                                                         <a class="link" href="GtkAdjustment.html" title="GtkAdjustment">GtkAdjustment</a> *vadjustment);</pre><p>Creates a new scrolled window. The two arguments are the scrolledwindow's adjustments; these will be shared with the scrollbars and thechild widget to keep the bars in sync with the child. Usually you wantto pass <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a> for the adjustments, which will cause the scrolled windowto create them for you.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>hadjustment</code></em>&#160;:</span></p></td><td>Horizontal adjustment.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>vadjustment</code></em>&#160;:</span></p></td><td>Vertical adjustment.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td><td>New scrolled window.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id4121701"></a><h3><a name="gtk-scrolled-window-get-hadjustment"></a>gtk_scrolled_window_get_hadjustment ()</h3><a class="indexterm" name="id4121715"></a><pre class="programlisting"><a class="link" href="GtkAdjustment.html" title="GtkAdjustment">GtkAdjustment</a>*      gtk_scrolled_window_get_hadjustment (<a class="link" href="GtkScrolledWindow.html" title="GtkScrolledWindow">GtkScrolledWindow</a> *scrolled_window);</pre><p>Returns the horizontal scrollbar's adjustment, used to connect thehorizontal scrollbar to the child widget's horizontal scrollfunctionality.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>scrolled_window</code></em>&#160;:</span></p></td><td>A <a class="link" href="GtkScrolledWindow.html" title="GtkScrolledWindow"><span class="type">GtkScrolledWindow</span></a>.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td><td>The horizontal <a class="link" href="GtkAdjustment.html" title="GtkAdjustment"><span class="type">GtkAdjustment</span></a>.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id4121791"></a><h3><a name="gtk-scrolled-window-get-vadjustment"></a>gtk_scrolled_window_get_vadjustment ()</h3><a class="indexterm" name="id4121806"></a><pre class="programlisting"><a class="link" href="GtkAdjustment.html" title="GtkAdjustment">GtkAdjustment</a>*      gtk_scrolled_window_get_vadjustment (<a class="link" href="GtkScrolledWindow.html" title="GtkScrolledWindow">GtkScrolledWindow</a> *scrolled_window);</pre><p>Returns the vertical scrollbar's adjustment, used to connect thevertical scrollbar to the child widget's vertical scrollfunctionality.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>scrolled_window</code></em>&#160;:</span></p></td><td>A <a class="link" href="GtkScrolledWindow.html" title="GtkScrolledWindow"><span class="type">GtkScrolledWindow</span></a>.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td><td>The vertical <a class="link" href="GtkAdjustment.html" title="GtkAdjustment"><span class="type">GtkAdjustment</span></a>.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id4121882"></a><h3><a name="gtk-scrolled-window-get-hscrollbar"></a>gtk_scrolled_window_get_hscrollbar ()</h3><a class="indexterm" name="id4121899"></a><pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a>*          gtk_scrolled_window_get_hscrollbar  (<a class="link" href="GtkScrolledWindow.html" title="GtkScrolledWindow">GtkScrolledWindow</a> *scrolled_window);</pre><p>Returns the horizontal scrollbar of <em class="parameter"><code>scrolled_window</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>scrolled_window</code></em>&#160;:</span></p></td><td> a <a class="link" href="GtkScrolledWindow.html" title="GtkScrolledWindow"><span class="type">GtkScrolledWindow</span></a></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td><td> the horizontal scrollbar of the scrolled window, or  <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a> if it does not have one.</td></tr></tbody></table></div><p class="since">Since  2.8</p></div><hr><div class="refsect2" lang="en"><a name="id4121992"></a><h3><a name="gtk-scrolled-window-get-vscrollbar"></a>gtk_scrolled_window_get_vscrollbar ()</h3><a class="indexterm" name="id4122008"></a><pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a>*          gtk_scrolled_window_get_vscrollbar  (<a class="link" href="GtkScrolledWindow.html" title="GtkScrolledWindow">GtkScrolledWindow</a> *scrolled_window);</pre><p>Returns the vertical scrollbar of <em class="parameter"><code>scrolled_window</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>scrolled_window</code></em>&#160;:</span></p></td><td> a <a class="link" href="GtkScrolledWindow.html" title="GtkScrolledWindow"><span class="type">GtkScrolledWindow</span></a></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td><td> the vertical scrollbar of the scrolled window, or <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a> if it does not have one.</td></tr></tbody></table></div><p class="since">Since  2.8</p></div><hr><div class="refsect2" lang="en"><a name="id4122101"></a><h3><a name="gtk-scrolled-window-set-policy"></a>gtk_scrolled_window_set_policy ()</h3><a class="indexterm" name="id4122115"></a><pre class="programlisting">void                gtk_scrolled_window_set_policy      (<a class="link" href="GtkScrolledWindow.html" title="GtkScrolledWindow">GtkScrolledWindow</a> *scrolled_window,                                                         <a class="link" href="gtk-Standard-Enumerations.html#GtkPolicyType">GtkPolicyType</a> hscrollbar_policy,                                                         <a class="link" href="gtk-Standard-Enumerations.html#GtkPolicyType">GtkPolicyType</a> vscrollbar_policy);</pre><p>Sets the scrollbar policy for the horizontal and vertical scrollbars. The policy determines when the scrollbar should appear; it is a valuefrom the <a class="link" href="gtk-Standard-Enumerations.html#GtkPolicyType"><span class="type">GtkPolicyType</span></a> enumeration. If <a class="link" href="gtk-Standard-Enumerations.html#GTK-POLICY-ALWAYS:CAPS"><code class="literal">GTK_POLICY_ALWAYS</code></a>, thescrollbar is always present; if <a class="link" href="gtk-Standard-Enumerations.html#GTK-POLICY-NEVER:CAPS"><code class="literal">GTK_POLICY_NEVER</code></a>, the scrollbar isnever present; if <a class="link" href="gtk-Standard-Enumerations.html#GTK-POLICY-AUTOMATIC:CAPS"><code class="literal">GTK_POLICY_AUTOMATIC</code></a>, the scrollbar is present onlyif needed (that is, if the slider part of the bar would be smallerthan the trough - the display is larger than the page size).</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>scrolled_window</code></em>&#160;:</span></p></td><td>A <a class="link" href="GtkScrolledWindow.html" title="GtkScrolledWindow"><span class="type">GtkScrolledWindow</span></a>.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>hscrollbar_policy</code></em>&#160;:</span></p></td><td>Policy for horizontal bar.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>vscrollbar_policy</code></em>&#160;:</span></p></td><td>Policy for vertical bar.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id4122266"></a><h3><a name="gtk-scrolled-window-add-with-viewport"></a>gtk_scrolled_window_add_with_viewport ()</h3><a class="indexterm" name="id4122280"></a><pre class="programlisting">void                gtk_scrolled_window_add_with_viewport                                                        (<a class="link" href="GtkScrolledWindow.html" title="GtkScrolledWindow">GtkScrolledWindow</a> *scrolled_window,                                                         <a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *child);</pre><p>Used to add children without native scrolling capabilities. This issimply a convenience function; it is equivalent to adding theunscrollable child to a viewport, then adding the viewport to thescrolled window. If a child has native scrolling, use<a class="link" href="GtkContainer.html#gtk-container-add"><code class="function">gtk_container_add()</code></a> instead of this function.</p><p>The viewport scrolls the child by moving its <ahref="/usr/share/gtk-doc/html/gdk/gdk-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a>, and takes thesize of the child to be the size of its toplevel <ahref="/usr/share/gtk-doc/html/gdk/gdk-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a>. This willbe very wrong for most widgets that support native scrolling; forexample, if you add a widget such as <a class="link" href="GtkTreeView.html" title="GtkTreeView"><span class="type">GtkTreeView</span></a> with a viewport, the whole widget will scroll, including the column headings. Thus, widgets

⌨️ 快捷键说明

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