|
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17 System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64 User : nobody ( 99) PHP Version : 5.2.17 Disable Function : NONE Directory : /usr/share/gtk-doc/html/gtk/ |
Upload File : |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>GtkFontSelection</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
<link rel="start" href="index.html" title="GTK+ Reference Manual">
<link rel="up" href="SelectorWidgets.html" title="Selectors (File/Font/Color/Input Devices)">
<link rel="prev" href="GtkFontButton.html" title="GtkFontButton">
<link rel="next" href="GtkFontSelectionDialog.html" title="GtkFontSelectionDialog">
<meta name="generator" content="GTK-Doc V1.6 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="part" href="gtk.html" title="Part I. GTK+ Overview">
<link rel="part" href="gtkbase.html" title="Part II. GTK+ Core Reference">
<link rel="part" href="gtkobjects.html" title="Part III. GTK+ Widgets and Objects">
<link rel="chapter" href="ch01.html" title="Object Hierarchy">
<link rel="chapter" href="ch02.html" title="Widget Gallery">
<link rel="chapter" href="WindowWidgets.html" title="Windows">
<link rel="chapter" href="DisplayWidgets.html" title="Display Widgets">
<link rel="chapter" href="ButtonWidgets.html" title="Buttons and Toggles">
<link rel="chapter" href="NumericEntry.html" title="Numeric/Text Data Entry">
<link rel="chapter" href="TextWidgetObjects.html" title="Multiline Text Editor">
<link rel="chapter" href="TreeWidgetObjects.html" title="Tree, List and Icon Grid Widgets">
<link rel="chapter" href="MenusAndCombos.html" title="Menus, Combo Box, Toolbar">
<link rel="chapter" href="Actions.html" title="Action-based menus and toolbars">
<link rel="chapter" href="SelectorWidgets.html" title="Selectors (File/Font/Color/Input Devices)">
<link rel="chapter" href="LayoutContainers.html" title="Layout Containers">
<link rel="chapter" href="Ornaments.html" title="Ornaments">
<link rel="chapter" href="ScrollingWidgets.html" title="Scrolling">
<link rel="chapter" href="Printing.html" title="Printing">
<link rel="chapter" href="MiscObjects.html" title="Miscellaneous">
<link rel="chapter" href="AbstractObjects.html" title="Abstract Base Classes">
<link rel="chapter" href="PlugSocket.html" title="Cross-process Embedding">
<link rel="chapter" href="SpecialObjects.html" title="Special-purpose features">
<link rel="chapter" href="RecentDocuments.html" title="Recently Used Documents">
<link rel="chapter" href="DeprecatedObjects.html" title="Deprecated">
<link rel="part" href="migrating.html" title="Part IV. Migrating from Previous Versions of GTK+">
<link rel="chapter" href="gtk-migrating-checklist.html" title="Migration Checklist">
<link rel="chapter" href="gtk-migrating-GtkFileChooser.html" title="Migrating from GtkFileSelection to GtkFileChooser">
<link rel="chapter" href="gtk-migrating-GtkAction.html" title="Migrating from old menu and toolbar systems to GtkAction">
<link rel="chapter" href="gtk-migrating-GtkComboBox.html" title="Migrating from GtkOptionMenu and GtkCombo to GtkComboBox and
GtkComboBoxEntry">
<link rel="chapter" href="gtk-migrating-GtkIconView.html" title="Migrating from GnomeIconList to GtkIconView">
<link rel="chapter" href="gtk-migrating-GtkAboutDialog.html" title="Migrating from GnomeAbout to GtkAboutDialog">
<link rel="chapter" href="gtk-migrating-GtkColorButton.html" title="Migrating from GnomeColorPicker to GtkColorButton">
<link rel="chapter" href="gtk-migrating-GtkAssistant.html" title="Migrating from GnomeDruid to GtkAssistant">
<link rel="chapter" href="gtk-migrating-GtkRecentChooser.html" title="Migrating from EggRecent to GtkRecentChooser">
<link rel="chapter" href="gtk-migrating-GtkLinkButton.html" title="Migrating from GnomeHRef to GtkLinkButton">
<link rel="part" href="pt05.html" title="Part V. GTK+ Tools">
<link rel="glossary" href="glossary.html" title="Glossary">
<link rel="index" href="ix01.html" title="Index">
<link rel="index" href="ix02.html" title="Index of deprecated symbols">
<link rel="index" href="ix03.html" title="Index of new symbols in 2.2">
<link rel="index" href="ix04.html" title="Index of new symbols in 2.4">
<link rel="index" href="ix05.html" title="Index of new symbols in 2.6">
<link rel="index" href="ix06.html" title="Index of new symbols in 2.8">
<link rel="index" href="ix07.html" title="Index of new symbols in 2.10">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="GtkFontButton.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="SelectorWidgets.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GTK+ Reference Manual</th>
<td><a accesskey="n" href="GtkFontSelectionDialog.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id3442950" class="shortcut">Top</a>
 | 
