summaryrefslogtreecommitdiff
path: root/docs/reference/pygtk-gtkexpander.xml
blob: 22ddc6906b7eda9a0455798d82d9145c317a8591 (plain)
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
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
<?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-gtkexpander">
  <refnamediv>
    <refname>gtk.Expander</refname> <refpurpose>a container that can hide
    its child (new in PyGTK 2.4)</refpurpose>
  </refnamediv>

  <refsect1>
    <title>Synopsis</title>

    <classsynopsis language="python">
      <ooclass><classname>gtk.Expander</classname></ooclass>
      <ooclass><classname><link linkend="class-gtkbin">gtk.Bin</link></classname></ooclass>
      <constructorsynopsis language="python">
	<methodname><link linkend="constructor-gtkexpander">gtk.Expander</link></methodname>
	<methodparam><parameter role="keyword">label</parameter><initializer>None</initializer></methodparam>
      </constructorsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkexpander--set-expanded">set_expanded</link></methodname>
	<methodparam><parameter role="keyword">expanded</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkexpander--get-expanded">get_expanded</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkexpander--set-spacing">set_spacing</link></methodname>
	<methodparam><parameter role="keyword">spacing</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkexpander--get-spacing">get_spacing</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkexpander--set-label">set_label</link></methodname>
	<methodparam><parameter role="keyword">label</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkexpander--get-label">get_label</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkexpander--set-use-underline">set_use_underline</link></methodname>
	<methodparam><parameter role="keyword">use_underline</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkexpander--get-use-underline">get_use_underline</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkexpander--set-use-markup">set_use_markup</link></methodname>
	<methodparam><parameter role="keyword">use_markup</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkexpander--get-use-markup">get_use_markup</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkexpander--set-label-widget">set_label_widget</link></methodname>
	<methodparam><parameter role="keyword">label_widget</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkexpander--get-label-widget">get_label_widget</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
    </classsynopsis>

    <programlisting>
<emphasis role="bold">Functions</emphasis>

<methodsynopsis language="python">
	<methodname><link linkend="function-gtk--expander-new-with-mnemonic">gtk.expander_new_with_mnemonic</link></methodname>
	<methodparam><parameter role="keyword">label</parameter><initializer>None</initializer></methodparam>
      </methodsynopsis></programlisting>

  </refsect1>

  <refsect1>
    <title>Ancestry</title>

<synopsis>+-- <link linkend="class-gobject">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-gtkbin">gtk.Bin</link>
          +-- <link linkend="class-gtkexpander">gtk.Expander</link>
</synopsis>

  <refsect1 id="properties-gtkexpander">
    <title>gtk.Expander 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>

    <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>"expanded"</entry>
	      <entry>Read-Write</entry>
	      <entry>If <literal>True</literal>, the expander has been
opened to reveal the child widget.</entry>
	    </row>

	    <row valign="top">
	      <entry>"label"</entry>
	      <entry>Read-Write</entry>
	      <entry>The text of the expander's label.</entry>
	    </row>

	    <row valign="top">
	      <entry>"label-widget"</entry>
	      <entry>Read-Write</entry>
	      <entry>A widget to display in place of the usual expander
label.</entry>
	    </row>

	    <row valign="top">
	      <entry>"spacing"</entry>
	      <entry>Read-Write</entry>
	      <entry>The space to put between the label and the child.</entry>
	    </row>

	    <row valign="top">
	      <entry>"use-markup"</entry>
	      <entry>Read-Write</entry>
	      <entry>If <literal>True</literal>, the text of the label
includes Pango markup. See the <link
linkend="function-pango--parse-markup"><function>pango.parse_markup</function>()</link>
function.</entry>
	    </row>

	    <row valign="top">
	      <entry>"use-underline"</entry>
	      <entry>Read-Write</entry>
	      <entry>If <literal>True</literal>, n underline in the text
