GtkFontButton — A button to launch a font chooser dialog
GtkWidget * | gtk_font_button_new () |
GtkWidget * | gtk_font_button_new_with_font () |
void | gtk_font_button_set_use_font () |
gboolean | gtk_font_button_get_use_font () |
void | gtk_font_button_set_use_size () |
gboolean | gtk_font_button_get_use_size () |
void | gtk_font_button_set_title () |
const char * | gtk_font_button_get_title () |
void | gtk_font_button_set_modal () |
gboolean | gtk_font_button_get_modal () |
void | font-set | Run First |
GObject ╰── GInitiallyUnowned ╰── GtkWidget ╰── GtkFontButton
GtkFontButton implements GtkAccessible, GtkBuildable, GtkConstraintTarget and GtkFontChooser.
#include <gtk/gtk.h>
The GtkFontButton is a button which displays the currently selected font an allows to open a font chooser dialog to change the font. It is suitable widget for selecting a font in a preference dialog.
GtkFontButton has a single CSS node with name fontbutton.
GtkWidget *
gtk_font_button_new (void
);
Creates a new font picker widget.
a new font picker widget.
GtkWidget *
gtk_font_button_new_with_font (const char *fontname
);
Creates a new font picker widget.
fontname | Name of font to display in font chooser dialog |
a new font picker widget.
void gtk_font_button_set_use_font (GtkFontButton *font_button
,gboolean use_font
);
If use_font
is TRUE
, the font name will be written using the selected font.
font_button | ||
use_font | If |
gboolean
gtk_font_button_get_use_font (GtkFontButton *font_button
);
Returns whether the selected font is used in the label.
font_button |
whether the selected font is used in the label.
void gtk_font_button_set_use_size (GtkFontButton *font_button
,gboolean use_size
);
If use_size
is TRUE
, the font name will be written using the selected size.
font_button | ||
use_size | If |
gboolean
gtk_font_button_get_use_size (GtkFontButton *font_button
);
Returns whether the selected size is used in the label.
font_button |
whether the selected size is used in the label.
void gtk_font_button_set_title (GtkFontButton *font_button
,const char *title
);
Sets the title for the font chooser dialog.
font_button | ||
title | a string containing the font chooser dialog title |
const char *
gtk_font_button_get_title (GtkFontButton *font_button
);
Retrieves the title of the font chooser dialog.
font_button |
an internal copy of the title string which must not be freed.
void gtk_font_button_set_modal (GtkFontButton *font_button
,gboolean modal
);
Sets whether the dialog should be modal.
font_button | ||
modal |
|
gboolean
gtk_font_button_get_modal (GtkFontButton *font_button
);
Gets whether the dialog is modal.
font_button |
TRUE
if the dialog is modal
typedef struct _GtkFontButton GtkFontButton;
“modal”
property“modal” gboolean
Whether the dialog is modal.
Owner: GtkFontButton
Flags: Read / Write
Default value: TRUE
“title”
property“title” char *
The title of the font chooser dialog.
Owner: GtkFontButton
Flags: Read / Write
Default value: "Pick a Font"
“use-font”
property“use-font” gboolean
If this property is set to TRUE
, the label will be drawn in the selected font.
Owner: GtkFontButton
Flags: Read / Write
Default value: FALSE
“use-size”
property“use-size” gboolean
If this property is set to TRUE
, the label will be drawn with the selected font size.
Owner: GtkFontButton
Flags: Read / Write
Default value: FALSE
“font-set”
signalvoid user_function (GtkFontButton *widget, gpointer user_data)
The ::font-set signal is emitted when the user selects a font. When handling this signal, use gtk_font_chooser_get_font()
to find out which font was just selected.
Note that this signal is only emitted when the user changes the font. If you need to react to programmatic font changes as well, use the notify::font signal.
widget | the object which received the signal. | |
user_data | user data set when the signal handler was connected. |
Flags: Run First
© 2005–2020 The GNOME Project
Licensed under the GNU Lesser General Public License version 2.1 or later.
https://developer.gnome.org/gtk4/4.0/GtkFontButton.html