File: class-gtkfilechooserbutton.html

package info (click to toggle)
python-gtk2-doc 2.5.2-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 8,304 kB
  • ctags: 3,741
  • sloc: makefile: 38
file content (47 lines) | stat: -rw-r--r-- 16,769 bytes parent folder | download
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
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>gtk.FileChooserButton</title><meta name="generator" content="DocBook XSL Stylesheets V1.65.1"><link rel="home" href="index.html" title="PyGTK 2.0 Reference Manual"><link rel="up" href="gtk-class-reference.html" title="The gtk Class Reference"><link rel="previous" href="class-gtkfilechooser.html" title="gtk.FileChooser"><link rel="next" href="class-gtkfilechooserdialog.html" title="gtk.FileChooserDialog"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">gtk.FileChooserButton</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-gtkfilechooser.html">Prev</a></td><th width="60%" align="center">The gtk Class Reference</th><td width="20%" align="right"><a accesskey="n" href="class-gtkfilechooserdialog.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="class-gtkfilechooserbutton"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2>gtk.FileChooserButton</h2><p>gtk.FileChooserButton &#8212; a button to launch a <a href="class-gtkfilechooserdialog.html" title="gtk.FileChooserDialog"><tt class="classname">gtk.FileChooserDialog</tt></a>
(new in PyGTK 2.6)</p></div><div class="refsect1" lang="en"><a name="id3418962"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gtk.FileChooserButton</span></span>(<span class="ooclass"><span class="classname"><a href="class-gtkhbox.html" title="gtk.HBox">gtk.HBox</a></span></span>):
<code class="constructorsynopsis">    <span class="methodname"><a href="class-gtkfilechooserbutton.html#constructor-gtkfilechooserbutton" title="gtk.FileChooserButton">gtk.FileChooserButton</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>title</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>backend</tt></b></span><span class="initializer">=None</span></span>)</code><br><code class="constructorsynopsis">    <span class="methodname"><a href="class-gtkfilechooserbutton.html#constructor-gtkfilechooserbutton2" title="gtk.FileChooserButton">gtk.FileChooserButton</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>dialog</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gtkfilechooserbutton.html#method-gtkfilechooserbutton--get-title" title="gtk.FileChooserButton.get_title">get_title</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt></tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gtkfilechooserbutton.html#method-gtkfilechooserbutton--set-title" title="gtk.FileChooserButton.set_title">set_title</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>title</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gtkfilechooserbutton.html#method-gtkfilechooserbutton--get-width-chars" title="gtk.FileChooserButton.get_width_chars">get_width_chars</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt></tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gtkfilechooserbutton.html#method-gtkfilechooserbutton--set-width-chars" title="gtk.FileChooserButton.set_width_chars">set_width_chars</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>n_chars</tt></b></span></span>)</code><br></pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id3419110"></a><h2>Ancestry</h2><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="synopsis">+-- <a href="class-gobject.html" title="gobject.GObject">gobject.GObject</a>
  +-- <a href="class-gtkobject.html" title="gtk.Object">gtk.Object</a>
    +-- <a href="class-gtkwidget.html" title="gtk.Widget">gtk.Widget</a>
      +-- <a href="class-gtkcontainer.html" title="gtk.Container">gtk.Container</a>
        +-- <a href="class-gtkbox.html" title="gtk.Box">gtk.Box</a>
           +-- <a href="class-gtkhbox.html" title="gtk.HBox">gtk.HBox</a>
             +-- <a href="class-gtkfilechooserbutton.html" title="gtk.FileChooserButton">gtk.FileChooserButton</a></pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id3419155"></a><h2>Properties</h2><div class="blockquote"><table width="100%" border="0" bgcolor="#E0E0E0"><tr><td valign="top"><div class="informaltable"><table width="100%" border="0"><colgroup><col><col><col></colgroup><tbody><tr valign="top"><td valign="top">"dialog"</td><td valign="top">Write-Construct Only</td><td valign="top">The <a href="class-gtkfilechooserdialog.html" title="gtk.FileChooserDialog"><tt class="classname">gtk.FileChooserDialog</tt></a>
associated with the button.</td></tr><tr valign="top"><td valign="top">"title"</td><td valign="top">Read-Write</td><td valign="top">The string to use as the title on the <a href="class-gtkfilechooserdialog.html" title="gtk.FileChooserDialog"><tt class="classname">gtk.FileChooserDialog</tt></a>
associated with the button.</td></tr><tr valign="top"><td valign="top">"width-chars"</td><td valign="top">Read-Write</td><td valign="top">The width of the entry and label inside the button, in
characters. Allowed values: &gt;= -1. Default value: -1</td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" lang="en"><a name="id3419269"></a><h2>Description</h2><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This widget is available in PyGTK 2.6 and above.</p></div><p>The <a href="class-gtkfilechooserbutton.html" title="gtk.FileChooserButton"><tt class="classname">gtk.FileChooserButton</tt></a>
is a widget that lets the user select a file. It implements the <a href="class-gtkfilechooser.html" title="gtk.FileChooser"><tt class="classname">gtk.FileChooser</tt></a>
interface. Visually, it is a file name with a button to bring up a <a href="class-gtkfilechooserdialog.html" title="gtk.FileChooserDialog"><tt class="classname">gtk.FileChooserDialog</tt></a>. The
user can then use that dialog to change the file associated with that
button. This widget does not support setting the "select-multiple" property
to <tt class="literal">TRUE</tt>. For example to create a <a href="class-gtkfilechooserbutton.html" title="gtk.FileChooserButton"><tt class="classname">gtk.FileChooserButton</tt></a>
and set the current folder to '/etc' use:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">
  filechooserbutton = gtk.FileChooserButton('Select a File')
  filechooserbutton.set_current_folder('/etc')