indicates the next character should be used for the mnemonic accelerator
key.</entry>
	    </row>

	  </tbody>
	</tgroup>
      </informaltable>
    </blockquote>

  </refsect1>

  <refsect1 id="style-properties-gtkexpander">
    <title>gtk.Expander 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>"expander-size"</entry>
	      <entry>Read</entry>
	      <entry>The size of the expander arrow.</entry>
	    </row>

	    <row valign="top">
	      <entry>"expander-spacing"</entry>
	      <entry>Read</entry>
	      <entry>The spacing around expander arrow.</entry>
	    </row>

	  </tbody>
	</tgroup>
      </informaltable>
    </blockquote>

  </refsect1>

  </refsect1>

  <refsect1 id="signal-prototypes-gtkexpander">
    <title>gtk.Expander 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-gtkexpander--activate">activate</link>"</term>
        <listitem>
          <methodsynopsis language="python"><methodname>callback</methodname>
            <methodparam><parameter>expander</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.4 and above.</para>
    </note>

    <para>A <link
    linkend="class-gtkexpander"><classname>gtk.Expander</classname></link>
    allows the user to hide or show its child by clicking on an expander
    triangle similar to the triangles used in a <link
    linkend="class-gtktreeview"><classname>gtk.TreeView</classname></link>.</para>

    <para>Normally you use an expander as you would use any other descendant
    of <link linkend="class-gtkbin"><classname>gtk.Bin</classname></link>;
    you create the child widget and use <link
    linkend="method-gtkcontainer--add"><methodname>gtk.Container.add</methodname>()</link>
    to add it to the expander. When the expander is toggled, it will take
    care of showing and hiding the child automatically.</para>

    <refsect2 id="expander-description-special-usage">
      <title>Special Usage</title>

      <para>There there are situations in which you may prefer to show and
      hide the expanded widget yourself, such as when you want to actually
      create the widget at expansion time. In this case, create a <link
      linkend="class-gtkexpander"><classname>gtk.Expander</classname></link>
      but do not add a child to it. The expander widget has the "expanded"
      property that can be used to monitor its expansion state. You should
      watch this property with a signal connection as follows:</para>

      <programlisting>
  expander = gtk.expander_new_with_mnemonic("_More Options")
  expander.connect("notify::expanded", expander_callback)

  ...

  def expander_callback(expander, param_spec, user_data):
    if expander.get_expanded():
      # Show or create widgets
    else:
      # Hide or destroy widgets
</programlisting>

      <para>The "activate" signal can also be used to track the expansion
      though it occurs before the "expanded" property is changed so the
      logic of the <function>expander_callback</function>() function would
      have to be reversed.</para>

    </refsect2>

  </refsect1>

  <refsect1 id="constructor-gtkexpander">
    <title>Constructor</title>

    <programlisting><constructorsynopsis language="python">
	<methodname>gtk.Expander</methodname>
	<methodparam><parameter role="keyword">label</parameter><initializer>None</initializer></methodparam>
      </constructorsynopsis></programlisting>
    <variablelist>
      <varlistentry>
	<term><parameter role="keyword">label</parameter>&nbsp;:</term>
	<listitem><simpara>the text of the label or
<literal>None</literal></simpara></listitem>
      </varlistentry>
      <varlistentry>
	<term><emphasis>Returns</emphasis>&nbsp;:</term>
	<listitem><simpara>a new <link linkend="class-gtkexpander"><classname>gtk.Expander</classname></link> widget.</simpara></listitem>
      </varlistentry>
    </variablelist>

    <note>
      <para>This constructor is available in PyGTK 2.4 and above.</para>
    </note>

    <para>Creates a new expander using <parameter>label</parameter> as the
text of the label. If <parameter>label</parameter> is
<literal>None</literal> or not specified, no label will be created.</para>

  </refsect1>

  <refsect1>
    <title>Methods</title>

    <refsect2 id="method-gtkexpander--set-expanded">
      <title>gtk.Expander.set_expanded</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_expanded</methodname>
	  <methodparam><parameter role="keyword">expanded</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">expanded</parameter>&nbsp;:</term>
	  <listitem><simpara>if <literal>True</literal>, the child widget is
