gi-gtk-3.0.32: Gtk bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.Gtk.Objects.FontButton

Description

The FontButton 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.

CSS nodes

GtkFontButton has a single CSS node with name button and style class .font.

Synopsis

Exported types

newtype FontButton Source #

Memory-managed wrapper type.

class (GObject o, IsDescendantOf FontButton o) => IsFontButton o Source #

Type class for types which can be safely cast to FontButton, for instance with toFontButton.

Instances

Instances details
(GObject o, IsDescendantOf FontButton o) => IsFontButton o Source # 
Instance details

Defined in GI.Gtk.Objects.FontButton

toFontButton :: (MonadIO m, IsFontButton o) => o -> m FontButton Source #

Cast to FontButton, for types for which this is known to be safe. For general casts, use castTo.

Methods

Overloaded methods

getFontName

fontButtonGetFontName Source #

Arguments

:: (HasCallStack, MonadIO m, IsFontButton a) 
=> a

fontButton: a FontButton

-> m Text

Returns: an internal copy of the font name which must not be freed.

Deprecated: (Since version 3.22)Use fontChooserGetFont instead

Retrieves the name of the currently selected font. This name includes style and size information as well. If you want to render something with the font, use this string with fontDescriptionFromString . If you’re interested in peeking certain values (family name, style, size, weight) just query these properties from the FontDescription object.

Since: 2.4

getShowSize

fontButtonGetShowSize Source #

Arguments

:: (HasCallStack, MonadIO m, IsFontButton a) 
=> a

fontButton: a FontButton

-> m Bool

Returns: whether the font size will be shown in the label.

Returns whether the font size will be shown in the label.

Since: 2.4

getShowStyle

fontButtonGetShowStyle Source #

Arguments

:: (HasCallStack, MonadIO m, IsFontButton a) 
=> a

fontButton: a FontButton

-> m Bool

Returns: whether the font style will be shown in the label.

Returns whether the name of the font style will be shown in the label.

Since: 2.4

getTitle

fontButtonGetTitle Source #

Arguments

:: (HasCallStack, MonadIO m, IsFontButton a) 
=> a

fontButton: a FontButton

-> m Text

Returns: an internal copy of the title string which must not be freed.

Retrieves the title of the font chooser dialog.

Since: 2.4

getUseFont

fontButtonGetUseFont Source #

Arguments

:: (HasCallStack, MonadIO m, IsFontButton a) 
=> a

fontButton: a FontButton

-> m Bool

Returns: whether the selected font is used in the label.

Returns whether the selected font is used in the label.

Since: 2.4

getUseSize

fontButtonGetUseSize Source #

Arguments

:: (HasCallStack, MonadIO m, IsFontButton a) 
=> a

fontButton: a FontButton

-> m Bool

Returns: whether the selected size is used in the label.

Returns whether the selected size is used in the label.

Since: 2.4

new

fontButtonNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m FontButton

Returns: a new font picker widget.

Creates a new font picker widget.

Since: 2.4

newWithFont

fontButtonNewWithFont Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

fontname: Name of font to display in font chooser dialog

-> m FontButton

Returns: a new font picker widget.

Creates a new font picker widget.

Since: 2.4

setFontName

fontButtonSetFontName Source #

Arguments

:: (HasCallStack, MonadIO m, IsFontButton a) 
=> a

fontButton: a FontButton

-> Text

fontname: Name of font to display in font chooser dialog

-> m Bool

Returns: True

Deprecated: (Since version 3.22)Use fontChooserSetFont instead

Sets or updates the currently-displayed font in font picker dialog.

Since: 2.4

setShowSize

fontButtonSetShowSize Source #

Arguments

:: (HasCallStack, MonadIO m, IsFontButton a) 
=> a

fontButton: a FontButton

-> Bool

showSize: True if font size should be displayed in dialog.

-> m () 

If showSize is True, the font size will be displayed along with the name of the selected font.

Since: 2.4

setShowStyle

fontButtonSetShowStyle Source #

Arguments

:: (HasCallStack, MonadIO m, IsFontButton a) 
=> a

fontButton: a FontButton

-> Bool

showStyle: True if font style should be displayed in label.

-> m () 

If showStyle is True, the font style will be displayed along with name of the selected font.

Since: 2.4

setTitle

fontButtonSetTitle Source #

Arguments

:: (HasCallStack, MonadIO m, IsFontButton a) 
=> a

fontButton: a FontButton

-> Text

title: a string containing the font chooser dialog title

-> m () 

Sets the title for the font chooser dialog.

Since: 2.4

setUseFont

fontButtonSetUseFont Source #

Arguments

:: (HasCallStack, MonadIO m, IsFontButton a) 
=> a

fontButton: a FontButton

-> Bool

useFont: If True, font name will be written using font chosen.

-> m () 

If useFont is True, the font name will be written using the selected font.

Since: 2.4

setUseSize

fontButtonSetUseSize Source #

Arguments

:: (HasCallStack, MonadIO m, IsFontButton a) 
=> a

