gtktoolbar.sgml 9.62 KB
Newer Older
Owen Taylor's avatar
Owen Taylor committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
<!-- ##### SECTION Title ##### -->
GtkToolbar

<!-- ##### SECTION Short_Description ##### -->
create bars of buttons and other widgets.

<!-- ##### SECTION Long_Description ##### -->
<para>
A toolbar is created with a call to gtk_toolbar_new().
</para>
<para>
Buttons with text and/or images are added with gtk_toolbar_append_item(), gtk_toolbar_prepend_item(), and gtk_toolbar_insert_item().
</para>
<para>
Any of #GtkToggleButton, #GtkRadioButton, or an arbitrary widget can be added to the toolbar with gtk_toolbar_append_element(), gtk_toolbar_prepend_element(), and gtk_toolbar_insert_element().
</para>
<para>
18
Widgets can be visibly grouped by adding gaps between widgets using gtk_toolbar_append_space(), gtk_toolbar_prepend_space(), and gtk_toolbar_insert_space().
Owen Taylor's avatar
Owen Taylor committed
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
</para>

<!-- ##### SECTION See_Also ##### -->
<para>
<variablelist>
<varlistentry>
<term>#GtkToolTips</term>
<listitem><para>Change the properties of a #GtkToolbar's #GtkTooltips.</para></listitem>
</varlistentry>
<varlistentry>
<term>#GtkTipsQuery</term>
<listitem><para>Make use of the private tips of toolbar elements.</para></listitem>
</varlistentry>
</variablelist>
</para>

<!-- ##### STRUCT GtkToolbar ##### -->
<para>
<structfield>num_children</structfield> is an integer specifying how many toolbar items the #GtkToolbar contains. <structfield>children</structfield> is a #GList of the child widgets of the toolbar.
</para>
<para>
<structfield>orientation</structfield>
</para>


<!-- ##### ENUM GtkToolbarChildType ##### -->
<para>
46 47
#GtkToolbarChildType is used to set the type of new elements that are added 
to a #GtkToolbar.
Owen Taylor's avatar
Owen Taylor committed
48 49
</para>

50 51
@GTK_TOOLBAR_CHILD_SPACE: a space in the style of the toolbar's #GtkToolbarSpaceStyle.
@GTK_TOOLBAR_CHILD_BUTTON: a #GtkButton.
52 53 54
@GTK_TOOLBAR_CHILD_TOGGLEBUTTON: a #GtkToggleButton.
@GTK_TOOLBAR_CHILD_RADIOBUTTON: a #GtkRadioButton.
@GTK_TOOLBAR_CHILD_WIDGET: a standard #GtkWidget.
Owen Taylor's avatar
Owen Taylor committed
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75

<!-- ##### ENUM GtkToolbarSpaceStyle ##### -->
<para>

</para>

@GTK_TOOLBAR_SPACE_EMPTY: 
@GTK_TOOLBAR_SPACE_LINE: 

<!-- ##### STRUCT GtkToolbarChild ##### -->
<para>

</para>

@type: 
@widget: 
@icon: 
@label: 

<!-- ##### FUNCTION gtk_toolbar_new ##### -->
<para>
76
Creates a new toolbar. 
Owen Taylor's avatar
Owen Taylor committed
77 78
</para>

79
@Returns: the newly-created toolbar.
Owen Taylor's avatar
Owen Taylor committed
80 81 82 83


<!-- ##### FUNCTION gtk_toolbar_append_item ##### -->
<para>
84
Adds a new button to the end (right or bottom edges) of the given toolbar.
Owen Taylor's avatar
Owen Taylor committed
85 86 87 88 89 90 91 92 93 94 95 96 97 98
</para>

@toolbar: a #GtkToolbar.
@text: give your toolbar button a label.
@tooltip_text: a string that appears when the user holds the mouse over this item.
@tooltip_private_text: use with #GtkTipsQuery.
@icon: a #GtkWidget that should be used as the button's icon.
@callback: the function to be executed when the button is pressed.
@user_data: a pointer to any data you wish to be passed to the callback.
@Returns: the new toolbar item as a #GtkWidget.


<!-- ##### FUNCTION gtk_toolbar_prepend_item ##### -->
<para>
99
Adds a new button to the beginning (top or left edges) of the given toolbar.
Owen Taylor's avatar
Owen Taylor committed
100 101 102 103 104 105 106 107 108 109 110 111 112 113
</para>

@toolbar: a #GtkToolbar.
@text: give your toolbar button a label.
@tooltip_text: a string that appears when the user holds the mouse over this item.
@tooltip_private_text: use with #GtkTipsQuery.
@icon: a #GtkWidget that should be used as the button's icon.
@callback: the function to be executed when the button is pressed.
@user_data: a pointer to any data you wish to be passed to the callback.
@Returns: the new toolbar item as a #GtkWidget.


