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
|
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>gtk.FontSelection</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-gtkfontbutton.html" title="gtk.FontButton"><link rel="next" href="class-gtkfontselectiondialog.html" title="gtk.FontSelectionDialog"></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.FontSelection</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-gtkfontbutton.html">Prev</a></td><th width="60%" align="center">The gtk Class Reference</th><td width="20%" align="right"><a accesskey="n" href="class-gtkfontselectiondialog.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="class-gtkfontselection"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2>gtk.FontSelection</h2><p>gtk.FontSelection — a widget for selecting fonts.</p></div><div class="refsect1" lang="en"><a name="id3425480"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gtk.FontSelection</span></span>(<span class="ooclass"><span class="classname"><a href="class-gtkvbox.html" title="gtk.VBox">gtk.VBox</a></span></span>):
<code class="constructorsynopsis"> <span class="methodname"><a href="class-gtkfontselection.html#constructor-gtkfontselection" title="Constructor">gtk.FontSelection</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkfontselection.html#method-gtkfontselection--get-font-name" title="gtk.FontSelection.get_font_name">get_font_name</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkfontselection.html#method-gtkfontselection--set-font-name" title="gtk.FontSelection.set_font_name">set_font_name</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>fontname</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkfontselection.html#method-gtkfontselection--get-preview-text" title="gtk.FontSelection.get_preview_text">get_preview_text</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkfontselection.html#method-gtkfontselection--set-preview-text" title="gtk.FontSelection.set_preview_text">set_preview_text</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>text</tt></b></span></span>)</code><br></pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id3425579"></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-gtkvbox.html" title="gtk.VBox">gtk.VBox</a>
+-- <a href="class-gtkfontselection.html" title="gtk.FontSelection">gtk.FontSelection</a>
</pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id3425625"></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">"font-name"</td><td valign="top">Read/Write</td><td valign="top">The string that names the font</td></tr><tr valign="top"><td valign="top">"font"</td><td valign="top">Read</td><td valign="top">The gtk.gdk.Font that is
currently selected. This property is deprecated.</td></tr><tr valign="top"><td valign="top">"preview-text"</td><td valign="top">Read/Write</td><td valign="top">The text to display in order to demonstrate the selected
font.
</td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" lang="en"><a name="id3425718"></a><h2>Description</h2><p>The <a href="class-gtkfontselection.html" title="gtk.FontSelection"><tt class="classname">gtk.FontSelection</tt></a>
widget lists the available fonts, styles and sizes, allowing the user to
select a font. It is used in the <a href="class-gtkfontselectiondialog.html" title="gtk.FontSelectionDialog"><tt class="classname">gtk.FontSelectionDialog</tt></a>
widget to provide a dialog box for selecting fonts. The <a href="class-gtkfontselection.html#method-gtkfontselection--set-font-name" title="gtk.FontSelection.set_font_name"><tt class="methodname">set_font_name</tt>()</a>
method sets the initial font selection. The current font selection is
retrieved using the <a href="class-gtkfontselection.html#method-gtkfontselection--get-font-name" title="gtk.FontSelection.get_font_name"><tt class="methodname">get_font_name</tt>()</a>
method.</p><p>The fontselection has a preview area that contains a <a href="class-gtkentry.html" title="gtk.Entry"><tt class="classname">gtk.Entry</tt></a> that
displays text using the currently selected font. The preview text can be
retrieved with the <a href="class-gtkfontselection.html#method-gtkfontselection--get-preview-text" title="gtk.FontSelection.get_preview_text"><tt class="methodname">get_preview_text</tt>()</a>
method and set with the <a href="class-gtkfontselection.html#method-gtkfontselection--set-preview-text" title="gtk.FontSelection.set_preview_text"><tt class="methodname">set_preview_text</tt>()</a>
method.</p><p>Filters can be used to limit the font selections. There are 2
filters in the <a href="class-gtkfontselection.html" title="gtk.FontSelection"><tt class="classname">gtk.FontSelection</tt></a>
- a base filter and a user filter. The base filter cannot be changed by the
user, so this can be used when the user must choose from the restricted set
of fonts (e.g. for a terminal-type application you may want to force the
user to select a fixed-width font). The user filter can be changed or reset
by the user, by using the <span class="guibutton">Reset Filter</span> button or
changing the options on the <span class="guilabel">Filter</span> page of the
widget.</p></div><div class="refsect1" lang="en"><a name="constructor-gtkfontselection"></a><h2>Constructor</h2><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="constructorsynopsis"> <span class="methodname">gtk.FontSelection</span>(<span class="methodparam"></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>a new fontselection widget</td></tr></tbody></table><p>Creates a new <a href="class-gtkfontselection.html" title="gtk.FontSelection"><tt class="classname">gtk.FontSelection</tt></a>
widget.</p></div><div class="refsect1" lang="en"><a name="id3425855"></a><h2>Methods</h2><div class="refsect2" lang="en"><a name="method-gtkfontselection--get-font-name"></a><h3>gtk.FontSelection.get_font_name</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_font_name</span>(<span class="methodparam"></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>a string containing the selected font
name</td></tr></tbody></table><p>The <tt class="methodname">get_font_name</tt>() method returns the
name of the currently selected font.</p></div><div class="refsect2" lang="en"><a name="method-gtkfontselection--set-font-name"></a><h3>gtk.FontSelection.set_font_name</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_font_name</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>fontname</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>fontname</tt></b>:</span></td><td>a string containing the name of a
font</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td><tt class="literal">TRUE</tt> if the font could be
set</td></tr></tbody></table><p>The <tt class="methodname">set_font_name</tt>() method sets the
currently selected font in the fontselection using the value of
<i class="parameter"><tt>fontname</tt></i>. The method returns <tt class="literal">TRUE</tt>
if the font is found and can be selected in the fontselection.</p></div><div class="refsect2" lang="en"><a name="method-gtkfontselection--get-preview-text"></a><h3>gtk.FontSelection.get_preview_text</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_preview_text</span>(<span class="methodparam"></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>a string containing the preview
text</td></tr></tbody></table><p>The <tt class="methodname">get_preview_text</tt>() method returns a
string that contains the text displayed in the preview area entry.</p></div><div class="refsect2" lang="en"><a name="method-gtkfontselection--set-preview-text"></a><h3>gtk.FontSelection.set_preview_text</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_preview_text</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>text</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>text</tt></b>:</span></td><td>the new preview text
string</td></tr></tbody></table><p>The <tt class="methodname">set_preview_text</tt>() method sets the
text to be displayed in the preview area entry using the string in
<i class="parameter"><tt>text</tt></i>.</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-gtkfontbutton.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-gtkfontselectiondialog.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">gtk.FontButton</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">gtk.FontSelectionDialog</td></tr></table></div></body></html>
|