source: pkg/pygtk/branches/upstream/current/docs/reference/pygtk-gtklinkbutton.xml @ 4

Revision 4, 10.6 KB checked in by alanbach-guest, 6 years ago (diff)

[svn-inject] Installing original source of pygtk

Line 
1<?xml version="1.0" standalone="no"?>
2<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
3    "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
4
5<refentry id="class-gtklinkbutton">
6
7  <refnamediv>
8    <refname>gtk.LinkButton</refname>
9      <refpurpose>a button bound to a URL (new in PyGTK 2.10)</refpurpose>
10  </refnamediv>
11
12  <refsect1>
13    <title>Synopsis</title>
14
15    <classsynopsis language="python">
16      <ooclass><classname>gtk.LinkButton</classname></ooclass>
17      <ooclass><classname><link linkend="class-gtkbutton">gtk.Button</link></classname></ooclass>
18      <constructorsynopsis language="python">
19        <methodname><link linkend="constructor-gtklinkbutton">gtk.LinkButton</link></methodname>
20        <methodparam><parameter role="keyword">uri</parameter></methodparam>
21        <methodparam><parameter role="keyword">label</parameter><initializer>None</initializer></methodparam>
22      </constructorsynopsis>
23      <methodsynopsis language="python">
24        <methodname><link linkend="method-gtklinkbutton--get-uri">get_uri</link></methodname>
25        <methodparam></methodparam>
26      </methodsynopsis>
27      <methodsynopsis language="python">
28        <methodname><link linkend="method-gtklinkbutton--set-uri">set_uri</link></methodname>
29        <methodparam><parameter role="keyword">uri</parameter></methodparam>
30      </methodsynopsis>
31    </classsynopsis>
32
33
34<programlisting>
35<emphasis role="bold">Functions</emphasis>
36
37<methodsynopsis language="python">
38  <methodname><link linkend="function-gtk--link-button-set-uri-hook">gtk.link_button_set_uri_hook</link></methodname>
39  <methodparam><parameter role="keyword">func</parameter></methodparam>
40  <methodparam><parameter role="keyword">data</parameter><initializer>None</initializer></methodparam>
41    </methodsynopsis></programlisting>
42
43  </refsect1>
44
45  <refsect1>
46    <title>Ancestry</title>
47
48<synopsis>+-- <link linkend="class-gobject">gobject.GObject</link>
49  +-- <link linkend="class-gtkobject">gtk.Object</link>
50    +-- <link linkend="class-gtkwidget">gtk.Widget</link>
51      +-- <link linkend="class-gtkcontainer">gtk.Container</link>
52        +-- <link linkend="class-gtkbin">gtk.Bin</link>
53          +-- <link linkend="class-gtkbutton">gtk.Button</link>
54            +-- <link linkend="class-gtklinkbutton">gtk.LinkButton</link>
55</synopsis>
56
57  </refsect1>
58
59  <refsect1 id="properties-gtklinkbutton">
60    <title>gtk.LinkButton Properties</title>
61
62    <para><link linkend="properties-gtkobject">gtk.Object Properties</link></para>
63    <para><link linkend="properties-gtkwidget">gtk.Widget Properties</link></para>
64    <para><link linkend="properties-gtkcontainer">gtk.Container Properties</link></para>
65    <para><link linkend="properties-gtkbutton">gtk.Button Properties</link></para>
66
67    <blockquote role="properties">
68      <informaltable pgwide="1" frame="none">
69        <tgroup cols="3">
70          <colspec column="1" colwidth="1in"/>
71          <colspec column="2" colwidth="1in"/>
72          <colspec column="3" colwidth="4in"/>
73          <tbody>
74
75            <row valign="top">
76              <entry>"uri"</entry>
77              <entry>Read-Write</entry>
78              <entry>The URI bound to this button. Available in GTK+
79              2.10.</entry>
80            </row>
81
82          </tbody>
83        </tgroup>
84      </informaltable>
85    </blockquote>
86
87  </refsect1>
88
89  <refsect1 id="style-properties-gtklinkbutton">
90    <title>gtk.LinkButton Style Properties</title>
91
92    <para><link linkend="style-properties-gtkwidget">gtk.Widget Style Properties</link></para>
93    <para><link linkend="style-properties-gtkbutton">gtk.Button Style Properties</link></para>
94
95  </refsect1>
96
97  <refsect1 id="signal-prototypes-gtklinkbutton">
98    <title>gtk.LinkButton Signal Prototypes</title>
99
100    <para><link linkend="signal-prototypes-gobject">gobject.GObject Signal Prototypes</link></para>
101    <para><link linkend="signal-prototypes-gtkobject">gtk.Object Signal Prototypes</link></para>
102    <para><link linkend="signal-prototypes-gtkwidget">gtk.Widget Signal Prototypes</link></para>
103    <para><link linkend="signal-prototypes-gtkcontainer">gtk.Container Signal Prototypes</link></para>
104    <para><link linkend="signal-prototypes-gtkbutton">gtk.Button Signal Prototypes</link></para>
105  </refsect1>
106
107  <refsect1>
108    <title>Description</title>
109
110    <note>
111      <para>The <link
112      linkend="class-gtklinkbutton"><classname>gtk.LinkButton</classname></link>
113      is available in PyGTK 2.10 and above.</para>
114    </note>
115
116    <para>A <link
117    linkend="class-gtklinkbutton"><classname>gtk.LinkButton</classname></link>
118    is a <link
119    linkend="class-gtkbutton"><classname>gtk.Button</classname></link> with
120    a hyperlink, similar to the one used by web browsers, that triggers an
121    action when clicked. It is useful to show quick links to
122    resources.</para>
123
124    <para>A link button is created by calling the <link
125    linkend="constructor-gtklinkbutton">gtk.LinkButton</link>
126    constructor. The URI you pass to the constructor is used as a label for
127    the widget.</para>
128
129    <para>The URI bound to a <link
130    linkend="class-gtklinkbutton"><classname>gtk.LinkButton</classname></link>
131    can be set specifically using the <link
132    linkend="method-gtklinkbutton--set-uri"><methodname>set_uri</methodname>()</link>)
133    method, and retrieved using the <link
134    linkend="method-gtklinkbutton--get-uri"><methodname>get_uri</methodname>()</link>
135    method.</para>
136
137    <para><link
138    linkend="class-gtklinkbutton"><classname>gtk.LinkButton</classname></link>
139    offers a global hook, which is called when the used clicks on it: see
140    the <link
141    linkend="function-gtk--link-button-set-uri-hook"><function>gtk.link_button_set_uri_hook</function>()</link>
142    function.</para>
143
144  </refsect1>
145
146  <refsect1>
147    <title>Constructor</title>
148
149    <refsect2 id="constructor-gtklinkbutton">
150      <title>gtk.LinkButton</title>
151
152      <programlisting><constructorsynopsis language="python">
153        <methodname>gtk.LinkButton</methodname>
154        <methodparam><parameter role="keyword">uri</parameter></methodparam>
155        <methodparam><parameter role="keyword">label</parameter><initializer>None</initializer></methodparam>
156      </constructorsynopsis></programlisting>
157
158      <variablelist>
159        <varlistentry>
160          <term><parameter role="keyword">uri</parameter>&nbsp;:</term>
161          <listitem><simpara>a valid URI</simpara></listitem>
162        </varlistentry>
163        <varlistentry>
164          <term><parameter role="keyword">label</parameter>&nbsp;:</term>
165          <listitem><simpara>the text of the button or
166          <literal>None</literal></simpara></listitem>
167        </varlistentry>
168        <varlistentry>
169          <term><emphasis>Returns</emphasis>&nbsp;:</term>
170          <listitem><simpara>a new link button widget.</simpara></listitem>
171        </varlistentry>
172      </variablelist>
173
174      <note>
175        <para>This constructor is available in PyGTK 2.10 and above.</para>
176      </note>
177
178      <para>Creates a new <link
179      linkend="class-gtklinkbutton"><classname>gtk.LinkButton</classname></link>
180      with the URI specified by <parameter>uri</parameter> as its text if
181      <parameter>label</parameter> is <literal>None</literal>. If
182      <parameter>label</parameter> is not <literal>None</literal>, it is
183      used as the text of the button.</para>
184
185    </refsect2>
186
187  </refsect1>
188
189  <refsect1>
190    <title>Methods</title>
191
192    <refsect2 id="method-gtklinkbutton--get-uri">
193      <title>gtk.LinkButton.get_uri</title>
194
195      <programlisting><methodsynopsis language="python">
196        <methodname>get_uri</methodname>
197        <methodparam></methodparam>
198      </methodsynopsis></programlisting>
199
200      <variablelist>
201        <varlistentry>
202          <term><emphasis>Returns</emphasis>&nbsp;:</term>
203          <listitem><simpara>the associated URI.</simpara></listitem>
204        </varlistentry>
205      </variablelist>
206
207      <note>
208        <para>This method is available in PyGTK 2.10 and above.</para>
209      </note>
210
211      <para>The <methodname>get_uri</methodname>() method returns the URI
212      set using the <link
213      linkend="method-gtklinkbutton--set-uri"><methodname>gtk.LinkButton.set_uri()</methodname></link>
214      method or the <link
215      linkend="constructor-gtklinkbutton">gtk.LinkButton</link>()
216      constructor.</para>
217
218    </refsect2>
219
220    <refsect2 id="method-gtklinkbutton--set-uri">
221      <title>gtk.LinkButton.set_uri</title>
222
223      <programlisting><methodsynopsis language="python">
224        <methodname>set_uri</methodname>
225        <methodparam><parameter role="keyword">uri</parameter></methodparam>
226      </methodsynopsis></programlisting>
227
228      <variablelist>
229        <varlistentry>
230          <term><parameter role="keyword">uri</parameter>&nbsp;:</term>
231          <listitem><simpara>a valid URI</simpara></listitem>
232        </varlistentry>
233      </variablelist>
234
235      <note>
236        <para>This method is available in PyGTK 2.10 and above.</para>
237      </note>
238
239      <para>The <methodname>set_uri</methodname>() method sets the string
240      specified by <parameter>uri</parameter> as the URI the <link
241      linkend="class-gtklinkbutton"><classname>gtk.LinkButton</classname></link>
242      points to.</para>
243
244    </refsect2>
245
246  </refsect1>
247
248  <refsect1>
249    <title>Functions</title>
250
251    <refsect2 id="function-gtk--link-button-set-uri-hook">
252      <title>gtk.link_button_set_uri_hook</title>
253
254      <programlisting><methodsynopsis language="python">
255          <methodname>gtk.link_button_set_uri_hook</methodname>
256          <methodparam><parameter
257                         role="keyword">func</parameter></methodparam>
258          <methodparam><parameter
259                         role="keyword">data</parameter><initializer>None</initializer></methodparam>
260        </methodsynopsis></programlisting>
261      <variablelist>
262        <varlistentry>
263          <term><parameter role="keyword">func</parameter>&nbsp;:</term>
264          <listitem><simpara>a function called each time a <link
265          linkend="class-gtklinkbutton"><classname>gtk.LinkButton</classname></link>
266          is clicked, or <literal>None</literal></simpara></listitem>
267        </varlistentry>
268        <varlistentry>
269          <term><parameter role="keyword">data</parameter>&nbsp;:</term>
270          <listitem><simpara>user data to be passed to
271          <parameter>func</parameter></simpara></listitem>
272        </varlistentry>
273      </variablelist>
274
275      <note>
276        <para>This function is available in PyGTK 2.10 and above.</para>
277      </note>
278
279      <para>The <function>gtk.link_button_set_uri_hook</function>() function
280      sets <parameter>func</parameter> as the function that should be
281      invoked every time a user clicks a <link
282      linkend="class-gtklinkbutton"><classname>gtk.LinkButton</classname></link>.
283      This function is called before every callback registered for the
284      "clicked" signal. If <parameter>func</parameter> is
285      <literal>None</literal> the current callback function will be
286      removed.</para>
287
288    </refsect2>
289
290  </refsect1>
291
292</refentry>
Note: See TracBrowser for help on using the repository browser.