<!-- ##### FUNCTION gtk_toolbar_insert_item ##### -->
<para>
114
Inserts a new item into the toolbar. You must specify the position in the toolbar where it will be inserted.
Owen Taylor's avatar
Owen Taylor committed
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
</para>

@toolbar: a #GtkToolbar.
@text: give your toolbar button a label.
@tooltip_text: a string that appears when the user holds the mouse over this item.
@tooltip_private_text: use with #GtkTipsQuery.
@icon: a #GtkWidget that should be used as the button's icon.
@callback: the function to be executed when the button is pressed.
@user_data: a pointer to any data you wish to be passed to the callback.
@position: the number of widgets to insert this item after.
@Returns: the new toolbar item as a #GtkWidget.


<!-- ##### FUNCTION gtk_toolbar_append_space ##### -->
<para>
130
Adds a new space to the end of the toolbar.
Owen Taylor's avatar
Owen Taylor committed
131 132 133 134 135 136 137
</para>

@toolbar: a #GtkToolbar.


<!-- ##### FUNCTION gtk_toolbar_prepend_space ##### -->
<para>
138
Adds a new space to the beginning of the toolbar.
Owen Taylor's avatar
Owen Taylor committed
139 140 141 142 143 144 145
</para>

@toolbar: a #GtkToolbar.


<!-- ##### FUNCTION gtk_toolbar_insert_space ##### -->
<para>
146
Inserts a new space in the toolbar at the specified position.
Owen Taylor's avatar
Owen Taylor committed
147 148 149 150 151 152 153 154
</para>

@toolbar: a #GtkToolbar
@position: the number of widgets after which a space should be inserted.


<!-- ##### FUNCTION gtk_toolbar_append_element ##### -->
<para>
155
Adds a new element to the end of a toolbar.
Owen Taylor's avatar
Owen Taylor committed
156
</para>
157 158 159 160 161 162
<para>
If @type == %GTK_TOOLBAR_CHILD_WIDGET, @widget is used as the new element.
If @type == %GTK_TOOLBAR_CHILD_RADIOBUTTON, @widget is used to determine
the radio group for the new element. In all other cases, @widget must
be %NULL.
</para>
Owen Taylor's avatar
Owen Taylor committed
163 164 165

@toolbar: a #GtkToolbar.
@type: a value of type #GtkToolbarChildType that determines what @widget will be.
Owen Taylor's avatar
Owen Taylor committed
166
@widget: a #GtkWidget, or %NULL.
Owen Taylor's avatar
Owen Taylor committed
167 168 169 170 171 172 173 174 175 176 177
@text: the element's label.
@tooltip_text: the element's tooltip.
@tooltip_private_text: used for context-sensitive help about this toolbar element.
@icon: a #GtkWidget that provides pictorial representation of the element's function.
@callback: the function to be executed when the button is pressed.
@user_data: any data you wish to pass to the callback.
@Returns: the new toolbar element as a #GtkWidget.


<!-- ##### FUNCTION gtk_toolbar_prepend_element ##### -->
<para>
178
Adds a new element to the beginning of a toolbar.
Owen Taylor's avatar
Owen Taylor committed
179
</para>
180 181 182 183 184 185
<para>
If @type == %GTK_TOOLBAR_CHILD_WIDGET, @widget is used as the new element.
If @type == %GTK_TOOLBAR_CHILD_RADIOBUTTON, @widget is used to determine
the radio group for the new element. In all other cases, @widget must
be %NULL.
</para>
Owen Taylor's avatar
Owen Taylor committed
186 187 188

@toolbar: a #GtkToolbar.
@type: a value of type #GtkToolbarChildType that determines what @widget will be.
Owen Taylor's avatar
Owen Taylor committed
189
@widget: a #GtkWidget, or %NULL
Owen Taylor's avatar
Owen Taylor committed
190 191 192 193 194 195 196 197 198 199 200 201 202 203
@text: the element's label.
@tooltip_text: the element's tooltip.
@tooltip_private_text: used for context-sensitive help about this toolbar element.
@icon: a #GtkWidget that provides pictorial representation of the element's function.
@callback: the function to be executed when the button is pressed.
@user_data: any data you wish to pass to the callback.
@Returns: the new toolbar element as a #GtkWidget.


<!-- ##### FUNCTION gtk_toolbar_insert_element ##### -->
<para>

</para>

Owen Taylor's avatar
Owen Taylor committed
204 205 206
@toolbar: 
@type: 
@widget: 
207 208
@text: 
@tooltip_text: 
Owen Taylor's avatar
Owen Taylor committed
209 210
@tooltip_private_text: 
@icon: 
211
@callback: 
Owen Taylor's avatar
Owen Taylor committed
212 213 214
@user_data: 
@position: 
@Returns: 
Owen Taylor's avatar
Owen Taylor committed
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


<!-- ##### FUNCTION gtk_toolbar_append_widget ##### -->
<para>

</para>

@toolbar: 
@widget: 
@tooltip_text: 
@tooltip_private_text: 


<!-- ##### FUNCTION gtk_toolbar_prepend_widget ##### -->
<para>

