📄 gtktoolbar.html
字号:
const char *tooltip_text, const char *tooltip_private_text);void <a class="link" href="GtkToolbar.html#gtk-toolbar-insert-widget">gtk_toolbar_insert_widget</a> (<a class="link" href="GtkToolbar.html" title="GtkToolbar">GtkToolbar</a> *toolbar, <a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *widget, const char *tooltip_text, const char *tooltip_private_text, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint">gint</a> position);void <a class="link" href="GtkToolbar.html#gtk-toolbar-set-style">gtk_toolbar_set_style</a> (<a class="link" href="GtkToolbar.html" title="GtkToolbar">GtkToolbar</a> *toolbar, <a class="link" href="gtk-Standard-Enumerations.html#GtkToolbarStyle">GtkToolbarStyle</a> style);<a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a>* <a class="link" href="GtkToolbar.html#gtk-toolbar-insert-stock">gtk_toolbar_insert_stock</a> (<a class="link" href="GtkToolbar.html" title="GtkToolbar">GtkToolbar</a> *toolbar, const <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar">gchar</a> *stock_id, const char *tooltip_text, const char *tooltip_private_text, <a class="link" href="gtk-Types.html#GtkSignalFunc">GtkSignalFunc</a> callback, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer">gpointer</a> user_data, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint">gint</a> position);void <a class="link" href="GtkToolbar.html#gtk-toolbar-set-icon-size">gtk_toolbar_set_icon_size</a> (<a class="link" href="GtkToolbar.html" title="GtkToolbar">GtkToolbar</a> *toolbar, <a class="link" href="gtk-Themeable-Stock-Images.html#GtkIconSize">GtkIconSize</a> icon_size);void <a class="link" href="GtkToolbar.html#gtk-toolbar-remove-space">gtk_toolbar_remove_space</a> (<a class="link" href="GtkToolbar.html" title="GtkToolbar">GtkToolbar</a> *toolbar, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint">gint</a> position);void <a class="link" href="GtkToolbar.html#gtk-toolbar-unset-style">gtk_toolbar_unset_style</a> (<a class="link" href="GtkToolbar.html" title="GtkToolbar">GtkToolbar</a> *toolbar);</pre></div><div class="refsect1" lang="en"><a name="id3915462"></a><h2>Object Hierarchy</h2><pre class="synopsis"> <ahref="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject">GObject</a> +----<ahref="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GInitiallyUnowned">GInitiallyUnowned</a> +----<a class="link" href="GtkObject.html" title="GtkObject">GtkObject</a> +----<a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a> +----<a class="link" href="GtkContainer.html" title="GtkContainer">GtkContainer</a> +----GtkToolbar</pre></div><div class="refsect1" lang="en"><a name="id3915516"></a><h2>Implemented Interfaces</h2><p>GtkToolbar implements AtkImplementorIface and <a class="link" href="gtk-gtkbuildable.html#GtkBuildable">GtkBuildable</a>.</p></div><div class="refsect1" lang="en"><a name="id3915546"></a><h2>Properties</h2><pre class="synopsis"> "<a class="link" href="GtkToolbar.html#GtkToolbar--icon-size">icon-size</a>" <a class="link" href="gtk-Themeable-Stock-Images.html#GtkIconSize">GtkIconSize</a> : Read / Write "<a class="link" href="GtkToolbar.html#GtkToolbar--icon-size-set">icon-size-set</a>" <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> : Read / Write "<a class="link" href="GtkToolbar.html#GtkToolbar--orientation">orientation</a>" <a class="link" href="gtk-Standard-Enumerations.html#GtkOrientation">GtkOrientation</a> : Read / Write "<a class="link" href="GtkToolbar.html#GtkToolbar--show-arrow">show-arrow</a>" <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> : Read / Write "<a class="link" href="GtkToolbar.html#GtkToolbar--toolbar-style">toolbar-style</a>" <a class="link" href="gtk-Standard-Enumerations.html#GtkToolbarStyle">GtkToolbarStyle</a> : Read / Write "<a class="link" href="GtkToolbar.html#GtkToolbar--tooltips">tooltips</a>" <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> : Read / Write</pre></div><div class="refsect1" lang="en"><a name="id3915666"></a><h2>Child Properties</h2><pre class="synopsis"> "<a class="link" href="GtkToolbar.html#GtkToolbar--expand">expand</a>" <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> : Read / Write "<a class="link" href="GtkToolbar.html#GtkToolbar--homogeneous">homogeneous</a>" <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> : Read / Write</pre></div><div class="refsect1" lang="en"><a name="id3915718"></a><h2>Style Properties</h2><pre class="synopsis"> "<a class="link" href="GtkToolbar.html#GtkToolbar--button-relief">button-relief</a>" <a class="link" href="gtk-Standard-Enumerations.html#GtkReliefStyle">GtkReliefStyle</a> : Read "<a class="link" href="GtkToolbar.html#GtkToolbar--internal-padding">internal-padding</a>" <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint">gint</a> : Read "<a class="link" href="GtkToolbar.html#GtkToolbar--max-child-expand">max-child-expand</a>" <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint">gint</a> : Read "<a class="link" href="GtkToolbar.html#GtkToolbar--shadow-type">shadow-type</a>" <a class="link" href="gtk-Standard-Enumerations.html#GtkShadowType">GtkShadowType</a> : Read "<a class="link" href="GtkToolbar.html#GtkToolbar--space-size">space-size</a>" <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint">gint</a> : Read "<a class="link" href="GtkToolbar.html#GtkToolbar--space-style">space-style</a>" <a class="link" href="GtkToolbar.html#GtkToolbarSpaceStyle">GtkToolbarSpaceStyle</a> : Read</pre></div><div class="refsect1" lang="en"><a name="id3915838"></a><h2>Signals</h2><pre class="synopsis"> "<a class="link" href="GtkToolbar.html#GtkToolbar-focus-home-or-end">focus-home-or-end</a>" : Run Last / Action "<a class="link" href="GtkToolbar.html#GtkToolbar-orientation-changed">orientation-changed</a>" : Run First "<a class="link" href="GtkToolbar.html#GtkToolbar-popup-context-menu">popup-context-menu</a>" : Run Last "<a class="link" href="GtkToolbar.html#GtkToolbar-style-changed">style-changed</a>" : Run First</pre></div><div class="refsect1" lang="en"><a name="id3915898"></a><h2>Description</h2><p>A toolbar is created with a call to <a class="link" href="GtkToolbar.html#gtk-toolbar-new"><code class="function">gtk_toolbar_new()</code></a>.</p><p>A toolbar can contain instances of a subclass of <a class="link" href="GtkToolItem.html" title="GtkToolItem"><span class="type">GtkToolItem</span></a>. To adda <a class="link" href="GtkToolItem.html" title="GtkToolItem"><span class="type">GtkToolItem</span></a> to the a toolbar, use <a class="link" href="GtkToolbar.html#gtk-toolbar-insert"><code class="function">gtk_toolbar_insert()</code></a>. To removean item from the toolbar use <a class="link" href="GtkContainer.html#gtk-container-remove"><code class="function">gtk_container_remove()</code></a>. To add a buttonto the toolbar, add an instance of <a class="link" href="GtkToolButton.html" title="GtkToolButton"><span class="type">GtkToolButton</span></a>.</p><p>Toolbar items can be visually grouped by adding instances of<a class="link" href="GtkSeparatorToolItem.html" title="GtkSeparatorToolItem"><span class="type">GtkSeparatorToolItem</span></a> to the toolbar. If a <a class="link" href="GtkSeparatorToolItem.html" title="GtkSeparatorToolItem"><span class="type">GtkSeparatorToolItem</span></a> hasthe "expand" property set to <ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><span class="type">TRUE</span></a> and the "draw" property set to<ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><span class="type">FALSE</span></a> the effect is to force all following items to the end of thetoolbar.</p><p>Creating a context menu for the toolbar can be done by connecting tothe <a class="link" href="GtkToolbar.html#GtkToolbar-popup-context-menu"><span class="type">"popup-context-menu"</span></a> signal.</p></div><div class="refsect1" lang="en"><a name="id3916029"></a><h2>Details</h2><div class="refsect2" lang="en"><a name="id3916039"></a><h3><a name="GtkToolbar-struct"></a>GtkToolbar</h3><a class="indexterm" name="id3916052"></a><pre class="programlisting">typedef struct { gint num_children; GList *children; GtkOrientation orientation; GtkToolbarStyle style; GtkIconSize icon_size; #ifndef GTK_DISABLE_DEPRECATED GtkTooltips *tooltips;#else gpointer _tooltips;#endif} GtkToolbar;</pre><p>The <a class="link" href="GtkToolbar.html" title="GtkToolbar"><span class="type">GtkToolbar</span></a> struct only contains private data and should only beaccessed through the function described below.</p></div><hr><div class="refsect2" lang="en"><a name="id3916081"></a><h3><a name="GtkToolbarChildType"></a>enum GtkToolbarChildType</h3><a class="indexterm" name="id3916097"></a><pre class="programlisting">typedef enum{ GTK_TOOLBAR_CHILD_SPACE, GTK_TOOLBAR_CHILD_BUTTON, GTK_TOOLBAR_CHILD_TOGGLEBUTTON, GTK_TOOLBAR_CHILD_RADIOBUTTON, GTK_TOOLBAR_CHILD_WIDGET} GtkToolbarChildType;</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p><code class="literal">GtkToolbarChildType</code> is deprecated and should not be used in newly-written code.</p></div><p><a class="link" href="GtkToolbar.html#GtkToolbarChildType"><span class="type">GtkToolbarChildType</span></a> is used to set the type of new elements that are added to a <a class="link" href="GtkToolbar.html" title="GtkToolbar"><span class="type">GtkToolbar</span></a>.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><a name="GTK-TOOLBAR-CHILD-SPACE:CAPS"></a><code class="literal">GTK_TOOLBAR_CHILD_SPACE</code></span></p></td><td>a space in the style of the toolbar's <a class="link" href="GtkToolbar.html#GtkToolbarSpaceStyle"><span class="type">GtkToolbarSpaceStyle</span></a>.</td></tr><tr><td><p><span class="term"><a name="GTK-TOOLBAR-CHILD-BUTTON:CAPS"></a><code class="literal">GTK_TOOLBAR_CHILD_BUTTON</code></span></p></td><td>a <a class="link" href="GtkButton.html" title="GtkButton"><span class="type">GtkButton</span></a>.</td></tr><tr><td><p><span class="term"><a name="GTK-TOOLBAR-CHILD-TOGGLEBUTTON:CAPS"></a><code class="literal">GTK_TOOLBAR_CHILD_TOGGLEBUTTON</code></span></p></td><td>a <a class="link" href="GtkToggleButton.html" title="GtkToggleButton"><span class="type">GtkToggleButton</span></a>.</td></tr><tr><td><p><span class="term"><a name="GTK-TOOLBAR-CHILD-RADIOBUTTON:CAPS"></a><code class="literal">GTK_TOOLBAR_CHILD_RADIOBUTTON</code></span></p></td><td>a <a class="link" href="GtkRadioButton.html" title="GtkRadioButton"><span class="type">GtkRadioButton</span></a>.</td></tr><tr><td><p><span class="term"><a name="GTK-TOOLBAR-CHILD-WIDGET:CAPS"></a><code class="literal">GTK_TOOLBAR_CHILD_WIDGET</code></span></p></td><td>a standard <a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a>.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3916303"></a><h3><a name="GtkToolbarSpaceStyle"></a>enum GtkToolbarSpaceStyle</h3><a class="indexterm" name="id3916317"></a><pre class="programlisting">typedef enum{ GTK_TOOLBAR_SPACE_EMPTY, GTK_TOOLBAR_SPACE_LINE} GtkToolbarSpaceStyle;</pre><p></p></div><hr><div class="refsect2" lang="en"><a name="id3916333"></a><h3><a name="GtkToolbarChild"></a>GtkToolbarChild</h3><a class="indexterm" name="id3916348"></a><pre class="programlisting">typedef struct {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -