<refentry id="GnomeFontPicker" revision="6 May 2000">
<refmeta>
<refentrytitle>GnomeFontPicker</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GNOMEUI Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>GnomeFontPicker</refname><refpurpose>
Button that displays current font; click to select new font.</refpurpose>
</refnamediv>

<refsynopsisdiv><title>Synopsis</title>
<synopsis>

#include &lt;gnome.h&gt;


struct      <link linkend="GnomeFontPicker-struct">GnomeFontPicker</link>;
enum        <link linkend="GnomeFontPickerMode">GnomeFontPickerMode</link>;
<link linkend="GtkWidget">GtkWidget</link>*  <link linkend="gnome-font-picker-new">gnome_font_picker_new</link>           (void);
void        <link linkend="gnome-font-picker-set-title">gnome_font_picker_set_title</link>     (<link linkend="GnomeFontPicker">GnomeFontPicker</link> *gfp,
                                             const <link linkend="gchar">gchar</link> *title);
<link linkend="GnomeFontPickerMode">GnomeFontPickerMode</link> <link linkend="gnome-font-picker-get-mode">gnome_font_picker_get_mode</link>
                                            (<link linkend="GnomeFontPicker">GnomeFontPicker</link> *gfp);
void        <link linkend="gnome-font-picker-set-mode">gnome_font_picker_set_mode</link>      (<link linkend="GnomeFontPicker">GnomeFontPicker</link> *gfp,
                                             <link linkend="GnomeFontPickerMode">GnomeFontPickerMode</link> mode);
void        <link linkend="gnome-font-picker-fi-set-use-font-in-label">gnome_font_picker_fi_set_use_font_in_label</link>
                                            (<link linkend="GnomeFontPicker">GnomeFontPicker</link> *gfp,
                                             <link linkend="gboolean">gboolean</link> use_font_in_label,
                                             <link linkend="gint">gint</link> size);
void        <link linkend="gnome-font-picker-fi-set-show-size">gnome_font_picker_fi_set_show_size</link>
                                            (<link linkend="GnomeFontPicker">GnomeFontPicker</link> *gfp,
                                             <link linkend="gboolean">gboolean</link> show_size);
void        <link linkend="gnome-font-picker-uw-set-widget">gnome_font_picker_uw_set_widget</link> (<link linkend="GnomeFontPicker">GnomeFontPicker</link> *gfp,
                                             <link linkend="GtkWidget">GtkWidget</link> *widget);
<link linkend="gchar">gchar</link>*      <link linkend="gnome-font-picker-get-font-name">gnome_font_picker_get_font_name</link> (<link linkend="GnomeFontPicker">GnomeFontPicker</link> *gfp);
<link linkend="GdkFont">GdkFont</link>*    <link linkend="gnome-font-picker-get-font">gnome_font_picker_get_font</link>      (<link linkend="GnomeFontPicker">GnomeFontPicker</link> *gfp);
<link linkend="gboolean">gboolean</link>    <link linkend="gnome-font-picker-set-font-name">gnome_font_picker_set_font_name</link> (<link linkend="GnomeFontPicker">GnomeFontPicker</link> *gfp,
                                             const <link linkend="gchar">gchar</link> *fontname);
<link linkend="gchar">gchar</link>*      <link linkend="gnome-font-picker-get-preview-text">gnome_font_picker_get_preview_text</link>
                                            (<link linkend="GnomeFontPicker">GnomeFontPicker</link> *gfp);
void        <link linkend="gnome-font-picker-set-preview-text">gnome_font_picker_set_preview_text</link>
                                            (<link linkend="GnomeFontPicker">GnomeFontPicker</link> *gfp,
                                             const <link linkend="gchar">gchar</link> *text);

</synopsis>
</refsynopsisdiv>

<refsect1>
<title>Object Hierarchy</title>
<synopsis>

  <link linkend="GtkObject">GtkObject</link>
   +----<link linkend="GtkWidget">GtkWidget</link>
         +----<link linkend="GtkContainer">GtkContainer</link>
               +----<link linkend="GtkBin">GtkBin</link>
                     +----<link linkend="GtkButton">GtkButton</link>
                           +----GnomeFontPicker
</synopsis>

</refsect1>




<refsect1>
<title>Description</title>
<para>

</para>
</refsect1>

