FontChooserDialog

The GtkFontChooserDialog widget is a dialog for selecting a font.

An example GtkFontChooserDialog

GtkFontChooserDialog implements the [iface@Gtk.FontChooser] interface and does not provide much API of its own.

To create a GtkFontChooserDialog, use [ctor@Gtk.FontChooserDialog.new].

GtkFontChooserDialog as GtkBuildable

The GtkFontChooserDialog implementation of the GtkBuildable interface exposes the buttons with the names “select_button” and “cancel_button”.

Constructors

this
this(GtkFontChooserDialog* gtkFontChooserDialog, bool ownedRef)

Sets our main struct and passes it to the parent class.

this
this(string title, Window parent)

Creates a new GtkFontChooserDialog.

Members

Functions

getFontChooserDialogStruct
GtkFontChooserDialog* getFontChooserDialogStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

Mixins

__anonymous
mixin FontChooserT!(GtkFontChooserDialog)
Undocumented in source.

Static functions

getType
GType getType()

Variables

gtkFontChooserDialog
GtkFontChooserDialog* gtkFontChooserDialog;

the main Gtk struct

Inherited Members

From Dialog

gtkDialog
GtkDialog* gtkDialog;

the main Gtk struct

getDialogStruct
GtkDialog* getDialogStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

addButtons
void addButtons(string[] buttonsText, ResponseType[] responses)
getType
GType getType()
addActionWidget
void addActionWidget(Widget child, int responseId)

Adds an activatable widget to the action area of a GtkDialog.

addButton
Widget addButton(string buttonText, int responseId)

Adds a button with the given text.

getContentArea
Box getContentArea()

Returns the content area of @dialog.

getHeaderBar
HeaderBar getHeaderBar()

Returns the header bar of @dialog.

getResponseForWidget
int getResponseForWidget(Widget widget)

Gets the response id of a widget in the action area of a dialog.

getWidgetForResponse
Widget getWidgetForResponse(int responseId)

Gets the widget button that uses the given response ID in the action area of a dialog.

response
void response(int responseId)

Emits the ::response signal with the given response ID.

setDefaultResponse
void setDefaultResponse(int responseId)

Sets the default widget for the dialog based on the response ID.

setResponseSensitive
void setResponseSensitive(int responseId, bool setting)

A convenient way to sensitize/desensitize dialog buttons.

addOnClose
gulong addOnClose(void delegate(Dialog) dlg, ConnectFlags connectFlags)

Emitted when the user uses a keybinding to close the dialog.

addOnResponse
gulong addOnResponse(void delegate(int, Dialog) dlg, ConnectFlags connectFlags)

Emitted when an action widget is clicked.

From FontChooserIF

getFontChooserStruct
GtkFontChooser* getFontChooserStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

getType
GType getType()
getFont
string getFont()

Gets the currently-selected font name.

getFontDesc
PgFontDescription getFontDesc()

Gets the currently-selected font.

getFontFace
PgFontFace getFontFace()

Gets the PangoFontFace representing the selected font group details (i.e. family, slant, weight, width, etc).

getFontFamily
PgFontFamily getFontFamily()

Gets the PangoFontFamily representing the selected font family.

getFontFeatures
string getFontFeatures()

Gets the currently-selected font features.

getFontMap
PgFontMap getFontMap()

Gets the custom font map of this font chooser widget, or %NULL if it does not have one.

getFontSize
int getFontSize()

The selected font size.

getLanguage
string getLanguage()

Gets the language that is used for font features.

getLevel
GtkFontChooserLevel getLevel()

Returns the current level of granularity for selecting fonts.

getPreviewText
string getPreviewText()

Gets the text displayed in the preview area.

getShowPreviewEntry
bool getShowPreviewEntry()

Returns whether the preview entry is shown or not.

setFilterFunc
void setFilterFunc(GtkFontFilterFunc filter, void* userData, GDestroyNotify destroy)

Adds a filter function that decides which fonts to display in the font chooser.

setFont
void setFont(string fontname)

Sets the currently-selected font.

setFontDesc
void setFontDesc(PgFontDescription fontDesc)

Sets the currently-selected font from @font_desc.

setFontMap
void setFontMap(PgFontMap fontmap)

Sets a custom font map to use for this font chooser widget.

setLanguage
void setLanguage(string language)

Sets the language to use for font features.

setLevel
void setLevel(GtkFontChooserLevel level)

Sets the desired level of granularity for selecting fonts.

setPreviewText
void setPreviewText(string text)

Sets the text displayed in the preview area.

setShowPreviewEntry
void setShowPreviewEntry(bool showPreviewEntry)

Shows or hides the editable preview entry.

addOnFontActivated
gulong addOnFontActivated(void delegate(string, FontChooserIF) dlg, ConnectFlags connectFlags)

Emitted when a font is activated.

Meta