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=utf-8"><title>gtk.FontSelection</title><link rel="stylesheet" href="style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.73.2"><link rel="start" href="index.html" title="PyGTK 2.0 Reference Manual"><link rel="up" href="gtk-class-reference.html" title="The gtk Class Reference"><link rel="prev" 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 class="refnamediv"><h2>gtk.FontSelection</h2><p>gtk.FontSelection — a widget for selecting fonts.</p></div><div class="refsect1" lang="en"><a name="id3321613"></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 class="link" href="class-gtkvbox.html" title="gtk.VBox">gtk.VBox</a></span></span>):
<code class="constructorsynopsis"> <span class="methodname"><a class="link" 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 class="link" 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 class="link" 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"><strong class="parameter"><code>fontname</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" 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 class="link" 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"><strong class="parameter"><code>text</code></strong></span></span>)</code><br></pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id3321759"></a><h2>Ancestry</h2><pre class="synopsis">+-- <PYGTKDOCLINK HREF="class-gobject">gobject.GObject</PYGTKDOCLINK>
+-- <a class="link" href="class-gtkobject.html" title="gtk.Object">gtk.Object</a>
+-- <a class="link" href="class-gtkwidget.html" title="gtk.Widget">gtk.Widget</a>
+-- <a class="link" href="class-gtkcontainer.html" title="gtk.Container">gtk.Container</a>
+-- <a class="link" href="class-gtkbox.html" title="gtk.Box">gtk.Box</a>
+-- <a class="link" href="class-gtkvbox.html" title="gtk.VBox">gtk.VBox</a>
+-- <a class="link" href="class-gtkfontselection.html" title="gtk.FontSelection">gtk.FontSelection</a>
</pre></div><div class="refsect1" lang="en"><a name="id3321816"></a><h2>Implemented Interfaces</h2><p>
<a class="link" href="class-gtkfontselection.html" title="gtk.FontSelection"><code class="classname">gtk.FontSelection</code></a>
implements
<a class="link" href="class-gtkbuildable.html" title="gtk.Buildable"><code class="classname">gtk.Buildable</code></a>
</p></div><div class="refsect1" lang="en"><a name="properties-gtkfontselection"></a><h2>gtk.FontSelection Properties</h2><p><a class="link" href="class-gtkobject.html#properties-gtkobject" title="gtk.Object Properties">gtk.Object Properties</a></p><p><a class="link" href="class-gtkwidget.html#properties-gtkwidget" title="gtk.Widget Properties">gtk.Widget Properties</a></p><p><a class="link" href="class-gtkcontainer.html#properties-gtkcontainer" title="gtk.Container Properties">gtk.Container Properties</a></p><p><a class="link" href="class-gtkbox.html#properties-gtkbox" title="gtk.Box Properties">gtk.Box Properties</a></p><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"</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">"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">"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="style-properties-gtkfontselection"></a><h2>gtk.FontSelection Style Properties</h2><p><a class="link" href="class-gtkwidget.html#style-properties-gtkwidget" title="gtk.Widget Style Properties">gtk.Widget Style Properties</a></p></div><div class="refsect1" lang="en"><a name="child-properties-gtkfontselection"></a><h2>gtk.FontSelection Child Properties</h2><p><a class="link" href="class-gtkbox.html#child-properties-gtkbox" title="gtk.Box Child Properties">gtk.Box Child Properties</a></p></div><div class="refsect1" lang="en"><a name="signal-prototypes-gtkfontselection"></a><h2>gtk.FontSelection Signal Prototypes</h2><p><PYGTKDOCLINK HREF="signal-prototypes-gobject">gobject.GObject Signal Prototypes</PYGTKDOCLINK></p><p><a class="link" href="class-gtkobject.html#signal-prototypes-gtkobject" title="gtk.Object Signal Prototypes">gtk.Object Signal Prototypes</a></p><p><a class="link" href="class-gtkwidget.html#signal-prototypes-gtkwidget" title="gtk.Widget Signal Prototypes">gtk.Widget Signal Prototypes</a></p><p><a class="link" href="class-gtkcontainer.html#signal-prototypes-gtkcontainer" title="gtk.Container Signal Prototypes">gtk.Container Signal Prototypes</a></p></div><div class="refsect1" lang="en"><a name="id3322068"></a><h2>Description</h2><p>The <a class="link" href="class-gtkfontselection.html" title="gtk.FontSelection"><code class="classname">gtk.FontSelection</code></a>
widget lists the available fonts, styles and sizes, allowing the user to
select a font. It is used in the <a class="link" href="class-gtkfontselectiondialog.html" title="gtk.FontSelectionDialog"><code class="classname">gtk.FontSelectionDialog</code></a>
widget to provide a dialog box for selecting fonts. The <a class="link" href="class-gtkfontselection.html#method-gtkfontselection--set-font-name" title="gtk.FontSelection.set_font_name"><code class="methodname">set_font_name</code>()</a>
method sets the initial font selection. The current font selection is
retrieved using the <a class="link" href="class-gtkfontselection.html#method-gtkfontselection--get-font-name" title="gtk.FontSelection.get_font_name"><code class="methodname">get_font_name</code>()</a>
method.</p><p>The fontselection has a preview area that contains a <a class="link" href="class-gtkentry.html" title="gtk.Entry"><code class="classname">gtk.Entry</code></a> that
displays text using the currently selected font. The preview text can be
retrieved with the <a class="link" href="class-gtkfontselection.html#method-gtkfontselection--get-preview-text" title="gtk.FontSelection.get_preview_text"><code class="methodname">get_preview_text</code>()</a>
method and set with the <a class="link" href="class-gtkfontselection.html#method-gtkfontselection--set-preview-text" title="gtk.FontSelection.set_preview_text"><code class="methodname">set_preview_text</code>()</a>
method.</p><p>Filters can be used to limit the font selections. There are 2
filters in the <a class="link" href="class-gtkfontselection.html" title="gtk.FontSelection"><code class="classname">gtk.FontSelection</code></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><pre class="programlisting"><code class="constructorsynopsis"> <span class="methodname">gtk.FontSelection</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a new fontselection widget</td></tr></tbody></table><p>Creates a new <a class="link" href="class-gtkfontselection.html" title="gtk.FontSelection"><code class="classname">gtk.FontSelection</code></a>
widget.</p></div><div class="refsect1" lang="en"><a name="id3322242"></a><h2>Methods</h2><div class="refsect2" lang="en"><a name="method-gtkfontselection--get-font-name"></a><h3>gtk.FontSelection.get_font_name</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_font_name</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a string containing the selected font
name</td></tr></tbody></table><p>The <code class="methodname">get_font_name</code>() 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><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_font_name</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>fontname</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>fontname</code></strong> :</span></p></td><td>a string containing the name of a
font</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td><code class="literal">True</code> if the font could be
set</td></tr></tbody></table><p>The <code class="methodname">set_font_name</code>() method sets the
currently selected font in the fontselection using the value of
<em class="parameter"><code>fontname</code></em>. The method returns <code class="literal">True</code>
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><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_preview_text</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a string containing the preview
text</td></tr></tbody></table><p>The <code class="methodname">get_preview_text</code>() 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><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_preview_text</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>text</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>text</code></strong> :</span></p></td><td>the new preview text
string</td></tr></tbody></table><p>The <code class="methodname">set_preview_text</code>() method sets the
text to be displayed in the preview area entry using the string in
<em class="parameter"><code>text</code></em>.</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>
|