Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | None |
Language | Haskell2010 |
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 fontbutton.
Synopsis
- newtype FontButton = FontButton (ManagedPtr FontButton)
- class (GObject o, IsDescendantOf FontButton o) => IsFontButton o
- toFontButton :: (MonadIO m, IsFontButton o) => o -> m FontButton
- noFontButton :: Maybe FontButton
- fontButtonGetTitle :: (HasCallStack, MonadIO m, IsFontButton a) => a -> m Text
- fontButtonGetUseFont :: (HasCallStack, MonadIO m, IsFontButton a) => a -> m Bool
- fontButtonGetUseSize :: (HasCallStack, MonadIO m, IsFontButton a) => a -> m Bool
- fontButtonNew :: (HasCallStack, MonadIO m) => m FontButton
- fontButtonNewWithFont :: (HasCallStack, MonadIO m) => Text -> m FontButton
- fontButtonSetTitle :: (HasCallStack, MonadIO m, IsFontButton a) => a -> Text -> m ()
- fontButtonSetUseFont :: (HasCallStack, MonadIO m, IsFontButton a) => a -> Bool -> m ()
- fontButtonSetUseSize :: (HasCallStack, MonadIO m, IsFontButton a) => a -> Bool -> m ()
- constructFontButtonTitle :: IsFontButton o => Text -> IO (GValueConstruct o)
- getFontButtonTitle :: (MonadIO m, IsFontButton o) => o -> m Text
- setFontButtonTitle :: (MonadIO m, IsFontButton o) => o -> Text -> m ()
- constructFontButtonUseFont :: IsFontButton o => Bool -> IO (GValueConstruct o)
- getFontButtonUseFont :: (MonadIO m, IsFontButton o) => o -> m Bool
- setFontButtonUseFont :: (MonadIO m, IsFontButton o) => o -> Bool -> m ()
- constructFontButtonUseSize :: IsFontButton o => Bool -> IO (GValueConstruct o)
- getFontButtonUseSize :: (MonadIO m, IsFontButton o) => o -> m Bool
- setFontButtonUseSize :: (MonadIO m, IsFontButton o) => o -> Bool -> m ()
- type C_FontButtonFontSetCallback = Ptr () -> Ptr () -> IO ()
- type FontButtonFontSetCallback = IO ()
- afterFontButtonFontSet :: (IsFontButton a, MonadIO m) => a -> FontButtonFontSetCallback -> m SignalHandlerId
- genClosure_FontButtonFontSet :: MonadIO m => FontButtonFontSetCallback -> m (GClosure C_FontButtonFontSetCallback)
- mk_FontButtonFontSetCallback :: C_FontButtonFontSetCallback -> IO (FunPtr C_FontButtonFontSetCallback)
- noFontButtonFontSetCallback :: Maybe FontButtonFontSetCallback
- onFontButtonFontSet :: (IsFontButton a, MonadIO m) => a -> FontButtonFontSetCallback -> m SignalHandlerId
- wrap_FontButtonFontSetCallback :: FontButtonFontSetCallback -> C_FontButtonFontSetCallback
Exported types
newtype FontButton Source #
Memory-managed wrapper type.
Instances
Eq FontButton Source # | |
Defined in GI.Gtk.Objects.FontButton (==) :: FontButton -> FontButton -> Bool # (/=) :: FontButton -> FontButton -> Bool # | |
IsGValue FontButton Source # | Convert |
Defined in GI.Gtk.Objects.FontButton toGValue :: FontButton -> IO GValue # fromGValue :: GValue -> IO FontButton # | |
GObject FontButton Source # | |
Defined in GI.Gtk.Objects.FontButton gobjectType :: IO GType # | |
HasParentTypes FontButton Source # | |
Defined in GI.Gtk.Objects.FontButton | |
type ParentTypes FontButton Source # | |
Defined in GI.Gtk.Objects.FontButton |
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
(GObject o, IsDescendantOf FontButton o) => IsFontButton o Source # | |
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
.
noFontButton :: Maybe FontButton Source #
A convenience alias for Nothing
:: Maybe
FontButton
.
Methods
Overloaded methods
getTitle
:: (HasCallStack, MonadIO m, IsFontButton a) | |
=> a |
|
-> m Text | Returns: an internal copy of the title string which must not be freed. |
Retrieves the title of the font chooser dialog.
getUseFont
:: (HasCallStack, MonadIO m, IsFontButton a) | |
=> a |
|
-> m Bool | Returns: whether the selected font is used in the label. |
Returns whether the selected font is used in the label.
getUseSize
:: (HasCallStack, MonadIO m, IsFontButton a) | |
=> a |
|
-> m Bool | Returns: whether the selected size is used in the label. |
Returns whether the selected size is used in the label.
new
:: (HasCallStack, MonadIO m) | |
=> m FontButton | Returns: a new font picker widget. |
Creates a new font picker widget.
newWithFont
fontButtonNewWithFont Source #
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m FontButton | Returns: a new font picker widget. |
Creates a new font picker widget.
setTitle
:: (HasCallStack, MonadIO m, IsFontButton a) | |
=> a |
|
-> Text |
|
-> m () |
Sets the title for the font chooser dialog.
setUseFont
:: (HasCallStack, MonadIO m, IsFontButton a) | |
=> a |
|
-> Bool |
|
-> m () |
If useFont
is True
, the font name will be written using the selected font.
setUseSize
:: (HasCallStack, MonadIO m, IsFontButton a) | |
=> a |
|
-> Bool |
|
-> m () |
If useSize
is True
, the font name will be written using the selected size.
Properties
title
The title of the font chooser dialog.
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.
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.
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.
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
genClosure_FontButtonFontSet :: MonadIO m => FontButtonFontSetCallback -> m (GClosure C_FontButtonFontSetCallback) Source #
Wrap the callback into a GClosure
.
mk_FontButtonFontSetCallback :: C_FontButtonFontSetCallback -> IO (FunPtr C_FontButtonFontSetCallback) Source #
Generate a function pointer callable from C code, from a C_FontButtonFontSetCallback
.
noFontButtonFontSetCallback :: Maybe FontButtonFontSetCallback Source #
A convenience synonym for
.Nothing
:: Maybe
FontButtonFontSetCallback
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