</para>

@toolbar: 
@widget: 
@tooltip_text: 
@tooltip_private_text: 


<!-- ##### FUNCTION gtk_toolbar_insert_widget ##### -->
<para>

</para>

@toolbar: 
@widget: 
@tooltip_text: 
@tooltip_private_text: 
@position: 


<!-- ##### FUNCTION gtk_toolbar_set_orientation ##### -->
<para>
253
Sets whether a toolbar should appear horizontally or vertically.
Owen Taylor's avatar
Owen Taylor committed
254 255 256 257 258 259 260 261
</para>

@toolbar: a #GtkToolbar.
@orientation: a new #GtkOrientation.


<!-- ##### FUNCTION gtk_toolbar_set_style ##### -->
<para>
262
Alters the view of @toolbar to display either icons only, text only, or both.
Owen Taylor's avatar
Owen Taylor committed
263 264 265 266 267 268 269 270
</para>

@toolbar: a #GtkToolbar.
@style: the new style for @toolbar.


<!-- ##### FUNCTION gtk_toolbar_set_tooltips ##### -->
<para>
271
Sets if the tooltips of a toolbar should be active or not.
Owen Taylor's avatar
Owen Taylor committed
272 273 274
</para>

@toolbar: a #GtkToolbar.
275
@enable: set to %FALSE to disable the tooltips, or %TRUE to enable them.
Owen Taylor's avatar
Owen Taylor committed
276 277


Havoc Pennington's avatar
Havoc Pennington committed
278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301
<!-- ##### FUNCTION gtk_toolbar_insert_stock ##### -->
<para>

</para>

@toolbar: 
@stock_id: 
@tooltip_text: 
@tooltip_private_text: 
@callback: 
@user_data: 
@position: 
@Returns: 


<!-- ##### FUNCTION gtk_toolbar_set_icon_size ##### -->
<para>

</para>

@toolbar: 
@icon_size: 


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
<!-- ##### FUNCTION gtk_toolbar_get_icon_size ##### -->
<para>

</para>

@toolbar: 
@Returns: 


<!-- ##### FUNCTION gtk_toolbar_get_orientation ##### -->
<para>

</para>

@toolbar: 
@Returns: 


<!-- ##### FUNCTION gtk_toolbar_get_style ##### -->
<para>

</para>

@toolbar: 
@Returns: 


<!-- ##### FUNCTION gtk_toolbar_get_tooltips ##### -->
<para>

</para>

@toolbar: 
@Returns: 


<!-- ##### FUNCTION gtk_toolbar_remove_space ##### -->
<para>

</para>

@toolbar: 
@position: 


<!-- ##### FUNCTION gtk_toolbar_unset_icon_size ##### -->
<para>

</para>

@toolbar: 


<!-- ##### FUNCTION gtk_toolbar_unset_style ##### -->
<para>

</para>

@toolbar: 


Owen Taylor's avatar
Owen Taylor committed
363 364
<!-- ##### SIGNAL GtkToolbar::orientation-changed ##### -->
<para>
365
Should be used if you wish to perform an action when the orientation of a toolbar is changed.
Owen Taylor's avatar
Owen Taylor committed
366 367 368 369 370 371 372
</para>

@toolbar: the object which received the signal.
@orientation: the new #GtkOrientation of the toolbar.

<!-- ##### SIGNAL GtkToolbar::style-changed ##### -->
<para>
373
Should be used if you wish to perform an action when ever the style of a toolbar is adjusted. For example, this would be a useful signal to connect to if you want to display more items on the toolbar when it is in icon-only mode; each item takes less space on the bar.
Owen Taylor's avatar
Owen Taylor committed
374 375 376 377 378
</para>

@toolbar: the object which received the signal.
@style: the new #GtkToolbarStyle of @toolbar.

379 380 381 382 383
<!-- ##### ARG GtkToolbar:orientation ##### -->
<para>

</para>

Owen Taylor's avatar
Owen Taylor committed
384
<!-- ##### ARG GtkToolbar:toolbar-style ##### -->
385 386 387 388
<para>

</para>

Owen Taylor's avatar
Owen Taylor committed
389
<!-- ##### ARG GtkToolbar:internal-padding ##### -->
390 391 392 393
<para>

</para>

Owen Taylor's avatar
Owen Taylor committed
394
<!-- ##### ARG GtkToolbar:space-size ##### -->
395 396 397 398
<para>

</para>

Owen Taylor's avatar
Owen Taylor committed
399
<!-- ##### ARG GtkToolbar:space-style ##### -->
400 401 402 403
<para>

</para>

Owen Taylor's avatar
Owen Taylor committed
404
<!-- ##### ARG GtkToolbar:shadow-type ##### -->
405 406 407 408
<para>

</para>

Owen Taylor's avatar
Owen Taylor committed
409
<!-- ##### ARG GtkToolbar:button-relief ##### -->
410 411 412 413
<para>

</para>