summaryrefslogtreecommitdiff
path: root/docs/reference/pygtk-gtkrecentaction.xml
blob: d2e6eabaf47b8cd6f851bb8522cbd428064b6200 (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
<?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-gtkrecentaction">
    <refnamediv>
        <refname>gtk.RecentAction</refname>
        <refpurpose>An action of which represents a list of recently used files (new in PyGTK 2.12)</refpurpose>
    </refnamediv>

    <refsect1>
        <title>Synopsis</title>

    <classsynopsis language="python">
        <ooclass><classname>gtk.RecentAction</classname></ooclass>
        <ooclass><classname><link linkend="class-gtkaction">gtk.Action</link></classname></ooclass>
    
        <constructorsynopsis language="python">
            <methodname><link linkend="constructor-gtkrecentaction">gtk.RecentAction</link></methodname>
            <methodparam><parameter role="keyword">name</parameter></methodparam>
            <methodparam><parameter role="keyword">label</parameter></methodparam>
            <methodparam><parameter role="keyword">tooltip</parameter></methodparam>
            <methodparam><parameter role="keyword">stock_id</parameter></methodparam>
        </constructorsynopsis>
        
        <methodsynopsis language="python">
            <methodname><link linkend="method-gtkrecentaction--get-show-numbers">get_show_numbers</link></methodname>
            <methodparam></methodparam>
        </methodsynopsis>
        <methodsynopsis language="python">
            <methodname><link linkend="method-gtkrecentaction--set-show-numbers">set_show_numbers</link></methodname>
            <methodparam><parameter role="keyword">show_numbers</parameter></methodparam>
        </methodsynopsis>

    </classsynopsis>

<programlisting>
<emphasis role="bold">Functions</emphasis>
 
<methodsynopsis language="python">
    <methodname><link linkend="function-gtk--recent-action-new-for-manager">gtk.recent_action_new_for_manager</link></methodname>
    <methodparam><parameter role="keyword">name</parameter></methodparam>
    <methodparam><parameter role="keyword">label</parameter></methodparam>
    <methodparam><parameter role="keyword">tooltip</parameter></methodparam>
    <methodparam><parameter role="keyword">stock_id</parameter></methodparam>
    <methodparam><parameter role="keyword">manager</parameter></methodparam>
  </methodsynopsis></programlisting>

    </refsect1>

    <refsect1>
        <title>Ancestry</title>

<synopsis>+-- <link linkend="class-gobject">gobject.GObject</link>
  +-- <link linkend="class-gtkaction">gtk.Action</link>
    +-- <link linkend="class-gtkrecentaction">gtk.RecentAction</link>
</synopsis>

    </refsect1>

    <refsect1 id="properties-gtkrecentaction">
      <title>gtk.RecentAction Properties</title>

      <para><link linkend="properties-gtkaction">gtk.Action 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>"show-numbers"</entry>
                <entry>Read-Write</entry>
                <entry>Whether the items should be displayed with a number.
                Default value: <literal>False</literal></entry>
              </row>
            </tbody>
          </tgroup>
        </informaltable>
      </blockquote>

    </refsect1>

    <refsect1>
        <title>Description</title>
            <para>
                A <link linkend="class-gtkrecentaction">gtk.RecentAction</link> represents a list
                of recently used files, which can be shown by widgets such as
                <link linkend="class-gtkrecentchooserdialog">gtk.RecentChooserDialog</link> or
                <link linkend="class-gtkrecentchoosermenu">gtk.RecentChooserMenu</link>. 
            </para>
            <para>
                To construct a submenu showing recently used files, use a
                <link linkend="class-gtkrecentaction">gtk.RecentAction</link>
                as the action for a &#60;menuitem&#62;. To construct a menu toolbutton showing
                the recently used files in the popup menu, use a
                <link linkend="class-gtkrecentaction">gtk.RecentAction</link>
                as the action for a &#60;toolitem&#62; element. 
            </para>
    </refsect1>

    <refsect1>
        <title>Constructor</title>

        <refsect2 id="constructor-gtkrecentaction">
            <title>gtk.RecentAction</title>

            <programlisting><constructorsynopsis language="python">
                <methodname>gtk.RecentAction</methodname>
                <methodparam><parameter role="keyword">name</parameter></methodparam>
                <methodparam><parameter role="keyword">label</parameter></methodparam>
                <methodparam><parameter role="keyword">tooltip</parameter></methodparam>
                <methodparam><parameter role="keyword">stock_id</parameter></methodparam>
            </constructorsynopsis></programlisting>

            <variablelist>
              <varlistentry>
                    <term><parameter role="keyword">name</parameter>&nbsp;:</term>
                        <listitem><simpara>a unique name for the action </simpara></listitem>
                </varlistentry>
                <varlistentry>
                    <term><parameter role="keyword">label</parameter>&nbsp;:</term>
                        <listitem><simpara>the label displayed in menu items and on buttons, or <literal>None</literal>.</simpara></listitem>
                </varlistentry>
                <varlistentry>
                    <term><parameter role="keyword">tooltip</parameter>&nbsp;:</term>
                        <listitem><simpara>a tooltip for the action, or <literal>None</literal>.</simpara></listitem>
                </varlistentry>
                <varlistentry>
                    <term><parameter role="keyword">stock_id</parameter>&nbsp;:</term>
                        <listitem><simpara>the stock icon to display in widgets representing the action, or <literal>None</literal>.</simpara></listitem>
                </varlistentry>
                <varlistentry>
                <term><emphasis>Returns</emphasis>&nbsp;:</term>
                <listitem><simpara>a new
                    <link linkend="class-gtkrecentaction"><classname>gtk.RecentAction</classname></link>
                    </simpara></listitem>
              </varlistentry>
            </variablelist>

            <note>
              <para>This constructor is available in PyGTK 2.12 and above.</para>
            </note>
      
            <para>
                Creates a new
                <link linkend="class-gtkrecentaction"><classname>gtk.RecentAction</classname></link>
                object. To add the action to a
                <link linkend="class-gtkactiongroup"><classname>gtk.ActionGroup</classname></link>
                and set the accelerator for the action, call
                <methodname><link linkend="method-gtkactiongroup--add-action-with-accel">gtk.ActionGroup.add_action_with_accel</link></methodname>().
            </para>

        </refsect2>
    </refsect1>

    <refsect1>
        <title>Methods</title>

        <refsect2 id="method-gtkrecentaction--get-show-numbers">
            <title>gtk.RecentAction.get_show_numbers</title>

            <programlisting><methodsynopsis language="python">
                <methodname>get_show_numbers</methodname>
                <methodparam></methodparam>
            </methodsynopsis></programlisting>
            
            <variablelist>
                <varlistentry>
                    <term><emphasis>Returns</emphasis>&nbsp;:</term>
                        <listitem><simpara><literal>True</literal> if numbers should be shown.</simpara></listitem>
                </varlistentry>
            </variablelist>

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

            <para>
                The <methodname>get_show_numbers</methodname>() method returns the value set by
                <methodname><link linkend="method-gtkrecentaction--set-show-numbers">gtk.RecentAction.set_show_numbers</link></methodname>().
            </para>
        </refsect2>

        <refsect2 id="method-gtkrecentaction--set-show-numbers">
            <title>gtk.RecentAction.set_show_numbers</title>

            <programlisting><methodsynopsis language="python">
                <methodname>set_show_numbers</methodname>
                <methodparam><parameter>show_numbers</parameter></methodparam>
            </methodsynopsis></programlisting>
            
            <variablelist>
                <varlistentry>
                    <term><parameter role="keyword">show_numbers</parameter>&nbsp;:</term>
                        <listitem><simpara><literal>True</literal> if the shown items should be numbered.</simpara></listitem>
                </varlistentry>
            </variablelist>

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

            <para>
                The <methodname>set_show_numbers</methodname>() method sets whether a number
                should be added to the items shown by the widgets representing action.
                The numbers are shown to provide a unique character for a mnemonic to be
                used inside the menu item's label. Only the first ten items get a number to avoid clashes.
            </para>
        </refsect2>
    </refsect1>
    
    <refsect1>
        <title>Functions</title>

        <refsect2 id="function-gtk--recent-action-new-for-manager">
            <title>gtk.recent_action_new_for_manager</title>

            <programlisting><methodsynopsis language="python">
                <methodname>recent_action_new_for_manager</methodname>
                <methodparam><parameter>name</parameter></methodparam>
                <methodparam><parameter>label</parameter></methodparam>
                <methodparam><parameter>tooltip</parameter></methodparam>
                <methodparam><parameter>stock_id</parameter></methodparam>
                <methodparam><parameter>manager</parameter></methodparam>
            </methodsynopsis></programlisting>
            
            <variablelist>
                <varlistentry>
                    <term><parameter role="keyword">name</parameter>&nbsp;:</term>
                        <listitem><simpara>a unique name for the action </simpara></listitem>
                </varlistentry>
                <varlistentry>
                    <term><parameter role="keyword">label</parameter>&nbsp;:</term>
                        <listitem><simpara>the label displayed in menu items and on buttons, or <literal>None</literal>.</simpara></listitem>
                </varlistentry>
                <varlistentry>
                    <term><parameter role="keyword">tooltip</parameter>&nbsp;:</term>
                        <listitem><simpara>a tooltip for the action, or <literal>None</literal>.</simpara></listitem>
                </varlistentry>
                <varlistentry>
                    <term><parameter role="keyword">stock_id</parameter>&nbsp;:</term>
                        <listitem><simpara>the stock icon to display in widgets representing the action, or <literal>None</literal>.</simpara></listitem>
                </varlistentry>
                <varlistentry>
                    <term><parameter role="keyword">manager</parameter>&nbsp;:</term>
                        <listitem><simpara>a <link linkend="class-gtkrecentmanager">gtk.RecentManager</link>, or
                        <literal>None</literal> for using the default
                        <link linkend="class-gtkrecentmanager">gtk.RecentManager</link></simpara></listitem>
                </varlistentry>
            </variablelist>

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

            <para>
                The <methodname>recent_action_new_for_manager</methodname>() function creates a new
                <link linkend="class-gtkrecentaction">gtk.RecentAction</link> object. To add the action to a
                <link linkend="class-gtkactiongroup">gtk.ActionGroup</link> and set the accelerator for the action, call
                <methodname><link linkend="method-gtkactiongroup--add-action-with-accel">gtk.ActionGroup.add_action_with_accel</link></methodname>().
            </para>
        </refsect2>
    </refsect1>
</refentry>