<refsect1>
<title>Details</title>
<refsect2>
<title><anchor id="GnomeFontPicker-struct">struct GnomeFontPicker</title>
<programlisting>struct GnomeFontPicker;</programlisting>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="GnomeFontPickerMode">enum GnomeFontPickerMode</title>
<programlisting>typedef enum {
    GNOME_FONT_PICKER_MODE_PIXMAP,
    GNOME_FONT_PICKER_MODE_FONT_INFO,
    GNOME_FONT_PICKER_MODE_USER_WIDGET,
    GNOME_FONT_PICKER_MODE_UNKNOWN
} GnomeFontPickerMode;
</programlisting>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="gnome-font-picker-new">gnome_font_picker_new ()</title>
<programlisting><link linkend="GtkWidget">GtkWidget</link>*  gnome_font_picker_new           (void);</programlisting>
<para>
Create new font picker widget.</para>
<para>

</para><informaltable pgwide=1 frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>
Pointer to new font picker widget.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gnome-font-picker-set-title">gnome_font_picker_set_title ()</title>
<programlisting>void        gnome_font_picker_set_title     (<link linkend="GnomeFontPicker">GnomeFontPicker</link> *gfp,
                                             const <link linkend="gchar">gchar</link> *title);</programlisting>
<para>
Sets the title for the font selection dialog.</para>
<para>

</para><informaltable pgwide=1 frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>gfp</parameter>&nbsp;:</entry>
<entry> Pointer to GNOME font picker widget.
</entry></row>
<row><entry align="right"><parameter>title</parameter>&nbsp;:</entry>
<entry> String containing font selection dialog title.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gnome-font-picker-get-mode">gnome_font_picker_get_mode ()</title>
<programlisting><link linkend="GnomeFontPickerMode">GnomeFontPickerMode</link> gnome_font_picker_get_mode
                                            (<link linkend="GnomeFontPicker">GnomeFontPicker</link> *gfp);</programlisting>
<para>
Returns current font picker button mode (or what to show).  Possible
values include <literal>GNOME_FONT_PICKER_MODE_PIXMAP</literal>,
<literal>GNOME_FONT_PICKER_MODE_FONT_INFO</literal>, and 
<literal>GNOME_FONT_PICKER_MODE_USER_WIDGET</literal>.</para>
<para>

</para><informaltable pgwide=1 frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>gfp</parameter>&nbsp;:</entry>
<entry> Pointer to GNOME font picker widget.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>
Button mode currently set in font picker widget, or 
<literal>GNOME_FONT_PICKER_MODE_UNKNOWN</literal> on error.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gnome-font-picker-set-mode">gnome_font_picker_set_mode ()</title>
<programlisting>void        gnome_font_picker_set_mode      (<link linkend="GnomeFontPicker">GnomeFontPicker</link> *gfp,
                                             <link linkend="GnomeFontPickerMode">GnomeFontPickerMode</link> mode);</programlisting>
<para>
Set value of subsequent font picker button mode (or what to show).</para>
<para>

</para><informaltable pgwide=1 frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>gfp</parameter>&nbsp;:</entry>
<entry> Pointer to GNOME font picker widget.
</entry></row>
<row><entry align="right"><parameter>mode</parameter>&nbsp;:</entry>
<entry> Value of subsequent font picker button mode (or what to show)
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gnome-font-picker-fi-set-use-font-in-label">gnome_font_picker_fi_set_use_font_in_label ()</title>
<programlisting>void        gnome_font_picker_fi_set_use_font_in_label
                                            (<link linkend="GnomeFontPicker">GnomeFontPicker</link> *gfp,
                                             <link linkend="gboolean">gboolean</link> use_font_in_label,
                                             <link linkend="gint">gint</link> size);</programlisting>
<para>
If <parameter>use_font_in_label</parameter> is <literal>TRUE</literal>, font name will be written using font chosen
by user and using <parameter>size</parameter> passed to this function.  This only applies if
current button mode is <literal>GNOME_FONT_PICKER_MODE_FONT_INFO</literal>.</para>
<para>

</para><informaltable pgwide=1 frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>gfp</parameter>&nbsp;:</entry>
<entry> Pointer to GNOME font picker widget.
</entry></row>
<row><entry align="right"><parameter>use_font_in_label</parameter>&nbsp;:</entry>
<entry> If <literal>TRUE</literal>, font name will be written using font chosen.
</entry></row>
<row><entry align="right"><parameter>size</parameter>&nbsp;:</entry>
<entry> Display font using this point size.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gnome-font-picker-fi-set-show-size">gnome_font_picker_fi_set_show_size ()</title>
<programlisting>void        gnome_font_picker_fi_set_show_size
                                            (<link linkend="GnomeFontPicker">GnomeFontPicker</link> *gfp,
                                             <link linkend="gboolean">gboolean</link> show_size);</programlisting>
<para>
If <parameter>show_size</parameter> is <literal>TRUE</literal>, font size will be displayed along with font chosen
by user.  This only applies if current button mode is
<literal>GNOME_FONT_PICKER_MODE_FONT_INFO</literal>.</para>
<para>