revealed</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>set_expanded</methodname>() method sets the
"expanded" property to the value of <parameter>expanded</parameter>. If
<parameter>expanded</parameter> is <literal>True</literal>, the child widget
is revealed; if <literal>False</literal>, the child widget is hidden.</para>

    </refsect2>

    <refsect2 id="method-gtkexpander--get-expanded">
      <title>gtk.Expander.get_expanded</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_expanded</methodname>
	  <methodparam></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>True if the child is
revealed.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>get_expanded</methodname>() method returns the
value of the "expanded" property. If "expanded" is <literal>True</literal>
the child widget is revealed.</para>

    </refsect2>

    <refsect2 id="method-gtkexpander--set-spacing">
      <title>gtk.Expander.set_spacing</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_spacing</methodname>
	  <methodparam><parameter role="keyword">spacing</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">spacing</parameter>&nbsp;:</term>
	  <listitem><simpara>the distance between the expander and child
in pixels.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>set_spacing</methodname>() method sets the
"spacing" property to the value of <parameter>spacing</parameter> that sets
is the number of pixels to place between expander and the child.</para>

    </refsect2>

    <refsect2 id="method-gtkexpander--get-spacing">
      <title>gtk.Expander.get_spacing</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_spacing</methodname>
	  <methodparam></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the spacing between the expander and
child.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>get_spacing</methodname>() method returns the
value of the "spacing" property set by the <link
linkend="method-gtkexpander--set-spacing"><methodname>set_spacing()</methodname></link>
method.</para>

    </refsect2>

    <refsect2 id="method-gtkexpander--set-label">
      <title>gtk.Expander.set_label</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_label</methodname>
	  <methodparam><parameter role="keyword">label</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">label</parameter>&nbsp;:</term>
	  <listitem><simpara>a string to use as the label or
<literal>None</literal></simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>set_label</methodname>() method sets the "label"
property to the value of <parameter>label</parameter> and sets the text of
the label of the expander. Any previously set label will be cleared. If
<parameter>label</parameter> is <literal>None</literal> the expander will
have no label.</para>

    </refsect2>

    <refsect2 id="method-gtkexpander--get-label">
      <title>gtk.Expander.get_label</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_label</methodname>
	  <methodparam></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the text of the label widget.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>get_label</methodname>() method returns the
value of the "label" property that contains the text of the expander label,
as set by the <link
linkend="method-gtkexpander--set-label"><methodname>set_label()</methodname></link>
method. If the label text has not been set the return value will be
<literal>None</literal>.</para>

    </refsect2>

    <refsect2 id="method-gtkexpander--set-use-underline">
      <title>gtk.Expander.set_use_underline</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_use_underline</methodname>
	  <methodparam><parameter role="keyword">use_underline</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">use_underline</parameter>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if underlines in the
text indicate mnemonics</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>set_use_underline</methodname>() method sets the
"use_underline" property to the value of
<parameter>use_underline</parameter>. If
<parameter>use_underline</parameter> is <literal>True</literal>, an
underline in the text of the expander label indicates the next character
should be used for the mnemonic accelerator key.</para>

    </refsect2>

    <refsect2 id="method-gtkexpander--get-use-underline">
      <title>gtk.Expander.get_use_underline</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_use_underline</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if an embedded
underline in the expander label indicates the mnemonic accelerator
keys.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>get_use_underline</methodname>() method returns
the value of the "use-underline" property. If "use-underline" is
<literal>True</literal> an embedded underline in the expander label
indicates a mnemonic. See the <link
linkend="method-gtkexpander--set-use-underline"><methodname>set_use_underline()</methodname></link>
method.</para>

    </refsect2>

    <refsect2 id="method-gtkexpander--set-use-markup">
      <title>gtk.Expander.set_use_markup</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_use_markup</methodname>
	  <methodparam><parameter role="keyword">use_markup</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">use_markup</parameter>&nbsp;:</term>
	  <listitem><simpara>if <literal>True</literal>, the label's text
should be parsed for markup</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>set_use_markup</methodname>() method sets the
"use-markup" property to the value of <parameter>use_markup</parameter>. If
<parameter>use_markup</parameter> is <literal>True</literal> the text of the
label contains markup in the <link linkend="pango-markup-language">Pango
text markup language</link>. See the <link
linkend="method-gtklabel--set-markup"><methodname>gtk.Label.set_markup()</methodname></link> method for more information.</para>

    </refsect2>

    <refsect2 id="method-gtkexpander--get-use-markup">
      <title>gtk.Expander.get_use_markup</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_use_markup</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the label's text
