/usr/share/gtk-doc/html/libgwydgets/libgwydgets-gwycombobox.html is in libgwyddion20-doc 2.26-1ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>gwycombobox</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="Gwyddion Widgets Library Reference Manual">
<link rel="up" href="WidgetUtilities.html" title="Widget Utilities">
<link rel="prev" href="libgwydgets-gwygrainvaluemenu.html" title="gwygrainvaluemenu">
<link rel="next" href="libgwydgets-gwyradiobuttons.html" title="gwyradiobuttons">
<meta name="generator" content="GTK-Doc V1.8 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</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="libgwydgets-gwygrainvaluemenu.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="WidgetUtilities.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">Gwyddion Widgets Library Reference Manual</th>
<td><a accesskey="n" href="libgwydgets-gwyradiobuttons.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#libgwydgets-gwycombobox.synopsis" class="shortcut">Top</a>
|
<a href="#libgwydgets-gwycombobox.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry">
<a name="libgwydgets-gwycombobox"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="libgwydgets-gwycombobox.top_of_page"></a>gwycombobox</span></h2>
<p>gwycombobox — Combo box constructors</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="libgwydgets-gwycombobox.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include <libgwydgets/gwydgets.h>
<a href="http://developer.gnome.org/doc/API/2.0/gtk/GtkWidget.html"><span class="returnvalue">GtkWidget</span></a> * <a class="link" href="libgwydgets-gwycombobox.html#gwy-combo-box-metric-unit-new" title="gwy_combo_box_metric_unit_new ()">gwy_combo_box_metric_unit_new</a> (<em class="parameter"><code><a href="http://developer.gnome.org/doc/API/2.0/gobject/gobject-Closures.html#GCallback"><span class="type">GCallback</span></a> callback</code></em>,
<em class="parameter"><code><a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> cbdata</code></em>,
<em class="parameter"><code><a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> from</code></em>,
<em class="parameter"><code><a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> to</code></em>,
<em class="parameter"><code><a href="./../libgwyddion/libgwyddion/GwySIUnit.html"><span class="type">GwySIUnit</span></a> *unit</code></em>,
<em class="parameter"><code><a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> active</code></em>);
<span class="returnvalue">void</span> <a class="link" href="libgwydgets-gwycombobox.html#gwy-combo-box-metric-unit-set-unit" title="gwy_combo_box_metric_unit_set_unit ()">gwy_combo_box_metric_unit_set_unit</a> (<em class="parameter"><code><a href="http://developer.gnome.org/doc/API/2.0/gtk/GtkComboBox.html"><span class="type">GtkComboBox</span></a> *combo</code></em>,
<em class="parameter"><code><a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> from</code></em>,
<em class="parameter"><code><a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> to</code></em>,
<em class="parameter"><code><a href="./../libgwyddion/libgwyddion/GwySIUnit.html"><span class="type">GwySIUnit</span></a> *unit</code></em>);
<a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a> <a class="link" href="libgwydgets-gwycombobox.html#gwy-enum-combo-box-get-active" title="gwy_enum_combo_box_get_active ()">gwy_enum_combo_box_get_active</a> (<em class="parameter"><code><a href="http://developer.gnome.org/doc/API/2.0/gtk/GtkComboBox.html"><span class="type">GtkComboBox</span></a> *combo</code></em>);
<a href="http://developer.gnome.org/doc/API/2.0/gtk/GtkWidget.html"><span class="returnvalue">GtkWidget</span></a> * <a class="link" href="libgwydgets-gwycombobox.html#gwy-enum-combo-box-new" title="gwy_enum_combo_box_new ()">gwy_enum_combo_box_new</a> (<em class="parameter"><code>const <a href="./../libgwyddion/libgwyddion/GwyEnum.html"><span class="type">GwyEnum</span></a> *entries</code></em>,
<em class="parameter"><code><a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> nentries</code></em>,
<em class="parameter"><code><a href="http://developer.gnome.org/doc/API/2.0/gobject/gobject-Closures.html#GCallback"><span class="type">GCallback</span></a> callback</code></em>,
<em class="parameter"><code><a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> cbdata</code></em>,
<em class="parameter"><code><a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> active</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> translate</code></em>);
<a href="/usr/share/gtk-doc/html/gtk/GtkWidget.html"><span class="returnvalue">GtkWidget</span></a> * <a class="link" href="libgwydgets-gwycombobox.html#gwy-enum-combo-box-newl" title="gwy_enum_combo_box_newl ()">gwy_enum_combo_box_newl</a> (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/gobject/gobject-Closures.html#GCallback"><span class="type">GCallback</span></a> callback</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> cbdata</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> active</code></em>,
<em class="parameter"><code>...</code></em>);
<span class="returnvalue">void</span> <a class="link" href="libgwydgets-gwycombobox.html#gwy-enum-combo-box-set-active" title="gwy_enum_combo_box_set_active ()">gwy_enum_combo_box_set_active</a> (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/gtk/GtkComboBox.html"><span class="type">GtkComboBox</span></a> *combo</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> active</code></em>);
<span class="returnvalue">void</span> <a class="link" href="libgwydgets-gwycombobox.html#gwy-enum-combo-box-update-int" title="gwy_enum_combo_box_update_int ()">gwy_enum_combo_box_update_int</a> (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/gtk/GtkComboBox.html"><span class="type">GtkComboBox</span></a> *combo</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *integer</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="libgwydgets-gwycombobox.description"></a><h2>Description</h2>
<p>
Combo boxes can be easily constructed from <a href="./../libgwyddion/libgwyddion/GwyEnum.html"><span class="type">GwyEnum</span></a>'s with
<a class="link" href="libgwydgets-gwycombobox.html#gwy-enum-combo-box-new" title="gwy_enum_combo_box_new ()"><code class="function">gwy_enum_combo_box_new()</code></a>. Here's an example of construction of a combo
box with three items:
</p>
<div class="informalexample">
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="listing_lines" align="right"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29</pre></td>
<td class="listing_code"><pre class="programlisting"><span class="keyword">typedef</span><span class="normal"> </span><span class="keyword">enum</span><span class="normal"> </span><span class="cbracket">{</span>
<span class="normal"> MY_ENUM_FOO</span><span class="symbol">,</span><span class="normal"> MY_ENUM_BAR</span><span class="symbol">,</span><span class="normal"> MY_ENUM_BAZ</span>
<span class="cbracket">}</span><span class="normal"> MyEnum</span><span class="symbol">;</span>
<span class="keyword">static</span><span class="normal"> </span><span class="usertype">GwyEnum</span><span class="normal"> my_enum_fields</span><span class="symbol">[]</span><span class="normal"> </span><span class="symbol">=</span><span class="normal"> </span><span class="cbracket">{</span>
<span class="normal"> </span><span class="cbracket">{</span><span class="normal"> </span><span class="function"><a href="./../libgwyddion/libgwyddion/libgwyddion-gwymacros.html#N-:CAPS">N_</a></span><span class="symbol">(</span><span class="string">"Foo"</span><span class="symbol">),</span><span class="normal"> MY_ENUM_FOO </span><span class="cbracket">}</span><span class="symbol">,</span>
<span class="normal"> </span><span class="cbracket">{</span><span class="normal"> </span><span class="function"><a href="./../libgwyddion/libgwyddion/libgwyddion-gwymacros.html#N-:CAPS">N_</a></span><span class="symbol">(</span><span class="string">"Bar"</span><span class="symbol">),</span><span class="normal"> MY_ENUM_BAR </span><span class="cbracket">}</span><span class="symbol">,</span>
<span class="normal"> </span><span class="cbracket">{</span><span class="normal"> </span><span class="function"><a href="./../libgwyddion/libgwyddion/libgwyddion-gwymacros.html#N-:CAPS">N_</a></span><span class="symbol">(</span><span class="string">"Baz"</span><span class="symbol">),</span><span class="normal"> MY_ENUM_BAZ </span><span class="cbracket">}</span><span class="symbol">,</span>
<span class="cbracket">}</span><span class="symbol">;</span>
<span class="keyword">static</span><span class="normal"> </span><span class="type">void</span>
<span class="function">menu_callback</span><span class="symbol">(</span><span class="usertype">GtkWidget</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">combo</span><span class="symbol">,</span><span class="normal"> </span><span class="usertype">gpointer</span><span class="normal"> cbdata</span><span class="symbol">)</span>
<span class="cbracket">{</span>
<span class="normal"> </span><span class="usertype">MyEnum</span><span class="normal"> value</span><span class="symbol">;</span>
<span class="normal"> value </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="#gwy-enum-combo-box-get-active">gwy_enum_combo_box_get_active</a></span><span class="symbol">(</span><span class="function">GTK_COMBO_BOX</span><span class="symbol">(</span><span class="normal">combo</span><span class="symbol">));</span>
<span class="normal"> </span><span class="symbol">...</span>
<span class="cbracket">}</span>
<span class="keyword">static</span><span class="normal"> </span><span class="type">void</span>
<span class="function">function</span><span class="symbol">(</span><span class="type">void</span><span class="symbol">)</span><span class="normal"> </span><span class="cbracket">{</span>
<span class="normal"> </span><span class="usertype">GtkWidget</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">combo</span><span class="symbol">;</span>
<span class="normal"> </span><span class="symbol">...</span>
<span class="normal"> combo </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="#gwy-enum-combo-box-new">gwy_enum_combo_box_new</a></span><span class="symbol">(</span><span class="normal">fields</span><span class="symbol">,</span><span class="normal"> </span><span class="function"><a href="/usr/share/gtk-doc/html/glib/glib-Miscellaneous-Macros.html#G-N-ELEMENTS:CAPS">G_N_ELEMENTS</a></span><span class="symbol">(</span><span class="normal">fields</span><span class="symbol">),</span>
<span class="normal"> </span><span class="function"><a href="/usr/share/gtk-doc/html/gobject/gobject-Closures.html#G-CALLBACK:CAPS">G_CALLBACK</a></span><span class="symbol">(</span><span class="normal">menu_callback</span><span class="symbol">),</span><span class="normal"> <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">,</span>
<span class="normal"> MY_ENUM_FOO</span><span class="symbol">,</span><span class="normal"> <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS">TRUE</a></span><span class="symbol">);</span>
<span class="normal"> </span><span class="symbol">...</span>
<span class="cbracket">}</span></pre></td>
</tr>
</tbody>
</table>
</div>
<p>
</p>
<p>
Many common Gwyddion enumerations have companion function returning
corresponding <a href="./../libgwyddion/libgwyddion/GwyEnum.html"><span class="type">GwyEnum</span></a>, see for example
<a href="./../libgwyprocess/libgwyprocess/libgwyprocess-gwyprocessenums.html">gwyprocessenums</a>,
making combo box construction even easier.
</p>
<p>
For example, a combo box with possible interpolation types can be
constructed:
</p>
<div class="informalexample">
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="listing_lines" align="right"><pre>1
2
3</pre></td>
<td class="listing_code"><pre class="programlisting"><span class="normal">combo </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="#gwy-enum-combo-box-new">gwy_enum_combo_box_new</a></span><span class="symbol">(</span><span class="function"><a href="./../libgwyprocess/libgwyprocess/libgwyprocess-gwyprocessenums.html#gwy-interpolation-type-get-enum">gwy_interpolation_type_get_enum</a></span><span class="symbol">(),</span><span class="normal"> </span><span class="symbol">-</span><span class="number">1</span><span class="symbol">,</span>
<span class="normal"> </span><span class="function"><a href="/usr/share/gtk-doc/html/gobject/gobject-Closures.html#G-CALLBACK:CAPS">G_CALLBACK</a></span><span class="symbol">(</span><span class="normal">menu_callback</span><span class="symbol">),</span><span class="normal"> <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">,</span>
<span class="normal"> <a href="./../libgwyprocess/libgwyprocess/libgwyprocess-gwyprocessenums.html#GWY-INTERPOLATION-BILINEAR:CAPS">GWY_INTERPOLATION_BILINEAR</a></span><span class="symbol">,</span><span class="normal"> <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS">TRUE</a></span><span class="symbol">);</span></pre></td>
</tr>
</tbody>
</table>
</div>
<p>
</p>
</div>
<div class="refsect1">
<a name="libgwydgets-gwycombobox.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="gwy-combo-box-metric-unit-new"></a><h3>gwy_combo_box_metric_unit_new ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/gtk/GtkWidget.html"><span class="returnvalue">GtkWidget</span></a> * gwy_combo_box_metric_unit_new (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/gobject/gobject-Closures.html#GCallback"><span class="type">GCallback</span></a> callback</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> cbdata</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> from</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> to</code></em>,
<em class="parameter"><code><a href="./../libgwyddion/libgwyddion/GwySIUnit.html"><span class="type">GwySIUnit</span></a> *unit</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> active</code></em>);</pre>
<p>
Creates an enum combo box with SI power of 10 multiplies.
</p>
<p>
The integer value is the power of 10.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>callback</code></em> :</span></p></td>
<td>A callback called when a menu item is activated (or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> for</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>cbdata</code></em> :</span></p></td>
<td>User data passed to the callback.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>from</code></em> :</span></p></td>
<td>The exponent of 10 the menu should start at (a multiple of 3, will
be rounded downward if isn't).</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>to</code></em> :</span></p></td>
<td>The exponent of 10 the menu should end at (a multiple of 3, will be
rounded upward if isn't).</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>unit</code></em> :</span></p></td>
<td>The unit to be prefixed.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>active</code></em> :</span></p></td>
<td>The power of 10 to show as currently selected (a multiple of 3).</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>The newly created combo box as <a href="/usr/share/gtk-doc/html/gtk/GtkWidget.html"><span class="type">GtkWidget</span></a>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gwy-combo-box-metric-unit-set-unit"></a><h3>gwy_combo_box_metric_unit_set_unit ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> gwy_combo_box_metric_unit_set_unit (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/gtk/GtkComboBox.html"><span class="type">GtkComboBox</span></a> *combo</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> from</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> to</code></em>,
<em class="parameter"><code><a href="./../libgwyddion/libgwyddion/GwySIUnit.html"><span class="type">GwySIUnit</span></a> *unit</code></em>);</pre>
<p>
Changes the unit selection displayed by a metric unit combo box.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>combo</code></em> :</span></p></td>
<td>A combo box which was created with <a class="link" href="libgwydgets-gwycombobox.html#gwy-combo-box-metric-unit-new" title="gwy_combo_box_metric_unit_new ()"><code class="function">gwy_combo_box_metric_unit_new()</code></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>from</code></em> :</span></p></td>
<td>The exponent of 10 the menu should start at (a multiple of 3, will
be rounded downward if isn't).</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>to</code></em> :</span></p></td>
<td>The exponent of 10 the menu should end at (a multiple of 3, will be
rounded upward if isn't).</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>unit</code></em> :</span></p></td>
<td>The unit to be prefixed.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.5</p>
</div>
<hr>
<div class="refsect2">
<a name="gwy-enum-combo-box-get-active"></a><h3>gwy_enum_combo_box_get_active ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a> gwy_enum_combo_box_get_active (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/gtk/GtkComboBox.html"><span class="type">GtkComboBox</span></a> *combo</code></em>);</pre>
<p>
Gets the enum value corresponding to currently active combo box item.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>combo</code></em> :</span></p></td>
<td>A combo box which was created with <a class="link" href="libgwydgets-gwycombobox.html#gwy-enum-combo-box-new" title="gwy_enum_combo_box_new ()"><code class="function">gwy_enum_combo_box_new()</code></a>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>The selected enum value.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gwy-enum-combo-box-new"></a><h3>gwy_enum_combo_box_new ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/gtk/GtkWidget.html"><span class="returnvalue">GtkWidget</span></a> * gwy_enum_combo_box_new (<em class="parameter"><code>const <a href="./../libgwyddion/libgwyddion/GwyEnum.html"><span class="type">GwyEnum</span></a> *entries</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> nentries</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/gobject/gobject-Closures.html#GCallback"><span class="type">GCallback</span></a> callback</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> cbdata</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> active</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> translate</code></em>);</pre>
<p>
Creates a combo box with choices from a enum.
</p>
<p>
The array <em class="parameter"><code>entries</code></em> must exist during the whole lifetime of the combo box
because it is used directly as the model.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>entries</code></em> :</span></p></td>
<td>An enum with choices.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>nentries</code></em> :</span></p></td>
<td>The number of items in <em class="parameter"><code>entries</code></em>, may be -1 when <em class="parameter"><code>entries</code></em> is
terminated with <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> enum name.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>callback</code></em> :</span></p></td>
<td>A callback called when a new choice is selected (may be <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>).
If you want to just update an integer, you can use
<a class="link" href="libgwydgets-gwycombobox.html#gwy-enum-combo-box-update-int" title="gwy_enum_combo_box_update_int ()"><code class="function">gwy_enum_combo_box_update_int()</code></a> here.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>cbdata</code></em> :</span></p></td>
<td>User data passed to the callback.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>active</code></em> :</span></p></td>
<td>The enum value to show as currently selected. If it isn't equal to
any <em class="parameter"><code>entries</code></em> value, first item is selected.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>translate</code></em> :</span></p></td>
<td>Whether to apply translation function (<a href="./../libgwyddion/libgwyddion/libgwyddion-gwyutils.html#gwy-sgettext"><code class="function">gwy_sgettext()</code></a>) to item
names.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A newly created combo box as <a href="/usr/share/gtk-doc/html/gtk/GtkWidget.html"><span class="type">GtkWidget</span></a>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gwy-enum-combo-box-newl"></a><h3>gwy_enum_combo_box_newl ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/gtk/GtkWidget.html"><span class="returnvalue">GtkWidget</span></a> * gwy_enum_combo_box_newl (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/gobject/gobject-Closures.html#GCallback"><span class="type">GCallback</span></a> callback</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> cbdata</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> active</code></em>,
<em class="parameter"><code>...</code></em>);</pre>
<p>
Creates a combo box with choices from a list of label/value pairs.
</p>
<p>
The string values passed as label texts must exist through the whole
lifetime of the widget.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>callback</code></em> :</span></p></td>
<td>A callback called when a new choice is selected (may be <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>).</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>cbdata</code></em> :</span></p></td>
<td>User data passed to the callback.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>active</code></em> :</span></p></td>
<td>The enum value to show as currently selected. If it isn't equal to
any <em class="parameter"><code>entries</code></em> value, the first item is selected.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td>
<td>First item label, first item value, second item label, second item
value, etc. Terminated with <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A newly created combo box as <a href="/usr/share/gtk-doc/html/gtk/GtkWidget.html"><span class="type">GtkWidget</span></a>.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.5</p>
</div>
<hr>
<div class="refsect2">
<a name="gwy-enum-combo-box-set-active"></a><h3>gwy_enum_combo_box_set_active ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> gwy_enum_combo_box_set_active (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/gtk/GtkComboBox.html"><span class="type">GtkComboBox</span></a> *combo</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> active</code></em>);</pre>
<p>
Sets the active combo box item by corresponding enum value.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>combo</code></em> :</span></p></td>
<td>A combo box which was created with <a class="link" href="libgwydgets-gwycombobox.html#gwy-enum-combo-box-new" title="gwy_enum_combo_box_new ()"><code class="function">gwy_enum_combo_box_new()</code></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>active</code></em> :</span></p></td>
<td>The enum value to show as currently selected.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gwy-enum-combo-box-update-int"></a><h3>gwy_enum_combo_box_update_int ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> gwy_enum_combo_box_update_int (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/gtk/GtkComboBox.html"><span class="type">GtkComboBox</span></a> *combo</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *integer</code></em>);</pre>
<p>
Convenience callback keeping an integer synchronized with selected enum
combo box value.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>combo</code></em> :</span></p></td>
<td>A combo box which was created with <a class="link" href="libgwydgets-gwycombobox.html#gwy-enum-combo-box-new" title="gwy_enum_combo_box_new ()"><code class="function">gwy_enum_combo_box_new()</code></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>integer</code></em> :</span></p></td>
<td>Pointer to an integer to update to selected enum value.</td>
</tr>
</tbody>
</table></div>
</div>
</div>
<div class="refsect1">
<a name="libgwydgets-gwycombobox.see-also"></a><h2>See Also</h2>
<a class="link" href="libgwydgets-gwyradiobuttons.html" title="gwyradiobuttons">gwyradiobuttons</a>
-- radio button constructors
</div>
</div>
<div class="footer">
<hr>
Generated by GTK-Doc V1.8</div>
</body>
</html>
|