</pre></td></tr></table><p>The <a href="class-gtkfilechooserbutton.html" title="gtk.FileChooserButton"><tt class="classname">gtk.FileChooserButton</tt></a>
supports the <tt class="literal">gtk.FILE_CHOOSER_ACTION_OPEN</tt> and
<tt class="literal">gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER</tt> actions of the
<a href="gtk-constants.html#gtk-filechooser-action-constants">GTK FileChooser Action Constants</a>.</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>The <a href="class-gtkfilechooserbutton.html" title="gtk.FileChooserButton"><tt class="classname">gtk.FileChooserButton</tt></a>
will ellipsize the label, and thus will thus request little horizontal
space. To give the button more space, you should call the <a href="class-gtkwidget.html#method-gtkwidget--size-request" title="gtk.Widget.size_request"><tt class="methodname">gtk.Widget.size_request</tt>()</a>
method, the <a href="class-gtkfilechooserbutton.html#method-gtkfilechooserbutton--set-width-chars" title="gtk.FileChooserButton.set_width_chars"><tt class="methodname">set_width_chars</tt>()</a>
method, or pack the button in such a way that other interface elements give
space to the widget.</p></div></div><div class="refsect1" lang="en"><a name="id3419378"></a><h2>Constructor</h2><div class="refsect2" lang="en"><a name="constructor-gtkfilechooserbutton"></a><h3>gtk.FileChooserButton</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="constructorsynopsis">    <span class="methodname">gtk.FileChooserButton</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>title</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>backend</tt></b></span><span class="initializer">=None</span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>title</tt></b>:</span></td><td>the title of the browse dialog</td></tr><tr><td><span class="term"><b class="parameter"><tt>backend</tt></b>:</span></td><td>the name of a file system backend or
<tt class="literal">None</tt></td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a new <a href="class-gtkfilechooserbutton.html" title="gtk.FileChooserButton"><tt class="classname">gtk.FileChooserButton</tt></a></td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This constructor is available in PyGTK 2.6 and above.</p></div><p>Creates a new button widget that opens a <a href="class-gtkfilechooserdialog.html" title="gtk.FileChooserDialog"><tt class="classname">gtk.FileChooserDialog</tt></a>
when clicked. The title of the <a href="class-gtkfilechooserdialog.html" title="gtk.FileChooserDialog"><tt class="classname">gtk.FileChooserDialog</tt></a>
is specified by <i class="parameter"><tt>title</tt></i>. If
<i class="parameter"><tt>backend</tt></i> is specified it is the name of a file system
backend.</p></div><div class="refsect2" lang="en"><a name="constructor-gtkfilechooserbutton2"></a><h3>gtk.FileChooserButton</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="constructorsynopsis">    <span class="methodname">gtk.FileChooserButton</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>dialog</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>dialog</tt></b>:</span></td><td>a <a href="class-gtkfilechooserdialog.html" title="gtk.FileChooserDialog"><tt class="classname">gtk.FileChooserDialog</tt></a></td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a new <a href="class-gtkfilechooserbutton.html" title="gtk.FileChooserButton"><tt class="classname">gtk.FileChooserButton</tt></a></td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This constructor is available in PyGTK 2.6 and above.</p></div><p>Creates a new button widget that opens a <a href="class-gtkfilechooserdialog.html" title="gtk.FileChooserDialog"><tt class="classname">gtk.FileChooserDialog</tt></a>
specified by <i class="parameter"><tt>dialog</tt></i> when clicked.</p></div></div><div class="refsect1" lang="en"><a name="id3419586"></a><h2>Methods</h2><div class="refsect2" lang="en"><a name="method-gtkfilechooserbutton--get-title"></a><h3>gtk.FileChooserButton.get_title</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_title</span>()</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the title of the <a href="class-gtkfilechooserdialog.html" title="gtk.FileChooserDialog"><tt class="classname">gtk.FileChooserDialog</tt></a></td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.6 and above.</p></div><p>The <tt class="methodname">get_title</tt>() method returns the
value of the "title" property which contains the title of the associated
<a href="class-gtkfilechooserdialog.html" title="gtk.FileChooserDialog"><tt class="classname">gtk.FileChooserDialog</tt></a>.</p></div><div class="refsect2" lang="en"><a name="method-gtkfilechooserbutton--set-title"></a><h3>gtk.FileChooserButton.set_title</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_title</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>title</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>title</tt></b>:</span></td><td>a string to use as the title of the associated 
<a href="class-gtkfilechooserdialog.html" title="gtk.FileChooserDialog"><tt class="classname">gtk.FileChooserDialog</tt></a>.</td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.6 and above.</p></div><p>The <tt class="methodname">set_title</tt>() method sets the "title"
property to the value of <i class="parameter"><tt>title</tt></i>. The "title" property
contains the title string of the associated <a href="class-gtkfilechooserdialog.html" title="gtk.FileChooserDialog"><tt class="classname">gtk.FileChooserDialog</tt></a>.</p></div><div class="refsect2" lang="en"><a name="method-gtkfilechooserbutton--get-width-chars"></a><h3>gtk.FileChooserButton.get_width_chars</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_width_chars</span>()</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:, </span><span class="term"><b class="parameter"><tt></tt></b>:, </span></td><td>the width in characters of the
button</td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.6 and above.</p></div><p>The <tt class="methodname">get_width_chars</tt>() method returns
the value of the "width-characters" property which contains the number of
characters the button width should be set to.</p></div><div class="refsect2" lang="en"><a name="method-gtkfilechooserbutton--set-width-chars"></a><h3>gtk.FileChooserButton.set_width_chars</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_width_chars</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>n_chars</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>n_chars</tt></b>:</span></td><td>the width in characters for the
button</td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.6 and above.</p></div><p>The <tt class="methodname">set_width_chars</tt>() method sets the
"width-chars" property to the value of <i class="parameter"><tt>n_chars</tt></i>. The
"width-chars" property contains the width in characters that the button
should be set to.</p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="class-gtkfilechooser.html">Prev</a></td><td width="20%" align="center"><a accesskey="u" href="gtk-class-reference.html">Up</a></td><td width="40%" align="right"><a accesskey="n" href="class-gtkfilechooserdialog.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">gtk.FileChooser</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">gtk.FileChooserDialog</td></tr></table></div></body></html>