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 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599
|
<?xml version="1.0" standalone="no"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<refentry id="class-gtkinfobar">
<refnamediv>
<refname>gtk.InfoBar</refname>
<refpurpose>report important messages to the user (new in PyGTK 2.22)</refpurpose>
</refnamediv>
<refsect1>
<title>Synopsis</title>
<classsynopsis language="python">
<ooclass><classname>gtk.InfoBar</classname></ooclass>
<ooclass><classname><link linkend="class-gtkhbox">gtk.HBox</link></classname></ooclass>
<constructorsynopsis language="python">
<methodname><link linkend="constructor-gtkinfobar">gtk.InfoBar</link></methodname>
<methodparam></methodparam>
</constructorsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtkinfobar--get-action-area">get_action_area</link></methodname>
<methodparam></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtkinfobar--get-content-area">get_content_area</link></methodname>
<methodparam></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtkinfobar--add-action-widget">add_action_widget</link></methodname>
<methodparam><parameter role="keyword">child</parameter></methodparam>
<methodparam><parameter role="keyword">response_id</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtkinfobar--add-button">add_button</link></methodname>
<methodparam><parameter role="keyword">button_text</parameter></methodparam>
<methodparam><parameter role="keyword">response_id</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtkinfobar--add-buttons">add_buttons</link></methodname>
<methodparam><parameter role="keyword">first_button_text</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtkinfobar--set-response-sensitive">set_response_sensitive</link></methodname>
<methodparam><parameter role="keyword">response_id</parameter></methodparam>
<methodparam><parameter role="keyword">setting</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtkinfobar--set-default-response">set_default_response</link></methodname>
<methodparam><parameter role="keyword">response_id</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtkinfobar--response">response</link></methodname>
<methodparam><parameter role="keyword">response_id</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtkinfobar--set-message-type">set_message_type</link></methodname>
<methodparam><parameter role="keyword">message_type</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtkinfobar--get-message-type">get_message_type</link></methodname>
<methodparam></methodparam>
</methodsynopsis>
</classsynopsis>
</refsect1>
<refsect1>
<title>Ancestry</title>
<synopsis>+-- <link linkend="class-gobject">GObject</link>
+-- <link linkend="class-gtkobject">gtk.Object</link>
+-- <link linkend="class-gtkwidget">gtk.Widget</link>
+-- <link linkend="class-gtkcontainer">gtk.Container</link>
+-- <link linkend="class-gtkbox">gtk.Box</link>
+-- <link linkend="class-gtkhbox">gtk.HBox</link>
+-- <link linkend="class-gtkinfobar">gtk.InfoBar</link>
</synopsis>
</refsect1>
<refsect1>
<title>Implemented Interfaces</title>
<para>
<link linkend="class-gtkinfobar"><classname>gtk.InfoBar</classname></link>
implements
<link linkend="class-gtkbuildable"><classname>gtk.Buildable</classname></link>
<link linkend="class-atkimplementor"><classname>atk.ImplementorIFace</classname></link>
</para>
</refsect1>
<refsect1 id="properties-gtkinfobar">
<title>gtk.InfoBar Properties</title>
<para><link linkend="properties-gtkobject">gtk.Object Properties</link></para>
<para><link linkend="properties-gtkwidget">gtk.Widget Properties</link></para>
<para><link linkend="properties-gtkcontainer">gtk.Container Properties</link></para>
<para><link linkend="properties-gtkbox">gtk.Box Properties</link></para>
<blockquote role="properties">
<informaltable pgwide="1" frame="none">
<tgroup cols="3">
<colspec column="1" colwidth="1in"/>
<colspec column="2" colwidth="1in"/>
<colspec column="3" colwidth="4in"/>
<tbody>
<row valign="top">
<entry>"message-type"</entry>
<entry>Read-Write-Construct</entry>
<entry>The type of the message.
The type is used to determine the colors to use in the info bar. The following
symbolic color names can by used to customize these colors: "info_fg_color",
"info_bg_color", "warning_fg_color", "warning_bg_color", "question_fg_color",
"question_bg_color", "error_fg_color", "error_bg_color". "other_fg_color", "other_bg_color".
If the type is gtk.MESSAGE_OTHER, no info bar is painted but the colors are still set.
Default value: gtk.MESSAGE_INFO
This property is available in GTK+ 2.18 and above.</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</blockquote>
</refsect1>
<refsect1 id="style-properties-gtkinfobar">
<title>gtk.InfoBar Style Properties</title>
<para><link linkend="style-properties-gtkwidget">gtk.Widget Style Properties</link></para>
<blockquote role="properties">
<informaltable pgwide="1" frame="none">
<tgroup cols="3">
<colspec column="1" colwidth="1in"/>
<colspec column="2" colwidth="1in"/>
<colspec column="3" colwidth="4in"/>
<tbody>
<row valign="top">
<entry>"action-area-border"</entry>
<entry>Read</entry>
<entry>Width of the border around the action area of the info bar.
Allowed values: >= 0
Default value: 5
This property is available in GTK+ 2.18 and above.</entry>
</row>
<row valign="top">
<entry>"button-spacing"</entry>
<entry>Read</entry>
<entry>Spacing between buttons in the action area of the info bar.
Allowed values: >=0
Default value: 6
This property is available in GTK+ 2.18 and above.</entry>
</row>
<row valign="top">
<entry>"content-area-border"</entry>
<entry>Read</entry>
<entry>The width of the border around the content content area of the info bar.
Allowed values: >=0
Default value: 8
This property is available in GTK+ 2.18 and above.</entry>
</row>
<row valign="top">
<entry>"content-area-spacing"</entry>
<entry>Read</entry>
<entry>The default spacing used between elements of the content area of the info bar.
Allowed values: >=0
Default value: 16
This property is available in GTK+ 2.18 and above.</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</blockquote>
</refsect1>
<refsect1 id="signal-prototypes-gtkinfobar">
<title>gtk.InfoBar Signal Prototypes</title>
<para><link linkend="signal-prototypes-gobject">gobject.GObject Signal Prototypes</link></para>
<para><link linkend="signal-prototypes-gtkobject">gtk.Object Signal Prototypes</link></para>
<para><link linkend="signal-prototypes-gtkwidget">gtk.Widget Signal Prototypes</link></para>
<para><link linkend="signal-prototypes-gtkcontainer">gtk.Container Signal Prototypes</link></para>
<variablelist>
<varlistentry>
<term>"<link linkend="signal-gtkinfobar--close">close</link>"</term>
<listitem>
<methodsynopsis language="python"><methodname>callback</methodname>
<methodparam><parameter>infobar</parameter></methodparam>
<methodparam><parameter>user_param1</parameter></methodparam>
<methodparam><parameter>...</parameter></methodparam>
</methodsynopsis>
</listitem>
</varlistentry>
<varlistentry>
<term>"<link linkend="signal-gtkinfobar--response">response</link>"</term>
<listitem>
<methodsynopsis language="python"><methodname>callback</methodname>
<methodparam><parameter>infobar</parameter></methodparam>
<methodparam><parameter>response_id</parameter></methodparam>
<methodparam><parameter>user_param1</parameter></methodparam>
<methodparam><parameter>...</parameter></methodparam>
</methodsynopsis>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<note>
<para>This widget is available in PyGTK 2.22 and above.</para>
</note>
<para><link linkend="class-gtkinfobar"><classname>gtk.InfoBar</classname></link>
is a widget that can be used to show messages to the user without showing a dialog.
It is often temporarily shown at the top or bottom of a document. In contrast to
<link linkend="class-gtkdialog"><classname>gtk.Dialog</classname></link>, which has
a horizontal action area at the bottom,
<link linkend="class-gtkinfobar"><classname>gtk.InfoBar</classname></link> has a vertical
action area at the side.</para>
</refsect1>
<refsect1>
<title>Constructor</title>
<programlisting><constructorsynopsis language="python">
<methodname><link linkend="constructor-gtkinfobar">gtk.InfoBar</link></methodname>
<methodparam></methodparam>
</constructorsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara>a new <link linkend="class-gtkinfobar"><classname>gtk.InfoBar</classname></link> object</simpara></listitem>
</varlistentry>
</variablelist>
<note>
<para>This constructor is available in PyGTK 2.22 and above.</para>
</note>
<para>Creates a new <link linkend="class-gtkinfobar"><classname>gtk.InfoBar</classname></link> object.</para>
</refsect1>
<refsect1>
<title>Methods</title>
<refsect2 id="method-gtkinfobar--get-action-area">
<title>gtk.InfoBar.get_action_area</title>
<programlisting><methodsynopsis language="python">
<methodname>get_action_area</methodname>
<methodparam></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara>the action area</simpara></listitem>
</varlistentry>
</variablelist>
<note>
<para>This method is available in PyGTK 2.22 and above.</para>
</note>
<para>The <methodname>get_action_area</methodname>() method returns the action area of the infobar.</para>
</refsect2>
<refsect2 id="method-gtkinfobar--get-content-area">
<title>gtk.InfoBar.get_content_area</title>
<programlisting><methodsynopsis language="python">
<methodname>get_content_area</methodname>
<methodparam></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara>the content area</simpara></listitem>
</varlistentry>
</variablelist>
<note>
<para>This method is available in PyGTK 2.22 and above.</para>
</note>
<para>The <methodname>get_content_area</methodname>() method returns the content area of the infobar.</para>
</refsect2>
<refsect2 id="method-gtkinfobar--add-action-widget">
<title>gtk.InfoBar.add_action_widget</title>
<programlisting><methodsynopsis language="python">
<methodname>add_action_widget</methodname>
<methodparam><parameter role="keyword">child</parameter></methodparam>
<methodparam><parameter role="keyword">response_id</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">child</parameter> :</term>
<listitem><simpara>an activatable widget</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter role="keyword">response_id</parameter> :</term>
<listitem><simpara>response ID for <parameter>child</parameter></simpara></listitem>
</varlistentry>
</variablelist>
<note>
<para>This method is available in PyGTK 2.22 and above.</para>
</note>
<para>Add an activatable widget to the action area of a
<link linkend="class-gtkinfobar"><classname>gtk.InfoBar</classname></link>,
connecting a signal handler that will emit the
<link linkend="class-gtkinfobar"><classname>gtk.InfoBar</classname></link>::response
signal on the message area when the widget is activated. The widget
is appended to the end of the message areas action area.</para>
</refsect2>
<refsect2 id="method-gtkinfobar--add-button">
<title>gtk.InfoBar.add_button</title>
<programlisting><methodsynopsis language="python">
<methodname>add_button</methodname>
<methodparam><parameter role="keyword">button_text</parameter></methodparam>
<methodparam><parameter role="keyword">response_id</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">button_text</parameter> :</term>
<listitem><simpara>text of button, or stock ID</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter role="keyword">response_id</parameter> :</term>
<listitem><simpara>response ID for the button</simpara></listitem>
</varlistentry>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara>the button widget that was added</simpara></listitem>
</varlistentry>
</variablelist>
<note>
<para>This method is available in PyGTK 2.22 and above.</para>
</note>
<para>Adds a button with the given text (or a stock button, if button_text
is a stock ID) and sets things up so that clicking the button will emit
the "response" signal with the given response_id. The button is appended
to the end of the info bars's action area. The button widget is
returned, but usually you don't need it.</para>
</refsect2>
<refsect2 id="method-gtkinfobar--add-buttons">
<title>gtk.InfoBar.add_buttons</title>
<programlisting><methodsynopsis language="python">
<methodname>add_buttons</methodname>
<methodparam><parameter role="keyword">first_button_text</parameter></methodparam>
<methodparam><parameter role="keyword">first_response_id</parameter></methodparam>
<methodparam><parameter role="keyword">...</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">first_button_text</parameter> :</term>
<listitem><simpara>button text or stock ID</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter role="keyword">first_response_id</parameter> :</term>
<listitem><simpara>response ID for the button</simpara></listitem>
</varlistentry>
</variablelist>
<note>
<para>This method is available in PyGTK 2.22 and above.</para>
</note>
<para>Adds more buttons, same as calling
<link linkend="method-gtkinfobar--add-button"><methodname>add_button</methodname></link>()
repeatedly. Each button must have both text and response ID.</para>
</refsect2>
<refsect2 id="method-gtkinfobar--set-response-sensitive">
<title>gtk.InfoBar.set_response_sensitive</title>
<programlisting><methodsynopsis language="python">
<methodname>set_response_sensitive</methodname>
<methodparam><parameter role="keyword">response_id</parameter></methodparam>
<methodparam><parameter role="keyword">setting</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">response_id</parameter> :</term>
<listitem><simpara>a response ID</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter role="keyword">setting</parameter> :</term>
<listitem><simpara>TRUE for sensitive</simpara></listitem>
</varlistentry>
</variablelist>
<note>
<para>This method is available in PyGTK 2.22 and above.</para>
</note>
<para>Calls <link linkend="method-gtkwidget--set-sensitive"><methodname>gtk.Widget.set_sensitive</methodname>()</link>
for each widget in the info bars's action area with the given response_id.
A convenient way to sensitize/desensitize dialog buttons.</para>
</refsect2>
<refsect2 id="method-gtkinfobar--set-default-response">
<title>gtk.InfoBar.set_default_response</title>
<programlisting><methodsynopsis language="python">
<methodname>set_default_response</methodname>
<methodparam><parameter role="keyword">response_id</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">response_id</parameter> :</term>
<listitem><simpara>a response ID</simpara></listitem>
</varlistentry>
</variablelist>
<note>
<para>This method is available in PyGTK 2.22 and above.</para>
</note>
<para>The <methodname>set_default_response</methodname>() method
sets the last widget in the info bar's action area with
the given response_id as the default widget for the dialog.
Pressing "Enter" normally activates the default widget.
</para>
<para> Note that this function currently requires the infobar to
be added to a widget hierarchy.</para>
</refsect2>
<refsect2 id="method-gtkinfobar--response">
<title>gtk.InfoBar.response</title>
<programlisting><methodsynopsis language="python">
<methodname>response</methodname>
<methodparam><parameter role="keyword">response_id</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">response_id</parameter> :</term>
<listitem><simpara>a response ID</simpara></listitem>
</varlistentry>
</variablelist>
<note>
<para>This method is available in PyGTK 2.22 and above.</para>
</note>
<para>Emits the 'response' signal with the given <parameter>response_id</parameter>.</para>
</refsect2>
<refsect2 id="method-gtkinfobar--set-message-type">
<title>gtk.InfoBar.set_message_type</title>
<programlisting><methodsynopsis language="python">
<methodname>set_message_type</methodname>
<methodparam><parameter role="keyword">message_type</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">message_type</parameter> :</term>
<listitem><simpara>a <literal>GtkMessageType</literal></simpara></listitem>
</varlistentry>
</variablelist>
<note>
<para>This method is available in PyGTK 2.22 and above.</para>
</note>
<para>The <methodname>set_message_type</methodname>() method sets
the message type of the message area. GTK+ uses this type to determine what
color to use when drawing the message area.</para>
</refsect2>
<refsect2 id="method-gtkinfobar--get-message-type">
<title>gtk.InfoBar.get_message_type</title>
<programlisting><methodsynopsis language="python">
<methodname>get_message_type</methodname>
<methodparam></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara>the message type of the message area.</simpara></listitem>
</varlistentry>
</variablelist>
<note>
<para>This method is available in PyGTK 2.22 and above.</para>
</note>
<para>The <methodname>get_message_type</methodname>() method returns
the message type of the message area.</para>
</refsect2>
</refsect1>
<refsect1>
<title>Signals</title>
<refsect2 id="signal-gtkinfobar--close">
<title>The "close" gtk.InfoBar Signal</title>
<programlisting><methodsynopsis language="python">
<methodname>callback</methodname>
<methodparam><parameter>infobar</parameter></methodparam>
<methodparam><parameter>user_param1</parameter></methodparam>
<methodparam><parameter>...</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter>infobar</parameter> :</term>
<listitem><simpara>the infobar that received the signal</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>user_param1</parameter> :</term>
<listitem><simpara>the first user parameter (if any) specified with the <link linkend="method-gobject--connect"><methodname>connect</methodname>()</link> method</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>...</parameter> :</term>
<listitem><simpara>additional user parameters (if any)</simpara></listitem>
</varlistentry>
</variablelist>
<note>
<para>This signal is available in GTK+ 2.18 and above.</para>
</note>
<para>The "close" signal keybinding signal which gets emitted when the user
uses a keybinding to dismiss the info bar. The default binding for this signal
is the Escape key.</para>
</refsect2>
<refsect2 id="signal-gtkinfobar--response">
<title>The "response" gtk.InfoBar Signal</title>
<programlisting><methodsynopsis language="python">
<methodname>callback</methodname>
<methodparam><parameter>infobar</parameter></methodparam>
<methodparam><parameter>response_id</parameter></methodparam>
<methodparam><parameter>user_param1</parameter></methodparam>
<methodparam><parameter>...</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter>infobar</parameter> :</term>
<listitem><simpara>the infobar that received the signal</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>response_id</parameter> :</term>
<listitem><simpara>the response ID</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>user_param1</parameter> :</term>
<listitem><simpara>the first user parameter (if any) specified with the <link linkend="method-gobject--connect"><methodname>connect</methodname>()</link> method</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>...</parameter> :</term>
<listitem><simpara>additional user parameters (if any)</simpara></listitem>
</varlistentry>
</variablelist>
<note>
<para>This signal is available in GTK+ 2.18 and above.</para>
</note>
<para>The "response" signal is emitted when an action widget is clicked or the
application programmer calls <link linkend="method-gtkinfobar--response"><methodname>response</methodname></link>().
The response_id depends on which action widget was clicked.</para>
</refsect2>
</refsect1>
</refentry>
|