File: class-gtkfontselectiondialog.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 (48 lines) | stat: -rw-r--r-- 13,456 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
48
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>gtk.FontSelectionDialog</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-gtkfontselection.html" title="gtk.FontSelection"><link rel="next" href="class-gtkframe.html" title="gtk.Frame"></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.FontSelectionDialog</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-gtkfontselection.html">Prev</a></td><th width="60%" align="center">The gtk Class Reference</th><td width="20%" align="right"><a accesskey="n" href="class-gtkframe.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="class-gtkfontselectiondialog"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2>gtk.FontSelectionDialog</h2><p>gtk.FontSelectionDialog &#8212; a dialog for selecting fonts.</p></div><div class="refsect1" lang="en"><a name="id3426093"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gtk.FontSelectionDialog</span></span>(<span class="ooclass"><span class="classname"><a href="class-gtkdialog.html" title="gtk.Dialog">gtk.Dialog</a></span></span>):
<code class="constructorsynopsis">    <span class="methodname"><a href="class-gtkfontselectiondialog.html#constructor-gtkfontselectiondialog" title="Constructor">gtk.FontSelectionDialog</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-gtkfontselectiondialog.html#method-gtkfontselectiondialog--get-font-name" title="gtk.FontSelectionDialog.get_font_name">get_font_name</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gtkfontselectiondialog.html#method-gtkfontselectiondialog--set-font-name" title="gtk.FontSelectionDialog.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-gtkfontselectiondialog.html#method-gtkfontselectiondialog--get-preview-text" title="gtk.FontSelectionDialog.get_preview_text">get_preview_text</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gtkfontselectiondialog.html#method-gtkfontselectiondialog--set-preview-text" title="gtk.FontSelectionDialog.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="id3426201"></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-gtkbin.html" title="gtk.Bin">gtk.Bin</a>
          +-- <a href="class-gtkwindow.html" title="gtk.Window">gtk.Window</a>
            +-- <a href="class-gtkdialog.html" title="gtk.Dialog">gtk.Dialog</a>
              +-- <a href="class-gtkfontselectiondialog.html" title="gtk.FontSelectionDialog">gtk.FontSelectionDialog</a>
</pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id3426252"></a><h2>Attributes</h2><div class="blockquote"><table width="100%" border="0" bgcolor="#E0E0E0"><tr><td valign="top"><div class="informaltable"><table cellpadding="5" width="100%" border="0"><colgroup><col><col><col></colgroup><tbody><tr valign="top"><td valign="top">"fontsel"</td><td valign="top">Read</td><td valign="top">The <a href="class-gtkfontselection.html" title="gtk.FontSelection"><tt class="classname">gtk.FontSelection</tt></a> 
widget in the dialog.</td></tr><tr valign="top"><td valign="top">"main_vbox"</td><td valign="top">Read</td><td valign="top">The <a href="class-gtkvbox.html" title="gtk.VBox"><tt class="classname">gtk.VBox</tt></a> that contains
all the dialog widgets</td></tr><tr valign="top"><td valign="top">"action_area"</td><td valign="top">Read</td><td valign="top">The <a href="class-gtkhbox.html" title="gtk.HBox"><tt class="classname">gtk.HBox</tt></a> containing
the action buttons</td></tr><tr valign="top"><td valign="top">"ok_button"</td><td valign="top">Read</td><td valign="top">The <span class="guibutton">OK</span> button</td></tr><tr valign="top"><td valign="top">"apply_button"</td><td valign="top">Read</td><td valign="top">The <span class="guibutton">Apply</span> button</td></tr><tr valign="top"><td valign="top">"cancel_button"</td><td valign="top">Read</td><td valign="top">The <span class="guibutton">Cancel</span> button</td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" lang="en"><a name="id3426417"></a><h2>Description</h2><p>The <a href="class-gtkfontselectiondialog.html" title="gtk.FontSelectionDialog"><tt class="classname">gtk.FontSelectionDialog</tt></a> 
is a dialog box containing a <a href="class-gtkfontselection.html" title="gtk.FontSelection"><tt class="classname">gtk.FontSelection</tt></a> 
widget that the user can use to select a font according to the desired
family, style and size.</p><p>The <a href="class-gtkfontselectiondialog.html#method-gtkfontselectiondialog--set-font-name" title="gtk.FontSelectionDialog.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-gtkfontselectiondialog.html#method-gtkfontselectiondialog--get-font-name" title="gtk.FontSelectionDialog.get_font_name"><tt class="methodname">get_font_name</tt>()</a> 
method. The font selection dialog 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-gtkfontselectiondialog.html#method-gtkfontselectiondialog--get-preview-text" title="gtk.FontSelectionDialog.get_preview_text"><tt class="methodname">get_preview_text</tt>()</a> 
method and set with the <a href="class-gtkfontselectiondialog.html#method-gtkfontselectiondialog--set-preview-text" title="gtk.FontSelectionDialog.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-gtkfontselectiondialog.html" title="gtk.FontSelectionDialog"><tt class="classname">gtk.FontSelectionDialog</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 class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>In GTK+ 2.2 and above the <a href="class-gtkfontselectiondialog.html" title="gtk.FontSelectionDialog"><tt class="classname">gtk.FontSelectionDialog</tt></a>
does not have filters, a <span class="guibutton">Reset Filter</span> button or a
<span class="guilabel">Filter</span> page.</p></div></div><div class="refsect1" lang="en"><a name="constructor-gtkfontselectiondialog"></a><h2>Constructor</h2><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="constructorsynopsis">    <span class="methodname">gtk.FontSelectionDialog</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 be used as the dialog
title</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a new font selection dialog</td></tr></tbody></table><p>Creates a new <a href="class-gtkfontselectiondialog.html" title="gtk.FontSelectionDialog"><tt class="classname">gtk.FontSelectionDialog</tt></a> 
with the title specified by <i class="parameter"><tt>title</tt></i>.</p></div><div class="refsect1" lang="en"><a name="id3426598"></a><h2>Methods</h2><div class="refsect2" lang="en"><a name="method-gtkfontselectiondialog--get-font-name"></a><h3>gtk.FontSelectionDialog.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>the currently selected font name or None if no
font is selected.</td></tr></tbody></table><p>The <tt class="methodname">get_font_name</tt>() method returns a
string containing the currently selected font name or None if no font name
is selected.</p></div><div class="refsect2" lang="en"><a name="method-gtkfontselectiondialog--set-font-name"></a><h3>gtk.FontSelectionDialog.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 font name to be
set</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 is found
and can be selected</td></tr></tbody></table><p>The <tt class="methodname">set_font_name</tt>() method sets the
current font using the value of <i class="parameter"><tt>fontname</tt></i>. The method
returns <tt class="literal">TRUE</tt> if the font exists and could be
selected.</p></div><div class="refsect2" lang="en"><a name="method-gtkfontselectiondialog--get-preview-text"></a><h3>gtk.FontSelectionDialog.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 text in the preview
area entry</td></tr></tbody></table><p>The <tt class="methodname">get_preview_text</tt>() method returns a
string containing the text in the preview area entry.</p></div><div class="refsect2" lang="en"><a name="method-gtkfontselectiondialog--set-preview-text"></a><h3>gtk.FontSelectionDialog.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>a string used to set the text in the preview
area entry</td></tr></tbody></table><p>The <tt class="methodname">set_preview_text</tt>() method sets the
text in the preview area entry using the string specified by
<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-gtkfontselection.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-gtkframe.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">gtk.FontSelection</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">gtk.Frame</td></tr></table></div></body></html>