fontButton: a FontButton

-> Bool

useSize: If True, font name will be written using the selected size.

-> m () 

If useSize is True, the font name will be written using the selected size.

Since: 2.4

Properties

fontName

The name of the currently selected font.

Since: 2.4

clearFontButtonFontName :: (MonadIO m, IsFontButton o) => o -> m () Source #

Set the value of the “font-name” property to Nothing. When overloading is enabled, this is equivalent to

clear #fontName

constructFontButtonFontName :: IsFontButton o => Text -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “font-name” property. This is rarely needed directly, but it is used by new.

getFontButtonFontName :: (MonadIO m, IsFontButton o) => o -> m Text Source #

Get the value of the “font-name” property. When overloading is enabled, this is equivalent to

get fontButton #fontName

setFontButtonFontName :: (MonadIO m, IsFontButton o) => o -> Text -> m () Source #

Set the value of the “font-name” property. When overloading is enabled, this is equivalent to

set fontButton [ #fontName := value ]

showSize

If this property is set to True, the selected font size will be shown in the label. For a more WYSIWYG way to show the selected size, see the useSize property.

Since: 2.4

constructFontButtonShowSize :: IsFontButton o => Bool -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “show-size” property. This is rarely needed directly, but it is used by new.

getFontButtonShowSize :: (MonadIO m, IsFontButton o) => o -> m Bool Source #

Get the value of the “show-size” property. When overloading is enabled, this is equivalent to

get fontButton #showSize

setFontButtonShowSize :: (MonadIO m, IsFontButton o) => o -> Bool -> m () Source #

Set the value of the “show-size” property. When overloading is enabled, this is equivalent to

set fontButton [ #showSize := value ]

showStyle

If this property is set to True, the name of the selected font style will be shown in the label. For a more WYSIWYG way to show the selected style, see the useFont property.

Since: 2.4

constructFontButtonShowStyle :: IsFontButton o => Bool -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “show-style” property. This is rarely needed directly, but it is used by new.

getFontButtonShowStyle :: (MonadIO m, IsFontButton o) => o -> m Bool Source #

Get the value of the “show-style” property. When overloading is enabled, this is equivalent to

get fontButton #showStyle

setFontButtonShowStyle :: (MonadIO m, IsFontButton o) => o -> Bool -> m () Source #

Set the value of the “show-style” property. When overloading is enabled, this is equivalent to

set fontButton [ #showStyle := value ]

title

The title of the font chooser dialog.

Since: 2.4

constructFontButtonTitle :: IsFontButton o => Text -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “title” property. This is rarely needed directly, but it is used by new.

getFontButtonTitle :: (MonadIO m, IsFontButton o) => o -> m Text Source #

Get the value of the “title” property. When overloading is enabled, this is equivalent to

get fontButton #title

setFontButtonTitle :: (MonadIO m, IsFontButton o) => o -> Text -> m () Source #

Set the value of the “title” property. When overloading is enabled, this is equivalent to

set fontButton [ #title := value ]

useFont

If this property is set to True, the label will be drawn in the selected font.

Since: 2.4

constructFontButtonUseFont :: IsFontButton o => Bool -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “use-font” property. This is rarely needed directly, but it is used by new.

getFontButtonUseFont :: (MonadIO m, IsFontButton o) => o -> m Bool Source #

Get the value of the “use-font” property. When overloading is enabled, this is equivalent to

get fontButton #useFont

setFontButtonUseFont :: (MonadIO m, IsFontButton o) => o -> Bool -> m () Source #

Set the value of the “use-font” property. When overloading is enabled, this is equivalent to

set fontButton [ #useFont := value ]

useSize

If this property is set to True, the label will be drawn with the selected font size.

Since: 2.4

constructFontButtonUseSize :: IsFontButton o => Bool -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “use-size” property. This is rarely needed directly, but it is used by new.

getFontButtonUseSize :: (MonadIO m, IsFontButton o) => o -> m Bool Source #

Get the value of the “use-size” property. When overloading is enabled, this is equivalent to

get fontButton #useSize

setFontButtonUseSize :: (MonadIO m, IsFontButton o) => o -> Bool -> m () Source #

Set the value of the “use-size” property. When overloading is enabled, this is equivalent to

set fontButton [ #useSize := value ]

Signals

fontSet

type C_FontButtonFontSetCallback = Ptr () -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type FontButtonFontSetCallback = IO () Source #

The fontSet signal is emitted when the user selects a font. When handling this signal, use fontChooserGetFont 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:font) signal.

Since: 2.4

afterFontButtonFontSet :: (IsFontButton a, MonadIO m) => a -> FontButtonFontSetCallback -> m SignalHandlerId Source #

Connect a signal handler for the fontSet signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after fontButton #fontSet callback

onFontButtonFontSet :: (IsFontButton a, MonadIO m) => a -> FontButtonFontSetCallback -> m SignalHandlerId Source #

Connect a signal handler for the fontSet signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on fontButton #fontSet callback