will be parsed for markup</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>get_use_markup</methodname>() method returns the
value of the "use-markup" property. If "use-markup" is
<literal>True</literal>, the label's text is interpreted as marked up with
the <link linkend="pango-markup-language">Pango text markup
language</link>. See the <link
linkend="method-gtkexpander--set-use-markup"><methodname>set_use_markup()</methodname></link>
method.</para>

    </refsect2>

    <refsect2 id="method-gtkexpander--set-label-widget">
      <title>gtk.Expander.set_label_widget</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_label_widget</methodname>
	  <methodparam><parameter role="keyword">label_widget</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">label_widget</parameter>&nbsp;:</term>
	  <listitem><simpara>the new label widget or
<literal>None</literal></simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>set_label_widget</methodname>() method sets the
expander to use the widget specified by <parameter>label_widget</parameter>
as the label instead of a <link
linkend="class-gtklabel"><classname>gtk.Label</classname></link>. This
widget appears embedded alongside the expander arrow. If
<parameter>label_widget</parameter> is <literal>None</literal>, the expander
will have no label.</para>

    </refsect2>

    <refsect2 id="method-gtkexpander--get-label-widget">
      <title>gtk.Expander.get_label_widget</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_label_widget</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the label widget, or <literal>None</literal>
if there is none.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>get_label_widget</methodname>() method retrieves
the expander's label widget. See the <link
linkend="method-gtkexpander--set-label-widget"><methodname>set_label_widget()</methodname></link>
method.</para>

    </refsect2>

  </refsect1>

  <refsect1>
    <title>Functions</title>

    <refsect2 id="function-gtk--expander-new-with-mnemonic">
      <title>gtk.expander_new_with_mnemonic</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>gtk.expander_new_with_mnemonic</methodname>
	  <methodparam><parameter
			 role="keyword">label</parameter><initializer>None</initializer></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">label</parameter>&nbsp;:</term>
	  <listitem><simpara> the text of the label with an underscore in
front of the mnemonic character or <literal>None</literal></simpara></listitem>
	</varlistentry>
	<varlistentry>
	<term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara> a new <link
linkend="class-gtkexpander"><classname>gtk.Expander</classname></link> widget.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This function is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <function>gtk.expander_new_with_mnemonic</function>()
function creates a new <link
linkend="class-gtkexpander"><classname>gtk.Expander</classname></link> using
<parameter>label</parameter> as the text of the label. If characters in
<parameter>label</parameter> are preceded by an underscore, they are
underlined. If you need a literal underscore character in a label, use '__'
(two underscores). The first underlined character represents a keyboard
accelerator called a mnemonic. Pressing <keycap>Alt</keycap> with that key
activates the button. If <parameter>label</parameter> is
<literal>None</literal> the expander will have no label.</para>

    </refsect2>

  </refsect1>

  <refsect1>
    <title>Signals</title>

    <refsect2 id="signal-gtkexpander--activate">
      <title>The "activate" gtk.Expander Signal</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>callback</methodname>
	  <methodparam><parameter>expander</parameter></methodparam>
	  <methodparam><parameter>user_param1</parameter></methodparam>
	  <methodparam><parameter>...</parameter></methodparam>
	</methodsynopsis></programlisting>

      <variablelist>
	<varlistentry>
	  <term><parameter>expander</parameter>&nbsp;:</term>
	  <listitem><simpara>the expander that received the
signal</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter>user_param1</parameter>&nbsp;:</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>&nbsp;:</term>
	  <listitem><simpara>additional user parameters (if
any)</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This signal is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The "activate" signal is emitted when the expander is activated
      by the user clicking on the expander toggle. Using the
      "notify:expanded" signal may be more appropriate in some cases as
      noted in the <link
      linkend="expander-description-special-usage">Special Usage
      description</link>.</para>

    </refsect2>

  </refsect1>

</refentry>