</para><informaltable pgwide=1 frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>gfp</parameter>&nbsp;:</entry>
<entry> Pointer to GNOME font picker widget.
</entry></row>
<row><entry align="right"><parameter>show_size</parameter>&nbsp;:</entry>
<entry> <literal>TRUE</literal> if font size should be displayed in dialog.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gnome-font-picker-uw-set-widget">gnome_font_picker_uw_set_widget ()</title>
<programlisting>void        gnome_font_picker_uw_set_widget (<link linkend="GnomeFontPicker">GnomeFontPicker</link> *gfp,
                                             <link linkend="GtkWidget">GtkWidget</link> *widget);</programlisting>
<para>
Set the user-supplied <parameter>widget</parameter> as the inside of the font picker.
This only applies with GNOME_FONT_PICKER_MODE_USER_WIDGET.</para>
<para>

</para><informaltable pgwide=1 frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>gfp</parameter>&nbsp;:</entry>
<entry> Pointer to GNOME font picker widget.
</entry></row>
<row><entry align="right"><parameter>widget</parameter>&nbsp;:</entry>
<entry> User widget to display for inside of font picker.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gnome-font-picker-get-font-name">gnome_font_picker_get_font_name ()</title>
<programlisting><link linkend="gchar">gchar</link>*      gnome_font_picker_get_font_name (<link linkend="GnomeFontPicker">GnomeFontPicker</link> *gfp);</programlisting>
<para>
Retrieve name of font from font selection dialog.</para>
<para>

</para><informaltable pgwide=1 frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>gfp</parameter>&nbsp;:</entry>
<entry> Pointer to GNOME font picker widget.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>
Pointer to an internal copy of the font name.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gnome-font-picker-get-font">gnome_font_picker_get_font ()</title>
<programlisting><link linkend="GdkFont">GdkFont</link>*    gnome_font_picker_get_font      (<link linkend="GnomeFontPicker">GnomeFontPicker</link> *gfp);</programlisting>
<para>
Retrieve font info from font selection dialog.</para>
<para>

</para><informaltable pgwide=1 frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>gfp</parameter>&nbsp;:</entry>
<entry> Pointer to GNOME font picker widget.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>
Return value of gtk_font_selection_dialog_get_font, or <literal>NULL</literal> if
font dialog is not being displayed.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gnome-font-picker-set-font-name">gnome_font_picker_set_font_name ()</title>
<programlisting><link linkend="gboolean">gboolean</link>    gnome_font_picker_set_font_name (<link linkend="GnomeFontPicker">GnomeFontPicker</link> *gfp,
                                             const <link linkend="gchar">gchar</link> *fontname);</programlisting>
<para>
Set or update currently-displayed font in font picker dialog.</para>
<para>

</para><informaltable pgwide=1 frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>gfp</parameter>&nbsp;:</entry>
<entry> Pointer to GNOME font picker widget.
</entry></row>
<row><entry align="right"><parameter>fontname</parameter>&nbsp;:</entry>
<entry> Name of font to display in font selection dialog
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>
Return value of gtk_font_selection_dialog_set_font_name if the
font selection dialog exists, otherwise <literal>FALSE</literal>.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gnome-font-picker-get-preview-text">gnome_font_picker_get_preview_text ()</title>
<programlisting><link linkend="gchar">gchar</link>*      gnome_font_picker_get_preview_text
                                            (<link linkend="GnomeFontPicker">GnomeFontPicker</link> *gfp);</programlisting>
<para>
Retrieve preview text from font selection dialog if available.</para>
<para>

</para><informaltable pgwide=1 frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>gfp</parameter>&nbsp;:</entry>
<entry> Pointer to GNOME font picker widget.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>
Reference to internal copy of preview text string, or <literal>NULL</literal> if no
font dialog is being displayed.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gnome-font-picker-set-preview-text">gnome_font_picker_set_preview_text ()</title>
<programlisting>void        gnome_font_picker_set_preview_text
                                            (<link linkend="GnomeFontPicker">GnomeFontPicker</link> *gfp,
                                             const <link linkend="gchar">gchar</link> *text);</programlisting>
<para>
Set preview text in font picker, and in font selection dialog if one
is being displayed.</para>
<para>

</para><informaltable pgwide=1 frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>gfp</parameter>&nbsp;:</entry>
<entry> Pointer to GNOME font picker widget.
</entry></row>
<row><entry align="right"><parameter>text</parameter>&nbsp;:</entry>
<entry> New preview text
</entry></row>
</tbody></tgroup></informaltable></refsect2>

</refsect1>




</refentry>
