| GTK-EXTRA - Reference Manual

| Home

# Gtkfontcombo

## Name

Gtkfontcombo - font combo widget for gtk+

## Synopsis

    GtkType

    gtk_font_combo_get_type

    (void);

    GtkWidget *

    gtk_font_combo_new

    (void);

    void

    gtk_font_combo_select

    (GtkFontCombo *font_combo,
    const gchar *family,
    gboolean bold,
    gboolean italic,
    gint height);

    void

    gtk_font_combo_select_nth

    (GtkFontCombo *font_combo,
    gint n,
    gboolean bold,
    gboolean italic,
    gint height);

## Object Hierarchy

      GtkObject
       +----GtkWidget
             +----GtkContainer
                   +----GtkToolbar
                        +----Gtkfontcombo

##
Args

## Signal Prototypes

    void (* changed) (GtkFontCombo *font_combo);

## Description

It is a GtkToolBar subclass with two combos to select among the 35 standard Adobe PostScript fonts with different sizes. It has also two buttons to select bold and italics. When you select a new font, it returns the name of the corresponding Postscript font and the equivalent Xfont. This is what we all expect to have on the top of a GUI for a spreadsheet or word processor

##
Details

    struct _GtkFontCombo {
    	GtkToolbar toolbar;
    	GtkWidget *name_combo;
    	GtkWidget *size_combo;
       GtkWidget *bold_button;
    	GtkWidget *italic_button;
       GtkPSFont *psfont;
       GdkFont *font;
       gint height;
       gboolean italic;
       gboolean bold;
    };

#### You should access only the entry and list fields directly

### gtk_font_combo_get_type ()

    GtkType gtk_font_combo_get_type (void);

Returns : |

### gtk_font_combo_new ()

    GtkWidget *gtk_font_combo_new (void);

Create a new font combo widget

Returns : | a new font combo widget

### gtk_font_combo_select ()

    void gtk_font_combo_select (GtkFontCombo *font_combo,
                                const gchar *family,
                                gboolean bold,
                                gboolean italic,
                                gint height);

Select a font from the combo which satisfies the arguments

font_combo | font combo widget
family | font family
bold | TRUE or FALSE
italic | TRUE or FALSE
height | height of the font

### gtk_font_combo_select_nth ()

    void gtk_font_combo_select_nth (GtkFontCombo *font_combo,
                                    gint n,
                                    gboolean bold,
                                    gboolean italic,
                                    gint height);

Select the nth font from the combo which satisfies the arguments

font_combo | font combo widget
n | the nth font from font combo
bold | TRUE or FALSE
italic | TRUE or FALSE
height | height of the font

## Signals

### The "changed" signal

    void (* changed) (GtkFontCombo *font_combo);

Should be connected if you wish to perform an action whenever a different font is choosed.

font_combo | font combo widget

| Home |  |