<a href="#id3443283" class="shortcut">Description</a>
 | 
<a href="#id3443123" class="shortcut">Object Hierarchy</a>
 | 
<a href="#id3443192" class="shortcut">Implemented Interfaces</a>
 | 
<a href="#id3443215" class="shortcut">Properties</a></nobr></td></tr>
</table>
<div class="refentry" lang="en">
<a name="GtkFontSelection"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2>
<a name="id3442950"></a><span class="refentrytitle">GtkFontSelection</span>
</h2>
<p>GtkFontSelection — A widget for selecting fonts</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
<pre class="synopsis">
#include <gtk/gtk.h>
<a href="GtkFontSelection.html#GtkFontSelection-struct">GtkFontSelection</a>;
<a href="GtkWidget.html" title="GtkWidget">GtkWidget</a>* <a href="GtkFontSelection.html#gtk-font-selection-new">gtk_font_selection_new</a> (void);
<a
href="../gdk/gdk-Fonts.html#GdkFont"
>GdkFont</a>* <a href="GtkFontSelection.html#gtk-font-selection-get-font">gtk_font_selection_get_font</a> (<a href="GtkFontSelection.html" title="GtkFontSelection">GtkFontSelection</a> *fontsel);
<a
href="../glib/glib-Basic-Types.html#gchar"
>gchar</a>* <a href="GtkFontSelection.html#gtk-font-selection-get-font-name">gtk_font_selection_get_font_name</a>
(<a href="GtkFontSelection.html" title="GtkFontSelection">GtkFontSelection</a> *fontsel);
<a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> <a href="GtkFontSelection.html#gtk-font-selection-set-font-name">gtk_font_selection_set_font_name</a>
(<a href="GtkFontSelection.html" title="GtkFontSelection">GtkFontSelection</a> *fontsel,
const <a
href="../glib/glib-Basic-Types.html#gchar"
>gchar</a> *fontname);
const <a
href="../glib/glib-Basic-Types.html#gchar"
>gchar</a>* <a href="GtkFontSelection.html#gtk-font-selection-get-preview-text">gtk_font_selection_get_preview_text</a>
(<a href="GtkFontSelection.html" title="GtkFontSelection">GtkFontSelection</a> *fontsel);
void <a href="GtkFontSelection.html#gtk-font-selection-set-preview-text">gtk_font_selection_set_preview_text</a>
(<a href="GtkFontSelection.html" title="GtkFontSelection">GtkFontSelection</a> *fontsel,
const <a
href="../glib/glib-Basic-Types.html#gchar"
>gchar</a> *text);
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id3443123"></a><h2>Object Hierarchy</h2>
<pre class="synopsis">
<a
href="../gobject/gobject-The-Base-Object-Type.html#GObject"
>GObject</a>
+----<a
href="../gobject/gobject-The-Base-Object-Type.html#GInitiallyUnowned"
>GInitiallyUnowned</a>
+----<a href="GtkObject.html" title="GtkObject">GtkObject</a>
+----<a href="GtkWidget.html" title="GtkWidget">GtkWidget</a>
+----<a href="GtkContainer.html" title="GtkContainer">GtkContainer</a>
+----<a href="GtkBox.html" title="GtkBox">GtkBox</a>
+----<a href="GtkVBox.html" title="GtkVBox">GtkVBox</a>
+----GtkFontSelection
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id3443192"></a><h2>Implemented Interfaces</h2>
<p>
GtkFontSelection implements
AtkImplementorIface.</p>
</div>
<div class="refsect1" lang="en">
<a name="id3443215"></a><h2>Properties</h2>
<pre class="synopsis">
"<a href="GtkFontSelection.html#GtkFontSelection--font">font</a>" <a
href="../gdk/gdk-Fonts.html#GdkFont"
>GdkFont</a> : Read
"<a href="GtkFontSelection.html#GtkFontSelection--font-name">font-name</a>" <a
href="../gobject/gobject-Standard-Parameter-and-Value-Types.html#gchararray"
>gchararray</a> : Read / Write
"<a href="GtkFontSelection.html#GtkFontSelection--preview-text">preview-text</a>" <a
href="../gobject/gobject-Standard-Parameter-and-Value-Types.html#gchararray"
>gchararray</a> : Read / Write
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id3443283"></a><h2>Description</h2>
<p>
The <a href="GtkFontSelection.html" title="GtkFontSelection"><span class="type">GtkFontSelection</span></a> widget lists the available fonts, styles and sizes,
allowing the user to select a font.
It is used in the <a href="GtkFontSelectionDialog.html" title="GtkFontSelectionDialog"><span class="type">GtkFontSelectionDialog</span></a> widget to provide a dialog box for
selecting fonts.
</p>
<p>
To set the font which is initially selected, use
<a href="GtkFontSelection.html#gtk-font-selection-set-font-name"><code class="function">gtk_font_selection_set_font_name()</code></a>.
</p>
<p>
To get the selected font use <a href="GtkFontSelection.html#gtk-font-selection-get-font-name"><code class="function">gtk_font_selection_get_font_name()</code></a>.
</p>
<p>
To change the text which is shown in the preview area, use
<a href="GtkFontSelection.html#gtk-font-selection-set-preview-text"><code class="function">gtk_font_selection_set_preview_text()</code></a>.
</p>
</div>
<div class="refsect1" lang="en">
<a name="id3443364"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="id3443374"></a><h3>
<a name="GtkFontSelection-struct"></a>GtkFontSelection</h3>
<a class="indexterm" name="id3443388"></a><pre class="programlisting">typedef struct _GtkFontSelection GtkFontSelection;</pre>
<p>
The <a href="GtkFontSelection.html" title="GtkFontSelection"><span class="type">GtkFontSelection</span></a> struct contains private data only, and should
only be accessed using the functions below.
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3443413"></a><h3>
<a name="gtk-font-selection-new"></a>gtk_font_selection_new ()</h3>
<a class="indexterm" name="id3443426"></a><pre class="programlisting"><a href="GtkWidget.html" title="GtkWidget">GtkWidget</a>* gtk_font_selection_new (void);</pre>
<p>
Creates a new <a href="GtkFontSelection.html" title="GtkFontSelection"><span class="type">GtkFontSelection</span></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td>a new <a href="GtkFontSelection.html" title="GtkFontSelection"><span class="type">GtkFontSelection</span></a>.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3443479"></a><h3>
<a name="gtk-font-selection-get-font"></a>gtk_font_selection_get_font ()</h3>
<a class="indexterm" name="id3443495"></a><pre class="programlisting"><a
href="../gdk/gdk-Fonts.html#GdkFont"
>GdkFont</a>* gtk_font_selection_get_font (<a href="GtkFontSelection.html" title="GtkFontSelection">GtkFontSelection</a> *fontsel);</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gtk_font_selection_get_font</code> is deprecated and should not be used in newly-written code.</p>
</div>
<p>
Gets the currently-selected font.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>fontsel</code></em> :</span></td>
<td>a <a href="GtkFontSelection.html" title="GtkFontSelection"><span class="type">GtkFontSelection</span></a>.
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td>the currently-selected font, or NULL if no font is selected.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3443573"></a><h3>
<a name="gtk-font-selection-get-font-name"></a>gtk_font_selection_get_font_name ()</h3>
<a class="indexterm" name="id3443587"></a><pre class="programlisting"><a
href="../glib/glib-Basic-Types.html#gchar"
>gchar</a>* gtk_font_selection_get_font_name
(<a href="GtkFontSelection.html" title="GtkFontSelection">GtkFontSelection</a> *fontsel);</pre>
<p>
Gets the currently-selected font name. Note that this can be a different
string than what you set with <a href="GtkFontSelection.html#gtk-font-selection-set-font-name"><code class="function">gtk_font_selection_set_font_name()</code></a>, as
the font selection widget may normalize font names and thus return a string
with a different structure. For example, "Helvetica Italic Bold 12" could be
normalized to "Helvetica Bold Italic 12". Use <a
href="../pango/pango-Fonts.html#pango-font-description-equal"
><code class="function">pango_font_description_equal()</code></a>
if you want to compare two font descriptions.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>fontsel</code></em> :</span></td>
<td> a <a href="GtkFontSelection.html" title="GtkFontSelection"><span class="type">GtkFontSelection</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> A string with the name of the current font, or <a
href="../glib/glib-Standard-Macros.html#NULL:CAPS"
><span class="type">NULL</span></a> if no font
is selected. You must free this string with <a
href="../glib/glib-Memory-Allocation.html#g-free"
><code class="function">g_free()</code></a>.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3443706"></a><h3>
<a name="gtk-font-selection-set-font-name"></a>gtk_font_selection_set_font_name ()</h3>
<a class="indexterm" name="id3443720"></a><pre class="programlisting"><a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> gtk_font_selection_set_font_name
(<a href="GtkFontSelection.html" title="GtkFontSelection">GtkFontSelection</a> *fontsel,
const <a
href="../glib/glib-Basic-Types.html#gchar"
>gchar</a> *fontname);</pre>
<p>
Sets the currently-selected font. Note that the <em class="parameter"><code>fontsel</code></em> needs to know the
screen in which it will appear for this to work; this can be guaranteed by
simply making sure that the <em class="parameter"><code>fontsel</code></em> is inserted in a toplevel window before
you call this function.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>fontsel</code></em> :</span></td>
<td> a <a href="GtkFontSelection.html" title="GtkFontSelection"><span class="type">GtkFontSelection</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>fontname</code></em> :</span></td>
<td> a font name like "Helvetica 12" or "Times Bold 18"
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> <a
href="../glib/glib-Standard-Macros.html#TRUE:CAPS"
><span class="type">TRUE</span></a> if the font could be set successfully; <a
href="../glib/glib-Standard-Macros.html#FALSE:CAPS"
><span class="type">FALSE</span></a> if no such
font exists or if the <em class="parameter"><code>fontsel</code></em> doesn't belong to a particular screen yet.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3443850"></a><h3>
<a name="gtk-font-selection-get-preview-text"></a>gtk_font_selection_get_preview_text ()</h3>
<a class="indexterm" name="id3443865"></a><pre class="programlisting">const <a
href="../glib/glib-Basic-Types.html#gchar"
>gchar</a>* gtk_font_selection_get_preview_text
(<a href="GtkFontSelection.html" title="GtkFontSelection">GtkFontSelection</a> *fontsel);</pre>
<p>
Gets the text displayed in the preview area.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>fontsel</code></em> :</span></td>
<td>a <a href="GtkFontSelection.html" title="GtkFontSelection"><span class="type">GtkFontSelection</span></a>.
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td>the text displayed in the preview area. This string is
owned by the widget and should not be modified or freed.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3443934"></a><h3>
<a name="gtk-font-selection-set-preview-text"></a>gtk_font_selection_set_preview_text ()</h3>
<a class="indexterm" name="id3443948"></a><pre class="programlisting">void gtk_font_selection_set_preview_text
(<a href="GtkFontSelection.html" title="GtkFontSelection">GtkFontSelection</a> *fontsel,
const <a
href="../glib/glib-Basic-Types.html#gchar"
>gchar</a> *text);</pre>
<p>
Sets the text displayed in the preview area.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>fontsel</code></em> :</span></td>
<td>a <a href="GtkFontSelection.html" title="GtkFontSelection"><span class="type">GtkFontSelection</span></a>.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>text</code></em> :</span></td>
<td>the text to display in the preview area.
</td>
</tr>
</tbody>
</table></div>
</div>
</div>
<div class="refsect1" lang="en">
<a name="id3444027"></a><h2>Property Details</h2>
<div class="refsect2" lang="en">
<a name="id3444038"></a><h3>
<a name="GtkFontSelection--font"></a>The "<code class="literal">font</code>" property</h3>
<a class="indexterm" name="id3444054"></a><pre class="programlisting"> "font" <a
href="../gdk/gdk-Fonts.html#GdkFont"
>GdkFont</a> : Read</pre>
<p>The GdkFont that is currently selected.</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3444077"></a><h3>
<a name="GtkFontSelection--font-name"></a>The "<code class="literal">font-name</code>" property</h3>
<a class="indexterm" name="id3444094"></a><pre class="programlisting"> "font-name" <a
href="../gobject/gobject-Standard-Parameter-and-Value-Types.html#gchararray"
>gchararray</a> : Read / Write</pre>
<p>The X string that represents this font.</p>
<p>Default value: NULL</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3444120"></a><h3>
<a name="GtkFontSelection--preview-text"></a>The "<code class="literal">preview-text</code>" property</h3>
<a class="indexterm" name="id3444137"></a><pre class="programlisting"> "preview-text" <a
href="../gobject/gobject-Standard-Parameter-and-Value-Types.html#gchararray"
>gchararray</a> : Read / Write</pre>
<p>The text to display in order to demonstrate the selected font.</p>
<p>Default value: "abcdefghijk ABCDEFGHIJK"</p>
</div>
</div>
<div class="refsect1" lang="en">
<a name="id3444166"></a><h2>See Also</h2>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><a href="GtkFontSelectionDialog.html" title="GtkFontSelectionDialog"><span class="type">GtkFontSelectionDialog</span></a></span></td>
<td><p>a dialog box which uses <a href="GtkFontSelection.html" title="GtkFontSelection"><span class="type">GtkFontSelection</span></a>.</p></td>
</tr></tbody>
</table></div>
<p>
</p>
</div>
</div>
</body>
</html>