![]() |
![]() |
![]() |
GTK+ 3 Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
#include <gtk/gtk.h> struct GtkFontChooserDialog; GtkWidget * gtk_font_chooser_dialog_new (const gchar *title
,GtkWindow *window
); GtkWidget * gtk_font_chooser_dialog_get_font_chooser (GtkFontChooserDialog *fcd
); gchar * gtk_font_chooser_dialog_get_font_name (GtkFontChooserDialog *fcd
); gboolean gtk_font_chooser_dialog_set_font_name (GtkFontChooserDialog *fcd
,const gchar *fontname
); const gchar * gtk_font_chooser_dialog_get_preview_text (GtkFontChooserDialog *fcd
); void gtk_font_chooser_dialog_set_preview_text (GtkFontChooserDialog *fcd
,const gchar *text
);
The GtkFontChooserDialog widget is a dialog box for selecting a font.
To set the font which is initially selected, use
gtk_font_chooser_dialog_set_font_name()
.
To get the selected font use gtk_font_chooser_dialog_get_font_name()
.
To change the text which is shown in the preview area, use
gtk_font_chooser_dialog_set_preview_text()
.
GtkWidget * gtk_font_chooser_dialog_new (const gchar *title
,GtkWindow *window
);
Creates a new GtkFontChooserDialog.
|
Title of the dialog, or NULL . [allow-none]
|
|
Trasient parent of the dialog, or NULL . [allow-none]
|
Returns : |
a new GtkFontChooserDialog |
Since 3.2
GtkWidget * gtk_font_chooser_dialog_get_font_chooser
(GtkFontChooserDialog *fcd
);
Retrieves the GtkFontChooser widget embedded in the dialog.
|
a GtkFontChooserDialog |
Returns : |
the embedded GtkFontChooser. [transfer none] |
Since 3.2
gchar * gtk_font_chooser_dialog_get_font_name
(GtkFontChooserDialog *fcd
);
Gets the currently-selected font name.
Note that this can be a different string than what you set with
gtk_font_chooser_dialog_set_font_name()
, as the font chooser 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 pango_font_description_equal()
if you want to compare two
font descriptions.
|
a GtkFontChooserDialog |
Returns : |
A string with the name of the current font, or NULL
if no font is selected. You must free this string with g_free() . |
Since 3.2
gboolean gtk_font_chooser_dialog_set_font_name (GtkFontChooserDialog *fcd
,const gchar *fontname
);
Sets the currently selected font.
|
a GtkFontChooserDialog |
|
a font name like "Helvetica 12" or "Times Bold 18" |
Returns : |
TRUE if the font selected in fcd is now the
fontname specified, FALSE otherwise. |
Since 3.2
const gchar * gtk_font_chooser_dialog_get_preview_text
(GtkFontChooserDialog *fcd
);
Gets the text displayed in the preview area.
|
a GtkFontChooserDialog |
Returns : |
the text displayed in the preview area. This string is owned by the widget and should not be modified or freed |
Since 3.2
void gtk_font_chooser_dialog_set_preview_text (GtkFontChooserDialog *fcd
,const gchar *text
);
Sets the text displayed in the preview area.
|
a GtkFontChooserDialog |
|
the text to display in the preview area |
Since 3.2