Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
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 button and style class .font.
Synopsis
- newtype FontButton = FontButton (ManagedPtr FontButton)
- class (GObject o, IsDescendantOf FontButton o) => IsFontButton o
- toFontButton :: (MonadIO m, IsFontButton o) => o -> m FontButton
- fontButtonGetFontName :: (HasCallStack, MonadIO m, IsFontButton a) => a -> m Text
- fontButtonGetShowSize :: (HasCallStack, MonadIO m, IsFontButton a) => a -> m Bool
- fontButtonGetShowStyle :: (HasCallStack, MonadIO m, IsFontButton a) => a -> m Bool
- 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
- fontButtonSetFontName :: (HasCallStack, MonadIO m, IsFontButton a) => a -> Text -> m Bool
- fontButtonSetShowSize :: (HasCallStack, MonadIO m, IsFontButton a) => a -> Bool -> m ()
- fontButtonSetShowStyle :: (HasCallStack, MonadIO m, IsFontButton a) => a -> Bool -> m ()
- 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 ()
- clearFontButtonFontName :: (MonadIO m, IsFontButton o) => o -> m ()
- constructFontButtonFontName :: (IsFontButton o, MonadIO m) => Text -> m (GValueConstruct o)
- getFontButtonFontName :: (MonadIO m, IsFontButton o) => o -> m Text
- setFontButtonFontName :: (MonadIO m, IsFontButton o) => o -> Text -> m ()
- constructFontButtonShowSize :: (IsFontButton o, MonadIO m) => Bool -> m (GValueConstruct o)
- getFontButtonShowSize :: (MonadIO m, IsFontButton o) => o -> m Bool
- setFontButtonShowSize :: (MonadIO m, IsFontButton o) => o -> Bool -> m ()
- constructFontButtonShowStyle :: (IsFontButton o, MonadIO m) => Bool -> m (GValueConstruct o)
- getFontButtonShowStyle :: (MonadIO m, IsFontButton o) => o -> m Bool
- setFontButtonShowStyle :: (MonadIO m, IsFontButton o) => o -> Bool -> m ()
- constructFontButtonTitle :: (IsFontButton o, MonadIO m) => Text -> m (GValueConstruct o)
- getFontButtonTitle :: (MonadIO m, IsFontButton o) => o -> m Text
- setFontButtonTitle :: (MonadIO m, IsFontButton o) => o -> Text -> m ()
- constructFontButtonUseFont :: (IsFontButton o, MonadIO m) => Bool -> m (GValueConstruct o)
- getFontButtonUseFont :: (MonadIO m, IsFontButton o) => o -> m Bool
- setFontButtonUseFont :: (MonadIO m, IsFontButton o) => o -> Bool -> m ()
- constructFontButtonUseSize :: (IsFontButton o, MonadIO m) => Bool -> m (GValueConstruct o)
- getFontButtonUseSize :: (MonadIO m, IsFontButton o) => o -> m Bool
- setFontButtonUseSize :: (MonadIO m, IsFontButton o) => o -> Bool -> m ()
- type FontButtonFontSetCallback = IO ()
- afterFontButtonFontSet :: (IsFontButton a, MonadIO m) => a -> ((?self :: a) => FontButtonFontSetCallback) -> m SignalHandlerId
- onFontButtonFontSet :: (IsFontButton a, MonadIO m) => a -> ((?self :: a) => FontButtonFontSetCallback) -> m SignalHandlerId
Exported types
newtype FontButton Source #
Memory-managed wrapper type.
FontButton (ManagedPtr FontButton) |
Instances
Eq FontButton Source # | |
Defined in GI.Gtk.Objects.FontButton (==) :: FontButton -> FontButton -> Bool # (/=) :: FontButton -> FontButton -> Bool # | |
GObject FontButton Source # | |
Defined in GI.Gtk.Objects.FontButton | |
ManagedPtrNewtype FontButton Source # | |
Defined in GI.Gtk.Objects.FontButton toManagedPtr :: FontButton -> ManagedPtr FontButton | |
TypedObject FontButton Source # | |
Defined in GI.Gtk.Objects.FontButton | |
HasParentTypes FontButton Source # | |
Defined in GI.Gtk.Objects.FontButton | |
IsGValue (Maybe FontButton) Source # | Convert |
Defined in GI.Gtk.Objects.FontButton gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe FontButton -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe FontButton) | |
type ParentTypes FontButton Source # | |
Defined in GI.Gtk.Objects.FontButton type ParentTypes FontButton = '[Button, Bin, Container, Widget, Object, ImplementorIface, Actionable, Activatable, Buildable, FontChooser] |
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
.
Methods
Click to display all available methods, including inherited ones
Methods
activate, add, addAccelerator, addChild, addDeviceEvents, addEvents, addMnemonicLabel, addTickCallback, bindProperty, bindPropertyFull, canActivateAccel, checkResize, childFocus, childGetProperty, childNotify, childNotifyByPspec, childSetProperty, childType, classPath, clicked, computeExpand, constructChild, createPangoContext, createPangoLayout, customFinished, customTagEnd, customTagStart, destroy, destroyed, deviceIsShadowed, doSetRelatedAction, dragBegin, dragBeginWithCoordinates, dragCheckThreshold, dragDestAddImageTargets, dragDestAddTextTargets, dragDestAddUriTargets, dragDestFindTarget, dragDestGetTargetList, dragDestGetTrackMotion, dragDestSet, dragDestSetProxy, dragDestSetTargetList, dragDestSetTrackMotion, dragDestUnset, dragGetData, dragHighlight, dragSourceAddImageTargets, dragSourceAddTextTargets, dragSourceAddUriTargets, dragSourceGetTargetList, dragSourceSet, dragSourceSetIconGicon, dragSourceSetIconName, dragSourceSetIconPixbuf, dragSourceSetIconStock, dragSourceSetTargetList, dragSourceUnset, dragUnhighlight, draw, ensureStyle, enter, errorBell, event, forall, forceFloating, foreach, freezeChildNotify, freezeNotify, getv, grabAdd, grabDefault, grabFocus, grabRemove, hasDefault, hasFocus, hasGrab, hasRcStyle, hasScreen, hasVisibleFocus, hide, hideOnDelete, inDestruction, initTemplate, inputShapeCombineRegion, insertActionGroup, intersect, isAncestor, isComposited, isDrawable, isFloating, isFocus, isSensitive, isToplevel, isVisible, keynavFailed, leave, listAccelClosures, listActionPrefixes, listMnemonicLabels, map, mnemonicActivate, modifyBase, modifyBg, modifyCursor, modifyFg, modifyFont, modifyStyle, modifyText, notify, notifyByPspec, overrideBackgroundColor, overrideColor, overrideCursor, overrideFont, overrideSymbolicColor, parserFinished, path, pressed, propagateDraw, queueAllocate, queueComputeExpand, queueDraw, queueDrawArea, queueDrawRegion, queueResize, queueResizeNoRedraw, realize, ref, refSink, regionIntersect, registerWindow, released, remove, removeAccelerator, removeMnemonicLabel, removeTickCallback, renderIcon, renderIconPixbuf, reparent, resetRcStyles, resetStyle, resizeChildren, runDispose, sendExpose, sendFocusChange, shapeCombineRegion, show, showAll, showNow, sizeAllocate, sizeAllocateWithBaseline, sizeRequest, stealData, stealQdata, styleAttach, styleGetProperty, syncActionProperties, thawChildNotify, thawNotify, translateCoordinates, triggerTooltipQuery, unmap, unparent, unrealize, unref, unregisterWindow, unsetFocusChain, unsetStateFlags, watchClosure.
Getters
getAccessible, getActionGroup, getActionName, getActionTargetValue, getAlignment, getAllocatedBaseline, getAllocatedHeight, getAllocatedSize, getAllocatedWidth, getAllocation, getAlwaysShowImage, getAncestor, getAppPaintable, getBorderWidth, getCanDefault, getCanFocus, getChild, getChildRequisition, getChildVisible, getChildren, getClip, getClipboard, getCompositeName, getData, getDeviceEnabled, getDeviceEvents, getDirection, getDisplay, getDoubleBuffered, getEventWindow, getEvents, getFocusChain, getFocusChild, getFocusHadjustment, getFocusOnClick, getFocusVadjustment, getFont, getFontDesc, getFontFace, getFontFamily, getFontFeatures, getFontMap, getFontName, getFontOptions, getFontSize, getFrameClock, getHalign, getHasTooltip, getHasWindow, getHexpand, getHexpandSet, getImage, getImagePosition, getInternalChild, getLabel, getLanguage, getLevel, getMapped, getMarginBottom, getMarginEnd, getMarginLeft, getMarginRight, getMarginStart, getMarginTop, getModifierMask, getModifierStyle, getName, getNoShowAll, getOpacity, getPangoContext, getParent, getParentWindow, getPath, getPathForChild, getPointer, getPreferredHeight, getPreferredHeightAndBaselineForWidth, getPreferredHeightForWidth, getPreferredSize, getPreferredWidth, getPreferredWidthForHeight, getPreviewText, getProperty, getQdata, getRealized, getReceivesDefault, getRelatedAction, getRelief, getRequestMode, getRequisition, getResizeMode, getRootWindow, getScaleFactor, getScreen, getSensitive, getSettings, getShowPreviewEntry, getShowSize, getShowStyle, getSizeRequest, getState, getStateFlags, getStyle, getStyleContext, getSupportMultidevice, getTemplateChild, getTitle, getTooltipMarkup, getTooltipText, getTooltipWindow, getToplevel, getUseActionAppearance, getUseFont, getUseSize, getUseStock, getUseUnderline, getValign, getValignWithBaseline, getVexpand, getVexpandSet, getVisible, getVisual, getWindow.
Setters
setAccelPath, setActionName, setActionTargetValue, setAlignment, setAllocation, setAlwaysShowImage, setAppPaintable, setBorderWidth, setBuildableProperty, setCanDefault, setCanFocus, setChildVisible, setClip, setCompositeName, setData, setDataFull, setDetailedActionName, setDeviceEnabled, setDeviceEvents, setDirection, setDoubleBuffered, setEvents, setFilterFunc, setFocusChain, setFocusChild, setFocusHadjustment, setFocusOnClick, setFocusVadjustment, setFont, setFontDesc, setFontMap, setFontName, setFontOptions, setHalign, setHasTooltip, setHasWindow, setHexpand, setHexpandSet, setImage, setImagePosition, setLabel, setLanguage, setLevel, setMapped, setMarginBottom, setMarginEnd, setMarginLeft, setMarginRight, setMarginStart, setMarginTop, setName, setNoShowAll, setOpacity, setParent, setParentWindow, setPreviewText, setProperty, setRealized, setReallocateRedraws, setReceivesDefault, setRedrawOnAllocate, setRelatedAction, setRelief, setResizeMode, setSensitive, setShowPreviewEntry, setShowSize, setShowStyle, setSizeRequest, setState, setStateFlags, setStyle, setSupportMultidevice, setTitle, setTooltipMarkup, setTooltipText, setTooltipWindow, setUseActionAppearance, setUseFont, setUseSize, setUseStock, setUseUnderline, setValign, setVexpand, setVexpandSet, setVisible, setVisual, setWindow.
getFontName
fontButtonGetFontName Source #
:: (HasCallStack, MonadIO m, IsFontButton a) | |
=> a |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsFontButton a) | |
=> a |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsFontButton a) | |
=> a |
|
-> 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
:: (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.
Since: 2.4
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.
Since: 2.4
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.
Since: 2.4
new
:: (HasCallStack, MonadIO m) | |
=> m FontButton | Returns: a new font picker widget. |
Creates a new font picker widget.
Since: 2.4
newWithFont
fontButtonNewWithFont Source #
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m FontButton | Returns: a new font picker widget. |
Creates a new font picker widget.
Since: 2.4
setFontName
fontButtonSetFontName Source #
:: (HasCallStack, MonadIO m, IsFontButton a) | |
=> a |
|
-> Text |
|
-> m Bool | Returns: |
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 #
:: (HasCallStack, MonadIO m, IsFontButton a) | |
=> a |
|
-> Bool |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsFontButton a) | |
=> a |
|
-> Bool |
|
-> m () |
If showStyle
is True
, the font style will be displayed along with name of the selected font.
Since: 2.4
setTitle
:: (HasCallStack, MonadIO m, IsFontButton a) | |
=> a |
|
-> Text |
|
-> m () |
Sets the title for the font chooser dialog.
Since: 2.4
setUseFont
:: (HasCallStack, MonadIO m, IsFontButton a) | |
=> a |
|
-> Bool |
|
-> m () |
If useFont
is True
, the font name will be written using the selected font.
Since: 2.4
setUseSize
:: (HasCallStack, MonadIO m, IsFontButton a) | |
=> a |
|
-> Bool |
|
-> 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, MonadIO m) => Text -> m (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, MonadIO m) => Bool -> m (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, MonadIO m) => Bool -> m (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, MonadIO m) => Text -> m (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, MonadIO m) => Bool -> m (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, MonadIO m) => Bool -> m (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 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 notifyfont signal.
Since: 2.4
afterFontButtonFontSet :: (IsFontButton a, MonadIO m) => a -> ((?self :: 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
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onFontButtonFontSet :: (IsFontButton a, MonadIO m) => a -> ((?self :: 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