FontChooserDialog

The gtk.FontChooserDialog widget is a dialog for selecting a font. It implements the GtkFontChooser interface.

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 gtk.FontChooserDialog

Members

Functions

getFontChooserDialogStruct
GtkFontChooserDialog* getFontChooserDialogStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

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*

addButton
Button addButton(StockID stockID, int responseId)
addButtons
void addButtons(string[] buttonsText, ResponseType[] responses)
addButtons
void addButtons(StockID[] stockIDs, ResponseType[] responses)
getActionArea
HButtonBox getActionArea()

Returns the action area of dialog.

getContentArea
VBox getContentArea()

Returns the content area of dialog.

getType
GType getType()
addActionWidget
void addActionWidget(Widget child, int responseId)

Adds an activatable widget to the action area of a gtk.Dialog, connecting a signal handler that will emit the response signal on the dialog when the widget is activated. The widget is appended to the end of the dialog’s action area. If you want to add a non-activatable widget, simply pack it into the action_area field of the gtk.Dialog struct.

addButton
Widget addButton(string buttonText, int responseId)

Adds a button with the given text and sets things up so that clicking the button will emit the response signal with the given response_id. The button is appended to the end of the dialog’s action area. The button widget is returned, but usually you don’t need it.

getHeaderBar
Widget getHeaderBar()

Returns the header bar of dialog. Note that the headerbar is only used by the dialog if the use-header-bar property is TRUE.

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. Used to indicate that the user has responded to the dialog in some way; typically either you or Dialog.run will be monitoring the ::response signal and take appropriate action.

run
int run()

Blocks in a recursive main loop until the dialog either emits the response signal, or is destroyed. If the dialog is destroyed during the call to Dialog.run, Dialog.run returns GTK_RESPONSE_NONE Otherwise, it returns the response ID from the ::response signal emission.

setAlternativeButtonOrder
void setAlternativeButtonOrder(int[] newOrder)

Sets an alternative button order. If the gtk-alternative-button-order setting is set to TRUE, the dialog buttons are reordered according to the order of the response ids in new_order.

setDefaultResponse
void setDefaultResponse(int responseId)

Sets the last widget in the dialog’s action area with the given response_id as the default widget for the dialog. Pressing “Enter” normally activates the default widget.

setResponseSensitive
void setResponseSensitive(int responseId, bool setting)

Calls gtk_widget_set_sensitive (widget, setting) for each widget in the dialog’s action area with the given response_id. A convenient way to sensitize/desensitize dialog buttons.

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

The ::close signal is a [keybinding signal]GtkBindingSignal which gets 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, the dialog receives a delete event, or the application programmer calls Dialog.response. On a delete event, the response ID is GTK_RESPONSE_DELETE_EVENT Otherwise, it depends on which action widget was clicked.

alternativeDialogButtonOrder
bool alternativeDialogButtonOrder(Screen screen)

Returns TRUE if dialogs are expected to use an alternative button order on the screen screen. See Dialog.setAlternativeButtonOrder for more details about alternative button order.

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 cairo.FontFace representing the selected font group details (i.e. family, slant, weight, width, etc).

getFontFamily
PgFontFamily getFontFamily()

Gets the PangoFontFamily representing the selected font family. Font families are a collection of font faces.

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. A custom font map can be used to present application-specific fonts instead of or in addition to the normal system fonts.

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. The text is used to show how the selected font looks.

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. This usually happens when the user double clicks an item, or an item is selected and the user presses one of the keys Space, Shift+Space, Return or Enter.

Meta