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

📄 gtksizegroup.html

📁 最新gtk中文资料集
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"><title>GtkSizeGroup</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2"><link rel="start" href="index.html" title="GTK+ Reference Manual"><link rel="up" href="MiscObjects.html" title="Miscellaneous"><link rel="prev" href="GtkIMMulticontext.html" title="GtkIMMulticontext"><link rel="next" href="GtkTooltip.html" title="GtkTooltip"><meta name="generator" content="GTK-Doc V1.9 (XML mode)"><link rel="stylesheet" href="style.css" type="text/css"><link rel="part" href="gtk.html" title="Part&#160;I.&#160;GTK+ Overview"><link rel="part" href="gtkbase.html" title="Part&#160;II.&#160;GTK+ Core Reference"><link rel="part" href="gtkobjects.html" title="Part&#160;III.&#160;GTK+ Widgets and Objects"><link rel="chapter" href="ch01.html" title="Object Hierarchy"><link rel="chapter" href="ch02.html" title="Widget Gallery"><link rel="chapter" href="WindowWidgets.html" title="Windows"><link rel="chapter" href="DisplayWidgets.html" title="Display Widgets"><link rel="chapter" href="ButtonWidgets.html" title="Buttons and Toggles"><link rel="chapter" href="NumericEntry.html" title="Numeric/Text Data Entry"><link rel="chapter" href="TextWidgetObjects.html" title="Multiline Text Editor"><link rel="chapter" href="TreeWidgetObjects.html" title="Tree, List and Icon Grid Widgets"><link rel="chapter" href="MenusAndCombos.html" title="Menus, Combo Box, Toolbar"><link rel="chapter" href="Actions.html" title="Action-based menus and toolbars"><link rel="chapter" href="SelectorWidgets.html" title="Selectors (File/Font/Color/Input Devices)"><link rel="chapter" href="LayoutContainers.html" title="Layout Containers"><link rel="chapter" href="Ornaments.html" title="Ornaments"><link rel="chapter" href="ScrollingWidgets.html" title="Scrolling"><link rel="chapter" href="Printing.html" title="Printing"><link rel="chapter" href="MiscObjects.html" title="Miscellaneous"><link rel="chapter" href="AbstractObjects.html" title="Abstract Base Classes"><link rel="chapter" href="PlugSocket.html" title="Cross-process Embedding"><link rel="chapter" href="SpecialObjects.html" title="Special-purpose features"><link rel="chapter" href="RecentDocuments.html" title="Recently Used Documents"><link rel="chapter" href="Builder.html" title="Interface builder"><link rel="chapter" href="DeprecatedObjects.html" title="Deprecated"><link rel="part" href="migrating.html" title="Part&#160;IV.&#160;Migrating from Previous Versions of GTK+"><link rel="chapter" href="gtk-migrating-checklist.html" title="Migration Checklist"><link rel="chapter" href="gtk-migrating-GtkFileChooser.html" title="Migrating from GtkFileSelection to GtkFileChooser"><link rel="chapter" href="gtk-migrating-GtkAction.html" title="Migrating from old menu and toolbar systems to GtkAction"><link rel="chapter" href="gtk-migrating-GtkComboBox.html" title="Migrating from GtkOptionMenu and GtkCombo to GtkComboBox and GtkComboBoxEntry"><link rel="chapter" href="gtk-migrating-GtkIconView.html" title="Migrating from GnomeIconList to GtkIconView"><link rel="chapter" href="gtk-migrating-GtkAboutDialog.html" title="Migrating from GnomeAbout to GtkAboutDialog"><link rel="chapter" href="gtk-migrating-GtkColorButton.html" title="Migrating from GnomeColorPicker to GtkColorButton"><link rel="chapter" href="gtk-migrating-GtkAssistant.html" title="Migrating from GnomeDruid to GtkAssistant"><link rel="chapter" href="gtk-migrating-GtkRecentChooser.html" title="Migrating from EggRecent to GtkRecentChooser"><link rel="chapter" href="gtk-migrating-GtkLinkButton.html" title="Migrating from GnomeHRef to GtkLinkButton"><link rel="chapter" href="gtk-migrating-GtkBuilder.html" title="Migrating from libglade to GtkBuilder"><link rel="chapter" href="gtk-migrating-tooltips.html" title="Migrating from GtkTooltips to GtkTooltip"><link rel="part" href="pt05.html" title="Part&#160;V.&#160;GTK+ Tools"><link rel="glossary" href="glossary.html" title="Glossary"><link rel="index" href="ix01.html" title="Index"><link rel="index" href="ix02.html" title="Index of deprecated symbols"><link rel="index" href="ix03.html" title="Index of new symbols in 2.2"><link rel="index" href="ix04.html" title="Index of new symbols in 2.4"><link rel="index" href="ix05.html" title="Index of new symbols in 2.6"><link rel="index" href="ix06.html" title="Index of new symbols in 2.8"><link rel="index" href="ix07.html" title="Index of new symbols in 2.10"><link rel="index" href="ix08.html" title="Index of new symbols in 2.12"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="p" href="GtkIMMulticontext.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td><td><a accesskey="u" href="MiscObjects.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td><td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td><th width="100%" align="center">GTK+ Reference Manual</th><td><a accesskey="n" href="GtkTooltip.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td></tr><tr><td colspan="5" class="shortcuts"><nobr><a href="#id4226677" class="shortcut">Top</a>                  &#160;|&#160;                  <a href="#id4227957" class="shortcut">Description</a>                  &#160;|&#160;                  <a href="#id4227858" class="shortcut">Object Hierarchy</a>                  &#160;|&#160;                  <a href="#id4227883" class="shortcut">Implemented Interfaces</a>                  &#160;|&#160;                  <a href="#id4227906" class="shortcut">Properties</a></nobr></td></tr></table><div class="refentry" lang="en"><a name="GtkSizeGroup"></a><div class="titlepage"></div><div class="refnamediv"><table width="100%"><tr><td valign="top"><h2><a name="id4226677"></a><span class="refentrytitle">GtkSizeGroup</span></h2><p>GtkSizeGroup &#8212; Grouping widgets so they request the same size</p></td><td valign="top" align="right"></td></tr></table></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">#include &lt;gtk/gtk.h&gt;                    <a class="link" href="GtkSizeGroup.html#GtkSizeGroup-struct">GtkSizeGroup</a>;enum                <a class="link" href="GtkSizeGroup.html#GtkSizeGroupMode">GtkSizeGroupMode</a>;<a class="link" href="GtkSizeGroup.html" title="GtkSizeGroup">GtkSizeGroup</a>*       <a class="link" href="GtkSizeGroup.html#gtk-size-group-new">gtk_size_group_new</a>                  (<a class="link" href="GtkSizeGroup.html#GtkSizeGroupMode">GtkSizeGroupMode</a> mode);void                <a class="link" href="GtkSizeGroup.html#gtk-size-group-set-mode">gtk_size_group_set_mode</a>             (<a class="link" href="GtkSizeGroup.html" title="GtkSizeGroup">GtkSizeGroup</a> *size_group,                                                         <a class="link" href="GtkSizeGroup.html#GtkSizeGroupMode">GtkSizeGroupMode</a> mode);<a class="link" href="GtkSizeGroup.html#GtkSizeGroupMode">GtkSizeGroupMode</a>    <a class="link" href="GtkSizeGroup.html#gtk-size-group-get-mode">gtk_size_group_get_mode</a>             (<a class="link" href="GtkSizeGroup.html" title="GtkSizeGroup">GtkSizeGroup</a> *size_group);void                <a class="link" href="GtkSizeGroup.html#gtk-size-group-set-ignore-hidden">gtk_size_group_set_ignore_hidden</a>    (<a class="link" href="GtkSizeGroup.html" title="GtkSizeGroup">GtkSizeGroup</a> *size_group,                                                         <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> ignore_hidden);<ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a>            <a class="link" href="GtkSizeGroup.html#gtk-size-group-get-ignore-hidden">gtk_size_group_get_ignore_hidden</a>    (<a class="link" href="GtkSizeGroup.html" title="GtkSizeGroup">GtkSizeGroup</a> *size_group);void                <a class="link" href="GtkSizeGroup.html#gtk-size-group-add-widget">gtk_size_group_add_widget</a>           (<a class="link" href="GtkSizeGroup.html" title="GtkSizeGroup">GtkSizeGroup</a> *size_group,                                                         <a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *widget);void                <a class="link" href="GtkSizeGroup.html#gtk-size-group-remove-widget">gtk_size_group_remove_widget</a>        (<a class="link" href="GtkSizeGroup.html" title="GtkSizeGroup">GtkSizeGroup</a> *size_group,                                                         <a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *widget);<ahref="/usr/share/gtk-doc/html/glib/glib-Singly-Linked-Lists.html#GSList">GSList</a>*             <a class="link" href="GtkSizeGroup.html#gtk-size-group-get-widgets">gtk_size_group_get_widgets</a>          (<a class="link" href="GtkSizeGroup.html" title="GtkSizeGroup">GtkSizeGroup</a> *size_group);</pre></div><div class="refsect1" lang="en"><a name="id4227858"></a><h2>Object Hierarchy</h2><pre class="synopsis">  <ahref="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject">GObject</a>   +----GtkSizeGroup</pre></div><div class="refsect1" lang="en"><a name="id4227883"></a><h2>Implemented Interfaces</h2><p>GtkSizeGroup implements <a class="link" href="gtk-gtkbuildable.html#GtkBuildable">GtkBuildable</a>.</p></div><div class="refsect1" lang="en"><a name="id4227906"></a><h2>Properties</h2><pre class="synopsis">  "<a class="link" href="GtkSizeGroup.html#GtkSizeGroup--ignore-hidden">ignore-hidden</a>"            <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a>              : Read / Write  "<a class="link" href="GtkSizeGroup.html#GtkSizeGroup--mode">mode</a>"                     <a class="link" href="GtkSizeGroup.html#GtkSizeGroupMode">GtkSizeGroupMode</a>      : Read / Write</pre></div><div class="refsect1" lang="en"><a name="id4227957"></a><h2>Description</h2><p><a class="link" href="GtkSizeGroup.html" title="GtkSizeGroup"><span class="type">GtkSizeGroup</span></a> provides a mechanism for grouping a number of widgetstogether so they all request the same amount of space.  This istypically useful when you want a column of widgets to have the samesize, but you can't use a <a class="link" href="GtkTable.html" title="GtkTable"><span class="type">GtkTable</span></a> widget.</p><p>In detail, the size requested for each widget in a <a class="link" href="GtkSizeGroup.html" title="GtkSizeGroup"><span class="type">GtkSizeGroup</span></a> isthe maximum of the sizes that would have been requested for eachwidget in the size group if they were not in the size group. The modeof the size group (see <a class="link" href="GtkSizeGroup.html#gtk-size-group-set-mode"><code class="function">gtk_size_group_set_mode()</code></a>) determines whetherthis applies to the horizontal size, the vertical size, or both sizes.</p><p>Note that size groups only affect the amount of space requested, notthe size that the widgets finally receive. If you want the widgets ina <a class="link" href="GtkSizeGroup.html" title="GtkSizeGroup"><span class="type">GtkSizeGroup</span></a> to actually be the same size, you need to pack them insuch a way that they get the size they request and not more. Forexample, if you are packing your widgets into a table, you would notinclude the <a class="link" href="gtk-Standard-Enumerations.html#GTK-FILL:CAPS"><code class="literal">GTK_FILL</code></a> flag.</p><p><a class="link" href="GtkSizeGroup.html" title="GtkSizeGroup"><span class="type">GtkSizeGroup</span></a> objects are referenced by each widget in the size group,so once you have added all widgets to a <a class="link" href="GtkSizeGroup.html" title="GtkSizeGroup"><span class="type">GtkSizeGroup</span></a>, you can dropthe initial reference to the size group with <ahref="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a>. If thewidgets in the size group are subsequently destroyed, then they willbe removed from the size group and drop their references on the sizegroup; when all widgets have been removed, the size group will befreed.</p><p>Widgets can be part of multiple size groups; GTK+ will compute thehorizontal size of a widget from the horizontal requisition of allwidgets that can be reached from the widget by a chain of size groupsof type <a class="link" href="GtkSizeGroup.html#GTK-SIZE-GROUP-HORIZONTAL:CAPS"><code class="literal">GTK_SIZE_GROUP_HORIZONTAL</code></a> or <a class="link" href="GtkSizeGroup.html#GTK-SIZE-GROUP-BOTH:CAPS"><code class="literal">GTK_SIZE_GROUP_BOTH</code></a>, and thevertical size from the vertical requisition of all widgets that can bereached from the widget by a chain of size groups of type<a class="link" href="GtkSizeGroup.html#GTK-SIZE-GROUP-VERTICAL:CAPS"><code class="literal">GTK_SIZE_GROUP_VERTICAL</code></a> or <a class="link" href="GtkSizeGroup.html#GTK-SIZE-GROUP-BOTH:CAPS"><code class="literal">GTK_SIZE_GROUP_BOTH</code></a>.</p><div class="refsect2" lang="en"><a name="GtkSizeGroup-BUILDER-UI"></a><h3>GtkSizeGroup as GtkBuildable</h3><p>Size groups can be specified in a UI definition by placing an&lt;object&gt; element with <code class="literal">class="GtkSizeGroup"</code>somewhere in the UI definition. The widgets that belong to thesize group are specified by a &lt;widgets&gt; element that maycontain multiple &lt;widget&gt; elements, one for each memberof the size group. The name attribute gives the id of the widget.</p><div class="example"><a name="id4228172"></a><p class="title"><b>Example&#160;44.&#160;A UI definition fragment with GtkSizeGroup</b></p><div class="example-contents"><pre class="programlisting">&lt;object class="GtkSizeGroup"&gt;  &lt;property name="mode"&gt;GTK_SIZE_GROUP_HORIZONTAL&lt;/property&gt;  &lt;widgets&gt;    &lt;widget name="radio1"/&gt;    &lt;widget name="radio2"/&gt;  &lt;/widgets&gt;&lt;/object&gt;</pre></div></div><br class="example-break"></div></div><div class="refsect1" lang="en"><a name="id4228191"></a><h2>Details</h2><div class="refsect2" lang="en"><a name="id4228201"></a><h3><a name="GtkSizeGroup-struct"></a>GtkSizeGroup</h3><a class="indexterm" name="id4228214"></a><pre class="programlisting">typedef struct _GtkSizeGroup GtkSizeGroup;</pre><p></p></div><hr><div class="refsect2" lang="en"><a name="id4228229"></a><h3><a name="GtkSizeGroupMode"></a>enum GtkSizeGroupMode</h3><a class="indexterm" name="id4228242"></a><pre class="programlisting">typedef enum {  GTK_SIZE_GROUP_NONE,  GTK_SIZE_GROUP_HORIZONTAL,  GTK_SIZE_GROUP_VERTICAL,  GTK_SIZE_GROUP_BOTH} GtkSizeGroupMode;</pre><p>The mode of the size group determines the directions in which the sizegroup affects the requested sizes of its component widgets.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><a name="GTK-SIZE-GROUP-NONE:CAPS"></a><code class="literal">GTK_SIZE_GROUP_NONE</code></span></p></td><td> group has no effect  </td></tr><tr><td><p><span class="term"><a name="GTK-SIZE-GROUP-HORIZONTAL:CAPS"></a><code class="literal">GTK_SIZE_GROUP_HORIZONTAL</code></span></p></td><td> group affects horizontal requisition</td></tr><tr><td><p><span class="term"><a name="GTK-SIZE-GROUP-VERTICAL:CAPS"></a><code class="literal">GTK_SIZE_GROUP_VERTICAL</code></span></p></td><td> group affects vertical requisition</td></tr><tr><td><p><span class="term"><a name="GTK-SIZE-GROUP-BOTH:CAPS"></a><code class="literal">GTK_SIZE_GROUP_BOTH</code></span></p></td><td> group affects both horizontal and vertical requisition</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id4228361"></a><h3><a name="gtk-size-group-new"></a>gtk_size_group_new ()</h3><a class="indexterm" name="id4228374"></a><pre class="programlisting"><a class="link" href="GtkSizeGroup.html" title="GtkSizeGroup">GtkSizeGroup</a>*       gtk_size_group_new                  (<a class="link" href="GtkSizeGroup.html#GtkSizeGroupMode">GtkSizeGroupMode</a> mode);</pre><p>Create a new <a class="link" href="GtkSizeGroup.html" title="GtkSizeGroup"><span class="type">GtkSizeGroup</span></a>.</p><p>

⌨️ 快捷键说明

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