Copyright | Will Thompson, Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
Language | Haskell2010 |
- Exported types
- Methods
- getAngle
- getAttributes
- getCurrentUri
- getEllipsize
- getJustify
- getLabel
- getLayout
- getLayoutOffsets
- getLineWrap
- getLineWrapMode
- getLines
- getMaxWidthChars
- getMnemonicKeyval
- getMnemonicWidget
- getSelectable
- getSelectionBounds
- getSingleLineMode
- getText
- getTrackVisitedLinks
- getUseMarkup
- getUseUnderline
- getWidthChars
- getXalign
- getYalign
- new
- newWithMnemonic
- selectRegion
- setAngle
- setAttributes
- setEllipsize
- setJustify
- setLabel
- setLineWrap
- setLineWrapMode
- setLines
- setMarkup
- setMarkupWithMnemonic
- setMaxWidthChars
- setMnemonicWidget
- setPattern
- setSelectable
- setSingleLineMode
- setText
- setTextWithMnemonic
- setTrackVisitedLinks
- setUseMarkup
- setUseUnderline
- setWidthChars
- setXalign
- setYalign
- Properties
- Signals
The Label
widget displays a small amount of text. As the name
implies, most labels are used to label another widget such as a
Button
, a MenuItem
, or a ComboBox
.
CSS nodes
plain code
label ├── [selection] ├── [link] ┊ ╰── [link]
GtkLabel has a single CSS node with the name label. A wide variety
of style classes may be applied to labels, such as .title, .subtitle,
.dim-label, etc. In the ShortcutsWindow
, labels are used wth the
.keycap style class.
If the label has a selection, it gets a subnode with name selection.
If the label has links, there is one subnode per link. These subnodes carry the link or visited state depending on whether they have been visited.
GtkLabel as GtkBuildable
The GtkLabel implementation of the GtkBuildable interface supports a
custom <attributes> element, which supports any number of <attribute>
elements. The <attribute> element has attributes named “name“, “value“,
“start“ and “end“ and allows you to specify Attribute
values for
this label.
An example of a UI definition fragment specifying Pango attributes: > >class="GtkLabel" > attributes > name="weight" value="PANGO_WEIGHT_BOLD"/ > name="background" value="red" start="5" end="10"/" > /attributes >/object
The start and end attributes specify the range of characters to which the Pango attribute applies. If start and end are not specified, the attribute is applied to the whole text. Note that specifying ranges does not make much sense with translatable attributes. Use markup embedded in the translatable content instead.
Mnemonics
Labels may contain “mnemonics”. Mnemonics are
underlined characters in the label, used for keyboard navigation.
Mnemonics are created by providing a string with an underscore before
the mnemonic character, such as "_File"
, to the
functions labelNewWithMnemonic
or
labelSetTextWithMnemonic
.
Mnemonics automatically activate any activatable widget the label is
inside, such as a Button
; if the label is not inside the
mnemonic’s target widget, you have to tell the label about the target
using labelSetMnemonicWidget
. Here’s a simple example where
the label is inside a button:
C code
// Pressing Alt+H will activate this button button = gtk_button_new (); label = gtk_label_new_with_mnemonic ("_Hello"); gtk_container_add (GTK_CONTAINER (button), label);
There’s a convenience function to create buttons with a mnemonic label already inside:
C code
// Pressing Alt+H will activate this button button = gtk_button_new_with_mnemonic ("_Hello");
To create a mnemonic for a widget alongside the label, such as a
Entry
, you have to point the label at the entry with
labelSetMnemonicWidget
:
C code
// Pressing Alt+H will focus the entry entry = gtk_entry_new (); label = gtk_label_new_with_mnemonic ("_Hello"); gtk_label_set_mnemonic_widget (GTK_LABEL (label), entry);
Markup (styled text)
To make it easy to format text in a label (changing colors, fonts, etc.), label text can be provided in a simple [markup format][PangoMarkupFormat].
Here’s how to create a label with a small font:
C code
label = gtk_label_new (NULL); gtk_label_set_markup (GTK_LABEL (label), "<small>Small text</small>");
(See [complete documentation][PangoMarkupFormat] of available tags in the Pango manual.)
The markup passed to labelSetMarkup
must be valid; for example,
literal <, > and & characters must be escaped as <, >, and &.
If you pass text obtained from the user, file, or a network to
labelSetMarkup
, you’ll want to escape it with
markupEscapeText
or g_markup_printf_escaped()
.
Markup strings are just a convenient way to set the AttrList
on
a label; labelSetAttributes
may be a simpler way to set
attributes in some cases. Be careful though; AttrList
tends to
cause internationalization problems, unless you’re applying attributes
to the entire string (i.e. unless you set the range of each attribute
to [0, G_MAXINT
)). The reason is that specifying the start_index and
end_index for a Attribute
requires knowledge of the exact string
being displayed, so translations will cause problems.
Selectable labels
Labels can be made selectable with labelSetSelectable
.
Selectable labels allow the user to copy the label contents to
the clipboard. Only labels that contain useful-to-copy information
— such as error messages — should be made selectable.
A label can contain any number of paragraphs, but will have performance problems if it contains more than a small number. Paragraphs are separated by newlines or other paragraph separators understood by Pango.
Labels can automatically wrap text if you call
labelSetLineWrap
.
labelSetJustify
sets how the lines in a label align
with one another. If you want to set how the label as a whole
aligns in its available space, see the Widget
:halign
and
Widget
:valign
properties.
The Label
:width-chars
and Label
:max-width-chars
properties
can be used to control the size allocation of ellipsized or wrapped
labels. For ellipsizing labels, if either is specified (and less
than the actual text size), it is used as the minimum width, and the actual
text size is used as the natural width of the label. For wrapping labels,
width-chars is used as the minimum width, if specified, and max-width-chars
is used as the natural width. Even if max-width-chars specified, wrapping
labels will be rewrapped to use all of the available width.
Note that the interpretation of Label
:width-chars
and
Label
:max-width-chars
has changed a bit with the introduction of
[width-for-height geometry management.][geometry-management]
Links
Since 2.18, GTK+ supports markup for clickable hyperlinks in addition
to regular Pango markup. The markup for links is borrowed from HTML,
using the <a>
with “href“ and “title“ attributes. GTK+ renders links
similar to the way they appear in web browsers, with colored, underlined
text. The “title“ attribute is displayed as a tooltip on the link.
An example looks like this:
C code
const gchar *text = "Go to the" "<a href=\"http://www.gtk.org title="<i>Our</i> website\">" "GTK+ website</a> for more..."; gtk_label_set_markup (label, text);
It is possible to implement custom handling for links and their tooltips with
the Label
::activate-link
signal and the labelGetCurrentUri
function.
- newtype Label = Label (ManagedPtr Label)
- class GObject o => IsLabel o
- toLabel :: IsLabel o => o -> IO Label
- noLabel :: Maybe Label
- data LabelGetAngleMethodInfo
- labelGetAngle :: (HasCallStack, MonadIO m, IsLabel a) => a -> m Double
- data LabelGetAttributesMethodInfo
- labelGetAttributes :: (HasCallStack, MonadIO m, IsLabel a) => a -> m (Maybe AttrList)
- data LabelGetCurrentUriMethodInfo
- labelGetCurrentUri :: (HasCallStack, MonadIO m, IsLabel a) => a -> m Text
- data LabelGetEllipsizeMethodInfo
- labelGetEllipsize :: (HasCallStack, MonadIO m, IsLabel a) => a -> m EllipsizeMode
- data LabelGetJustifyMethodInfo
- labelGetJustify :: (HasCallStack, MonadIO m, IsLabel a) => a -> m Justification
- data LabelGetLabelMethodInfo
- labelGetLabel :: (HasCallStack, MonadIO m, IsLabel a) => a -> m Text
- data LabelGetLayoutMethodInfo
- labelGetLayout :: (HasCallStack, MonadIO m, IsLabel a) => a -> m Layout
- data LabelGetLayoutOffsetsMethodInfo
- labelGetLayoutOffsets :: (HasCallStack, MonadIO m, IsLabel a) => a -> m (Int32, Int32)
- data LabelGetLineWrapMethodInfo
- labelGetLineWrap :: (HasCallStack, MonadIO m, IsLabel a) => a -> m Bool
- data LabelGetLineWrapModeMethodInfo
- labelGetLineWrapMode :: (HasCallStack, MonadIO m, IsLabel a) => a -> m WrapMode
- data LabelGetLinesMethodInfo
- labelGetLines :: (HasCallStack, MonadIO m, IsLabel a) => a -> m Int32
- data LabelGetMaxWidthCharsMethodInfo
- labelGetMaxWidthChars :: (HasCallStack, MonadIO m, IsLabel a) => a -> m Int32
- data LabelGetMnemonicKeyvalMethodInfo
- labelGetMnemonicKeyval :: (HasCallStack, MonadIO m, IsLabel a) => a -> m Word32
- data LabelGetMnemonicWidgetMethodInfo
- labelGetMnemonicWidget :: (HasCallStack, MonadIO m, IsLabel a) => a -> m (Maybe Widget)
- data LabelGetSelectableMethodInfo
- labelGetSelectable :: (HasCallStack, MonadIO m, IsLabel a) => a -> m Bool
- data LabelGetSelectionBoundsMethodInfo
- labelGetSelectionBounds :: (HasCallStack, MonadIO m, IsLabel a) => a -> m (Bool, Int32, Int32)
- data LabelGetSingleLineModeMethodInfo
- labelGetSingleLineMode :: (HasCallStack, MonadIO m, IsLabel a) => a -> m Bool
- data LabelGetTextMethodInfo
- labelGetText :: (HasCallStack, MonadIO m, IsLabel a) => a -> m Text
- data LabelGetTrackVisitedLinksMethodInfo
- labelGetTrackVisitedLinks :: (HasCallStack, MonadIO m, IsLabel a) => a -> m Bool
- data LabelGetUseMarkupMethodInfo
- labelGetUseMarkup :: (HasCallStack, MonadIO m, IsLabel a) => a -> m Bool
- data LabelGetUseUnderlineMethodInfo
- labelGetUseUnderline :: (HasCallStack, MonadIO m, IsLabel a) => a -> m Bool
- data LabelGetWidthCharsMethodInfo
- labelGetWidthChars :: (HasCallStack, MonadIO m, IsLabel a) => a -> m Int32
- data LabelGetXalignMethodInfo
- labelGetXalign :: (HasCallStack, MonadIO m, IsLabel a) => a -> m Float
- data LabelGetYalignMethodInfo
- labelGetYalign :: (HasCallStack, MonadIO m, IsLabel a) => a -> m Float
- labelNew :: (HasCallStack, MonadIO m) => Maybe Text -> m Label
- labelNewWithMnemonic :: (HasCallStack, MonadIO m) => Maybe Text -> m Label
- data LabelSelectRegionMethodInfo
- labelSelectRegion :: (HasCallStack, MonadIO m, IsLabel a) => a -> Int32 -> Int32 -> m ()
- data LabelSetAngleMethodInfo
- labelSetAngle :: (HasCallStack, MonadIO m, IsLabel a) => a -> Double -> m ()
- data LabelSetAttributesMethodInfo
- labelSetAttributes :: (HasCallStack, MonadIO m, IsLabel a) => a -> Maybe AttrList -> m ()
- data LabelSetEllipsizeMethodInfo
- labelSetEllipsize :: (HasCallStack, MonadIO m, IsLabel a) => a -> EllipsizeMode -> m ()
- data LabelSetJustifyMethodInfo
- labelSetJustify :: (HasCallStack, MonadIO m, IsLabel a) => a -> Justification -> m ()
- data LabelSetLabelMethodInfo
- labelSetLabel :: (HasCallStack, MonadIO m, IsLabel a) => a -> Text -> m ()
- data LabelSetLineWrapMethodInfo
- labelSetLineWrap :: (HasCallStack, MonadIO m, IsLabel a) => a -> Bool -> m ()
- data LabelSetLineWrapModeMethodInfo
- labelSetLineWrapMode :: (HasCallStack, MonadIO m, IsLabel a) => a -> WrapMode -> m ()
- data LabelSetLinesMethodInfo
- labelSetLines :: (HasCallStack, MonadIO m, IsLabel a) => a -> Int32 -> m ()
- data LabelSetMarkupMethodInfo
- labelSetMarkup :: (HasCallStack, MonadIO m, IsLabel a) => a -> Text -> m ()
- data LabelSetMarkupWithMnemonicMethodInfo
- labelSetMarkupWithMnemonic :: (HasCallStack, MonadIO m, IsLabel a) => a -> Text -> m ()
- data LabelSetMaxWidthCharsMethodInfo
- labelSetMaxWidthChars :: (HasCallStack, MonadIO m, IsLabel a) => a -> Int32 -> m ()
- data LabelSetMnemonicWidgetMethodInfo
- labelSetMnemonicWidget :: (HasCallStack, MonadIO m, IsLabel a, IsWidget b) => a -> Maybe b -> m ()
- data LabelSetPatternMethodInfo
- labelSetPattern :: (HasCallStack, MonadIO m, IsLabel a) => a -> Text -> m ()
- data LabelSetSelectableMethodInfo
- labelSetSelectable :: (HasCallStack, MonadIO m, IsLabel a) => a -> Bool -> m ()
- data LabelSetSingleLineModeMethodInfo
- labelSetSingleLineMode :: (HasCallStack, MonadIO m, IsLabel a) => a -> Bool -> m ()
- data LabelSetTextMethodInfo
- labelSetText :: (HasCallStack, MonadIO m, IsLabel a) => a -> Text -> m ()
- data LabelSetTextWithMnemonicMethodInfo
- labelSetTextWithMnemonic :: (HasCallStack, MonadIO m, IsLabel a) => a -> Text -> m ()
- data LabelSetTrackVisitedLinksMethodInfo
- labelSetTrackVisitedLinks :: (HasCallStack, MonadIO m, IsLabel a) => a -> Bool -> m ()
- data LabelSetUseMarkupMethodInfo
- labelSetUseMarkup :: (HasCallStack, MonadIO m, IsLabel a) => a -> Bool -> m ()
- data LabelSetUseUnderlineMethodInfo
- labelSetUseUnderline :: (HasCallStack, MonadIO m, IsLabel a) => a -> Bool -> m ()
- data LabelSetWidthCharsMethodInfo
- labelSetWidthChars :: (HasCallStack, MonadIO m, IsLabel a) => a -> Int32 -> m ()
- data LabelSetXalignMethodInfo
- labelSetXalign :: (HasCallStack, MonadIO m, IsLabel a) => a -> Float -> m ()
- data LabelSetYalignMethodInfo
- labelSetYalign :: (HasCallStack, MonadIO m, IsLabel a) => a -> Float -> m ()
- data LabelAnglePropertyInfo
- constructLabelAngle :: IsLabel o => Double -> IO (GValueConstruct o)
- getLabelAngle :: (MonadIO m, IsLabel o) => o -> m Double
- labelAngle :: AttrLabelProxy "angle"
- setLabelAngle :: (MonadIO m, IsLabel o) => o -> Double -> m ()
- data LabelAttributesPropertyInfo
- clearLabelAttributes :: (MonadIO m, IsLabel o) => o -> m ()
- constructLabelAttributes :: IsLabel o => AttrList -> IO (GValueConstruct o)
- getLabelAttributes :: (MonadIO m, IsLabel o) => o -> m (Maybe AttrList)
- labelAttributes :: AttrLabelProxy "attributes"
- setLabelAttributes :: (MonadIO m, IsLabel o) => o -> AttrList -> m ()
- data LabelCursorPositionPropertyInfo
- getLabelCursorPosition :: (MonadIO m, IsLabel o) => o -> m Int32
- labelCursorPosition :: AttrLabelProxy "cursorPosition"
- data LabelEllipsizePropertyInfo
- constructLabelEllipsize :: IsLabel o => EllipsizeMode -> IO (GValueConstruct o)
- getLabelEllipsize :: (MonadIO m, IsLabel o) => o -> m EllipsizeMode
- labelEllipsize :: AttrLabelProxy "ellipsize"
- setLabelEllipsize :: (MonadIO m, IsLabel o) => o -> EllipsizeMode -> m ()
- data LabelJustifyPropertyInfo
- constructLabelJustify :: IsLabel o => Justification -> IO (GValueConstruct o)
- getLabelJustify :: (MonadIO m, IsLabel o) => o -> m Justification
- labelJustify :: AttrLabelProxy "justify"
- setLabelJustify :: (MonadIO m, IsLabel o) => o -> Justification -> m ()
- data LabelLabelPropertyInfo
- constructLabelLabel :: IsLabel o => Text -> IO (GValueConstruct o)
- getLabelLabel :: (MonadIO m, IsLabel o) => o -> m Text
- labelLabel :: AttrLabelProxy "label"
- setLabelLabel :: (MonadIO m, IsLabel o) => o -> Text -> m ()
- data LabelLinesPropertyInfo
- constructLabelLines :: IsLabel o => Int32 -> IO (GValueConstruct o)
- getLabelLines :: (MonadIO m, IsLabel o) => o -> m Int32
- labelLines :: AttrLabelProxy "lines"
- setLabelLines :: (MonadIO m, IsLabel o) => o -> Int32 -> m ()
- data LabelMaxWidthCharsPropertyInfo
- constructLabelMaxWidthChars :: IsLabel o => Int32 -> IO (GValueConstruct o)
- getLabelMaxWidthChars :: (MonadIO m, IsLabel o) => o -> m Int32
- labelMaxWidthChars :: AttrLabelProxy "maxWidthChars"
- setLabelMaxWidthChars :: (MonadIO m, IsLabel o) => o -> Int32 -> m ()
- data LabelMnemonicKeyvalPropertyInfo
- getLabelMnemonicKeyval :: (MonadIO m, IsLabel o) => o -> m Word32
- labelMnemonicKeyval :: AttrLabelProxy "mnemonicKeyval"
- data LabelMnemonicWidgetPropertyInfo
- clearLabelMnemonicWidget :: (MonadIO m, IsLabel o) => o -> m ()
- constructLabelMnemonicWidget :: (IsLabel o, IsWidget a) => a -> IO (GValueConstruct o)
- getLabelMnemonicWidget :: (MonadIO m, IsLabel o) => o -> m (Maybe Widget)
- labelMnemonicWidget :: AttrLabelProxy "mnemonicWidget"
- setLabelMnemonicWidget :: (MonadIO m, IsLabel o, IsWidget a) => o -> a -> m ()
- data LabelPatternPropertyInfo
- constructLabelPattern :: IsLabel o => Text -> IO (GValueConstruct o)
- labelPattern :: AttrLabelProxy "pattern"
- setLabelPattern :: (MonadIO m, IsLabel o) => o -> Text -> m ()
- data LabelSelectablePropertyInfo
- constructLabelSelectable :: IsLabel o => Bool -> IO (GValueConstruct o)
- getLabelSelectable :: (MonadIO m, IsLabel o) => o -> m Bool
- labelSelectable :: AttrLabelProxy "selectable"
- setLabelSelectable :: (MonadIO m, IsLabel o) => o -> Bool -> m ()
- data LabelSelectionBoundPropertyInfo
- getLabelSelectionBound :: (MonadIO m, IsLabel o) => o -> m Int32
- labelSelectionBound :: AttrLabelProxy "selectionBound"
- data LabelSingleLineModePropertyInfo
- constructLabelSingleLineMode :: IsLabel o => Bool -> IO (GValueConstruct o)
- getLabelSingleLineMode :: (MonadIO m, IsLabel o) => o -> m Bool
- labelSingleLineMode :: AttrLabelProxy "singleLineMode"
- setLabelSingleLineMode :: (MonadIO m, IsLabel o) => o -> Bool -> m ()
- data LabelTrackVisitedLinksPropertyInfo
- constructLabelTrackVisitedLinks :: IsLabel o => Bool -> IO (GValueConstruct o)
- getLabelTrackVisitedLinks :: (MonadIO m, IsLabel o) => o -> m Bool
- labelTrackVisitedLinks :: AttrLabelProxy "trackVisitedLinks"
- setLabelTrackVisitedLinks :: (MonadIO m, IsLabel o) => o -> Bool -> m ()
- data LabelUseMarkupPropertyInfo
- constructLabelUseMarkup :: IsLabel o => Bool -> IO (GValueConstruct o)
- getLabelUseMarkup :: (MonadIO m, IsLabel o) => o -> m Bool
- labelUseMarkup :: AttrLabelProxy "useMarkup"
- setLabelUseMarkup :: (MonadIO m, IsLabel o) => o -> Bool -> m ()
- data LabelUseUnderlinePropertyInfo
- constructLabelUseUnderline :: IsLabel o => Bool -> IO (GValueConstruct o)
- getLabelUseUnderline :: (MonadIO m, IsLabel o) => o -> m Bool
- labelUseUnderline :: AttrLabelProxy "useUnderline"
- setLabelUseUnderline :: (MonadIO m, IsLabel o) => o -> Bool -> m ()
- data LabelWidthCharsPropertyInfo
- constructLabelWidthChars :: IsLabel o => Int32 -> IO (GValueConstruct o)
- getLabelWidthChars :: (MonadIO m, IsLabel o) => o -> m Int32
- labelWidthChars :: AttrLabelProxy "widthChars"
- setLabelWidthChars :: (MonadIO m, IsLabel o) => o -> Int32 -> m ()
- data LabelWrapPropertyInfo
- constructLabelWrap :: IsLabel o => Bool -> IO (GValueConstruct o)
- getLabelWrap :: (MonadIO m, IsLabel o) => o -> m Bool
- labelWrap :: AttrLabelProxy "wrap"
- setLabelWrap :: (MonadIO m, IsLabel o) => o -> Bool -> m ()
- data LabelWrapModePropertyInfo
- constructLabelWrapMode :: IsLabel o => WrapMode -> IO (GValueConstruct o)
- getLabelWrapMode :: (MonadIO m, IsLabel o) => o -> m WrapMode
- labelWrapMode :: AttrLabelProxy "wrapMode"
- setLabelWrapMode :: (MonadIO m, IsLabel o) => o -> WrapMode -> m ()
- data LabelXalignPropertyInfo
- constructLabelXalign :: IsLabel o => Float -> IO (GValueConstruct o)
- getLabelXalign :: (MonadIO m, IsLabel o) => o -> m Float
- labelXalign :: AttrLabelProxy "xalign"
- setLabelXalign :: (MonadIO m, IsLabel o) => o -> Float -> m ()
- data LabelYalignPropertyInfo
- constructLabelYalign :: IsLabel o => Float -> IO (GValueConstruct o)
- getLabelYalign :: (MonadIO m, IsLabel o) => o -> m Float
- labelYalign :: AttrLabelProxy "yalign"
- setLabelYalign :: (MonadIO m, IsLabel o) => o -> Float -> m ()
- type C_LabelActivateCurrentLinkCallback = Ptr () -> Ptr () -> IO ()
- type LabelActivateCurrentLinkCallback = IO ()
- data LabelActivateCurrentLinkSignalInfo
- afterLabelActivateCurrentLink :: (GObject a, MonadIO m) => a -> LabelActivateCurrentLinkCallback -> m SignalHandlerId
- genClosure_LabelActivateCurrentLink :: LabelActivateCurrentLinkCallback -> IO Closure
- mk_LabelActivateCurrentLinkCallback :: C_LabelActivateCurrentLinkCallback -> IO (FunPtr C_LabelActivateCurrentLinkCallback)
- noLabelActivateCurrentLinkCallback :: Maybe LabelActivateCurrentLinkCallback
- onLabelActivateCurrentLink :: (GObject a, MonadIO m) => a -> LabelActivateCurrentLinkCallback -> m SignalHandlerId
- wrap_LabelActivateCurrentLinkCallback :: LabelActivateCurrentLinkCallback -> Ptr () -> Ptr () -> IO ()
- type C_LabelActivateLinkCallback = Ptr () -> CString -> Ptr () -> IO CInt
- type LabelActivateLinkCallback = Text -> IO Bool
- data LabelActivateLinkSignalInfo
- afterLabelActivateLink :: (GObject a, MonadIO m) => a -> LabelActivateLinkCallback -> m SignalHandlerId
- genClosure_LabelActivateLink :: LabelActivateLinkCallback -> IO Closure
- mk_LabelActivateLinkCallback :: C_LabelActivateLinkCallback -> IO (FunPtr C_LabelActivateLinkCallback)
- noLabelActivateLinkCallback :: Maybe LabelActivateLinkCallback
- onLabelActivateLink :: (GObject a, MonadIO m) => a -> LabelActivateLinkCallback -> m SignalHandlerId
- wrap_LabelActivateLinkCallback :: LabelActivateLinkCallback -> Ptr () -> CString -> Ptr () -> IO CInt
- type C_LabelCopyClipboardCallback = Ptr () -> Ptr () -> IO ()
- type LabelCopyClipboardCallback = IO ()
- data LabelCopyClipboardSignalInfo
- afterLabelCopyClipboard :: (GObject a, MonadIO m) => a -> LabelCopyClipboardCallback -> m SignalHandlerId
- genClosure_LabelCopyClipboard :: LabelCopyClipboardCallback -> IO Closure
- mk_LabelCopyClipboardCallback :: C_LabelCopyClipboardCallback -> IO (FunPtr C_LabelCopyClipboardCallback)
- noLabelCopyClipboardCallback :: Maybe LabelCopyClipboardCallback
- onLabelCopyClipboard :: (GObject a, MonadIO m) => a -> LabelCopyClipboardCallback -> m SignalHandlerId
- wrap_LabelCopyClipboardCallback :: LabelCopyClipboardCallback -> Ptr () -> Ptr () -> IO ()
- type C_LabelMoveCursorCallback = Ptr () -> CUInt -> Int32 -> CInt -> Ptr () -> IO ()
- type LabelMoveCursorCallback = MovementStep -> Int32 -> Bool -> IO ()
- data LabelMoveCursorSignalInfo
- afterLabelMoveCursor :: (GObject a, MonadIO m) => a -> LabelMoveCursorCallback -> m SignalHandlerId
- genClosure_LabelMoveCursor :: LabelMoveCursorCallback -> IO Closure
- mk_LabelMoveCursorCallback :: C_LabelMoveCursorCallback -> IO (FunPtr C_LabelMoveCursorCallback)
- noLabelMoveCursorCallback :: Maybe LabelMoveCursorCallback
- onLabelMoveCursor :: (GObject a, MonadIO m) => a -> LabelMoveCursorCallback -> m SignalHandlerId
- wrap_LabelMoveCursorCallback :: LabelMoveCursorCallback -> Ptr () -> CUInt -> Int32 -> CInt -> Ptr () -> IO ()
- type C_LabelPopulatePopupCallback = Ptr () -> Ptr Menu -> Ptr () -> IO ()
- type LabelPopulatePopupCallback = Menu -> IO ()
- data LabelPopulatePopupSignalInfo
- afterLabelPopulatePopup :: (GObject a, MonadIO m) => a -> LabelPopulatePopupCallback -> m SignalHandlerId
- genClosure_LabelPopulatePopup :: LabelPopulatePopupCallback -> IO Closure
- mk_LabelPopulatePopupCallback :: C_LabelPopulatePopupCallback -> IO (FunPtr C_LabelPopulatePopupCallback)
- noLabelPopulatePopupCallback :: Maybe LabelPopulatePopupCallback
- onLabelPopulatePopup :: (GObject a, MonadIO m) => a -> LabelPopulatePopupCallback -> m SignalHandlerId
- wrap_LabelPopulatePopupCallback :: LabelPopulatePopupCallback -> Ptr () -> Ptr Menu -> Ptr () -> IO ()
Exported types
GObject Label Source # | |
IsImplementorIface Label Source # | |
IsObject Label Source # | |
IsWidget Label Source # | |
IsMisc Label Source # | |
IsLabel Label Source # | |
IsBuildable Label Source # | |
((~) * info (ResolveLabelMethod t Label), MethodInfo * info Label p) => IsLabel t (Label -> p) Source # | |
((~) * info (ResolveLabelMethod t Label), MethodInfo * info Label p) => IsLabelProxy t (Label -> p) Source # | |
HasAttributeList * Label Source # | |
type AttributeList Label Source # | |
type SignalList Label Source # | |
class GObject o => IsLabel o Source #
(GObject a, UnknownAncestorError Constraint Label a) => IsLabel a Source # | |
IsLabel Label Source # | |
IsLabel AccelLabel Source # | |
Methods
getAngle
data LabelGetAngleMethodInfo Source #
((~) * signature (m Double), MonadIO m, IsLabel a) => MethodInfo * LabelGetAngleMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsLabel a) | |
=> a |
|
-> m Double | Returns: the angle of rotation for the label |
Gets the angle of rotation for the label. See
labelSetAngle
.
Since: 2.6
getAttributes
data LabelGetAttributesMethodInfo Source #
((~) * signature (m (Maybe AttrList)), MonadIO m, IsLabel a) => MethodInfo * LabelGetAttributesMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsLabel a) | |
=> a |
|
-> m (Maybe AttrList) | Returns: the attribute list, or |
Gets the attribute list that was set on the label using
labelSetAttributes
, if any. This function does
not reflect attributes that come from the labels markup
(see labelSetMarkup
). If you want to get the
effective attributes for the label, use
pango_layout_get_attribute (gtk_label_get_layout (label)).
getCurrentUri
data LabelGetCurrentUriMethodInfo Source #
((~) * signature (m Text), MonadIO m, IsLabel a) => MethodInfo * LabelGetCurrentUriMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsLabel a) | |
=> a |
|
-> m Text | Returns: the currently active URI. The string is owned by GTK+ and must not be freed or modified. |
Returns the URI for the currently active link in the label. The active link is the one under the mouse pointer or, in a selectable label, the link in which the text cursor is currently positioned.
This function is intended for use in a Label
::activate-link
handler
or for use in a Widget
::query-tooltip
handler.
Since: 2.18
getEllipsize
data LabelGetEllipsizeMethodInfo Source #
((~) * signature (m EllipsizeMode), MonadIO m, IsLabel a) => MethodInfo * LabelGetEllipsizeMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsLabel a) | |
=> a |
|
-> m EllipsizeMode | Returns: |
Returns the ellipsizing position of the label. See labelSetEllipsize
.
Since: 2.6
getJustify
data LabelGetJustifyMethodInfo Source #
((~) * signature (m Justification), MonadIO m, IsLabel a) => MethodInfo * LabelGetJustifyMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsLabel a) | |
=> a |
|
-> m Justification | Returns: |
Returns the justification of the label. See labelSetJustify
.
getLabel
data LabelGetLabelMethodInfo Source #
((~) * signature (m Text), MonadIO m, IsLabel a) => MethodInfo * LabelGetLabelMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsLabel a) | |
=> a |
|
-> m Text | Returns: the text of the label widget. This string is owned by the widget and must not be modified or freed. |
Fetches the text from a label widget including any embedded
underlines indicating mnemonics and Pango markup. (See
labelGetText
).
getLayout
data LabelGetLayoutMethodInfo Source #
((~) * signature (m Layout), MonadIO m, IsLabel a) => MethodInfo * LabelGetLayoutMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsLabel a) | |
=> a |
|
-> m Layout | Returns: the |
Gets the Layout
used to display the label.
The layout is useful to e.g. convert text positions to
pixel positions, in combination with labelGetLayoutOffsets
.
The returned layout is owned by the label
so need not be
freed by the caller. The label
is free to recreate its layout at
any time, so it should be considered read-only.
getLayoutOffsets
data LabelGetLayoutOffsetsMethodInfo Source #
((~) * signature (m (Int32, Int32)), MonadIO m, IsLabel a) => MethodInfo * LabelGetLayoutOffsetsMethodInfo a signature Source # | |
labelGetLayoutOffsets Source #
Obtains the coordinates where the label will draw the Layout
representing the text in the label; useful to convert mouse events
into coordinates inside the Layout
, e.g. to take some action
if some part of the label is clicked. Of course you will need to
create a EventBox
to receive the events, and pack the label
inside it, since labels are windowless (they return False
from
widgetGetHasWindow
). Remember
when using the Layout
functions you need to convert to
and from pixels using PANGO_PIXELS()
or SCALE
.
getLineWrap
data LabelGetLineWrapMethodInfo Source #
((~) * signature (m Bool), MonadIO m, IsLabel a) => MethodInfo * LabelGetLineWrapMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsLabel a) | |
=> a |
|
-> m Bool | Returns: |
Returns whether lines in the label are automatically wrapped.
See labelSetLineWrap
.
getLineWrapMode
data LabelGetLineWrapModeMethodInfo Source #
((~) * signature (m WrapMode), MonadIO m, IsLabel a) => MethodInfo * LabelGetLineWrapModeMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsLabel a) | |
=> a |
|
-> m WrapMode | Returns: |
Returns line wrap mode used by the label. See labelSetLineWrapMode
.
Since: 2.10
getLines
data LabelGetLinesMethodInfo Source #
((~) * signature (m Int32), MonadIO m, IsLabel a) => MethodInfo * LabelGetLinesMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsLabel a) | |
=> a |
|
-> m Int32 | Returns: The number of lines |
Gets the number of lines to which an ellipsized, wrapping
label should be limited. See labelSetLines
.
Since: 3.10
getMaxWidthChars
data LabelGetMaxWidthCharsMethodInfo Source #
((~) * signature (m Int32), MonadIO m, IsLabel a) => MethodInfo * LabelGetMaxWidthCharsMethodInfo a signature Source # | |
labelGetMaxWidthChars Source #
:: (HasCallStack, MonadIO m, IsLabel a) | |
=> a |
|
-> m Int32 | Returns: the maximum width of the label in characters. |
Retrieves the desired maximum width of label
, in characters. See
labelSetWidthChars
.
Since: 2.6
getMnemonicKeyval
data LabelGetMnemonicKeyvalMethodInfo Source #
((~) * signature (m Word32), MonadIO m, IsLabel a) => MethodInfo * LabelGetMnemonicKeyvalMethodInfo a signature Source # | |
labelGetMnemonicKeyval Source #
:: (HasCallStack, MonadIO m, IsLabel a) | |
=> a |
|
-> m Word32 | Returns: GDK keyval usable for accelerators, or |
If the label has been set so that it has an mnemonic key this function
returns the keyval used for the mnemonic accelerator. If there is no
mnemonic set up it returns KEY_VoidSymbol
.
getMnemonicWidget
data LabelGetMnemonicWidgetMethodInfo Source #
((~) * signature (m (Maybe Widget)), MonadIO m, IsLabel a) => MethodInfo * LabelGetMnemonicWidgetMethodInfo a signature Source # | |
labelGetMnemonicWidget Source #
:: (HasCallStack, MonadIO m, IsLabel a) | |
=> a |
|
-> m (Maybe Widget) | Returns: the target of the label’s mnemonic,
or |
Retrieves the target of the mnemonic (keyboard shortcut) of this
label. See labelSetMnemonicWidget
.
getSelectable
data LabelGetSelectableMethodInfo Source #
((~) * signature (m Bool), MonadIO m, IsLabel a) => MethodInfo * LabelGetSelectableMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsLabel a) | |
=> a |
|
-> m Bool | Returns: |
Gets the value set by labelSetSelectable
.
getSelectionBounds
labelGetSelectionBounds Source #
:: (HasCallStack, MonadIO m, IsLabel a) | |
=> a |
|
-> m (Bool, Int32, Int32) | Returns: |
Gets the selected range of characters in the label, returning True
if there’s a selection.
getSingleLineMode
data LabelGetSingleLineModeMethodInfo Source #
((~) * signature (m Bool), MonadIO m, IsLabel a) => MethodInfo * LabelGetSingleLineModeMethodInfo a signature Source # | |
labelGetSingleLineMode Source #
:: (HasCallStack, MonadIO m, IsLabel a) | |
=> a |
|
-> m Bool | Returns: |
Returns whether the label is in single line mode.
Since: 2.6
getText
data LabelGetTextMethodInfo Source #
((~) * signature (m Text), MonadIO m, IsLabel a) => MethodInfo * LabelGetTextMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsLabel a) | |
=> a |
|
-> m Text | Returns: the text in the label widget. This is the internal string used by the label, and must not be modified. |
Fetches the text from a label widget, as displayed on the
screen. This does not include any embedded underlines
indicating mnemonics or Pango markup. (See labelGetLabel
)
getTrackVisitedLinks
data LabelGetTrackVisitedLinksMethodInfo Source #
((~) * signature (m Bool), MonadIO m, IsLabel a) => MethodInfo * LabelGetTrackVisitedLinksMethodInfo a signature Source # | |
labelGetTrackVisitedLinks Source #
:: (HasCallStack, MonadIO m, IsLabel a) | |
=> a |
|
-> m Bool | Returns: |
Returns whether the label is currently keeping track of clicked links.
Since: 2.18
getUseMarkup
data LabelGetUseMarkupMethodInfo Source #
((~) * signature (m Bool), MonadIO m, IsLabel a) => MethodInfo * LabelGetUseMarkupMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsLabel a) | |
=> a |
|
-> m Bool | Returns: |
Returns whether the label’s text is interpreted as marked up with the [Pango text markup language][PangoMarkupFormat]. See gtk_label_set_use_markup ().
getUseUnderline
data LabelGetUseUnderlineMethodInfo Source #
((~) * signature (m Bool), MonadIO m, IsLabel a) => MethodInfo * LabelGetUseUnderlineMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsLabel a) | |
=> a |
|
-> m Bool | Returns: |
Returns whether an embedded underline in the label indicates a
mnemonic. See labelSetUseUnderline
.
getWidthChars
data LabelGetWidthCharsMethodInfo Source #
((~) * signature (m Int32), MonadIO m, IsLabel a) => MethodInfo * LabelGetWidthCharsMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsLabel a) | |
=> a |
|
-> m Int32 | Returns: the width of the label in characters. |
Retrieves the desired width of label
, in characters. See
labelSetWidthChars
.
Since: 2.6
getXalign
data LabelGetXalignMethodInfo Source #
((~) * signature (m Float), MonadIO m, IsLabel a) => MethodInfo * LabelGetXalignMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsLabel a) | |
=> a |
|
-> m Float | Returns: the xalign property |
Gets the Label
:xalign
property for label
.
Since: 3.16
getYalign
data LabelGetYalignMethodInfo Source #
((~) * signature (m Float), MonadIO m, IsLabel a) => MethodInfo * LabelGetYalignMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsLabel a) | |
=> a |
|
-> m Float | Returns: the yalign property |
Gets the Label
:yalign
property for label
.
Since: 3.16
new
:: (HasCallStack, MonadIO m) | |
=> Maybe Text |
|
-> m Label | Returns: the new |
Creates a new label with the given text inside it. You can
pass Nothing
to get an empty label widget.
newWithMnemonic
:: (HasCallStack, MonadIO m) | |
=> Maybe Text |
|
-> m Label | Returns: the new |
Creates a new Label
, containing the text in str
.
If characters in str
are preceded by an underscore, they are
underlined. If you need a literal underscore character in a label, use
'__' (two underscores). The first underlined character represents a
keyboard accelerator called a mnemonic. The mnemonic key can be used
to activate another widget, chosen automatically, or explicitly using
labelSetMnemonicWidget
.
If labelSetMnemonicWidget
is not called, then the first
activatable ancestor of the Label
will be chosen as the mnemonic
widget. For instance, if the label is inside a button or menu item,
the button or menu item will automatically become the mnemonic widget
and be activated by the mnemonic.
selectRegion
data LabelSelectRegionMethodInfo Source #
((~) * signature (Int32 -> Int32 -> m ()), MonadIO m, IsLabel a) => MethodInfo * LabelSelectRegionMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsLabel a) | |
=> a |
|
-> Int32 |
|
-> Int32 |
|
-> m () |
Selects a range of characters in the label, if the label is selectable.
See labelSetSelectable
. If the label is not selectable,
this function has no effect. If startOffset
or
endOffset
are -1, then the end of the label will be substituted.
setAngle
data LabelSetAngleMethodInfo Source #
((~) * signature (Double -> m ()), MonadIO m, IsLabel a) => MethodInfo * LabelSetAngleMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsLabel a) | |
=> a |
|
-> Double |
|
-> m () |
Sets the angle of rotation for the label. An angle of 90 reads from from bottom to top, an angle of 270, from top to bottom. The angle setting for the label is ignored if the label is selectable, wrapped, or ellipsized.
Since: 2.6
setAttributes
data LabelSetAttributesMethodInfo Source #
((~) * signature (Maybe AttrList -> m ()), MonadIO m, IsLabel a) => MethodInfo * LabelSetAttributesMethodInfo a signature Source # | |
Sets a AttrList
; the attributes in the list are applied to the
label text.
The attributes set with this function will be applied
and merged with any other attributes previously effected by way
of the Label
:use-underline
or Label
:use-markup
properties.
While it is not recommended to mix markup strings with manually set
attributes, if you must; know that the attributes will be applied
to the label after the markup string is parsed.
setEllipsize
data LabelSetEllipsizeMethodInfo Source #
((~) * signature (EllipsizeMode -> m ()), MonadIO m, IsLabel a) => MethodInfo * LabelSetEllipsizeMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsLabel a) | |
=> a |
|
-> EllipsizeMode |
|
-> m () |
Sets the mode used to ellipsize (add an ellipsis: "...") to the text if there is not enough space to render the entire string.
Since: 2.6
setJustify
data LabelSetJustifyMethodInfo Source #
((~) * signature (Justification -> m ()), MonadIO m, IsLabel a) => MethodInfo * LabelSetJustifyMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsLabel a) | |
=> a |
|
-> Justification |
|
-> m () |
Sets the alignment of the lines in the text of the label relative to
each other. JustificationLeft
is the default value when the widget is
first created with labelNew
. If you instead want to set the
alignment of the label as a whole, use widgetSetHalign
instead.
labelSetJustify
has no effect on labels containing only a
single line.
setLabel
data LabelSetLabelMethodInfo Source #
((~) * signature (Text -> m ()), MonadIO m, IsLabel a) => MethodInfo * LabelSetLabelMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsLabel a) | |
=> a |
|
-> Text |
|
-> m () |
setLineWrap
data LabelSetLineWrapMethodInfo Source #
((~) * signature (Bool -> m ()), MonadIO m, IsLabel a) => MethodInfo * LabelSetLineWrapMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsLabel a) | |
=> a |
|
-> Bool |
|
-> m () |
Toggles line wrapping within the Label
widget. True
makes it break
lines if text exceeds the widget’s size. False
lets the text get cut off
by the edge of the widget if it exceeds the widget size.
Note that setting line wrapping to True
does not make the label
wrap at its parent container’s width, because GTK+ widgets
conceptually can’t make their requisition depend on the parent
container’s size. For a label that wraps at a specific position,
set the label’s width using widgetSetSizeRequest
.
setLineWrapMode
data LabelSetLineWrapModeMethodInfo Source #
((~) * signature (WrapMode -> m ()), MonadIO m, IsLabel a) => MethodInfo * LabelSetLineWrapModeMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsLabel a) | |
=> a |
|
-> WrapMode |
|
-> m () |
If line wrapping is on (see labelSetLineWrap
) this controls how
the line wrapping is done. The default is WrapModeWord
which means
wrap on word boundaries.
Since: 2.10
setLines
data LabelSetLinesMethodInfo Source #
((~) * signature (Int32 -> m ()), MonadIO m, IsLabel a) => MethodInfo * LabelSetLinesMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsLabel a) | |
=> a |
|
-> Int32 |
|
-> m () |
Sets the number of lines to which an ellipsized, wrapping label should be limited. This has no effect if the label is not wrapping or ellipsized. Set this to -1 if you don’t want to limit the number of lines.
Since: 3.10
setMarkup
data LabelSetMarkupMethodInfo Source #
((~) * signature (Text -> m ()), MonadIO m, IsLabel a) => MethodInfo * LabelSetMarkupMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsLabel a) | |
=> a |
|
-> Text |
|
-> m () |
Parses str
which is marked up with the
[Pango text markup language][PangoMarkupFormat], setting the
label’s text and attribute list based on the parse results.
If the str
is external data, you may need to escape it with
markupEscapeText
or g_markup_printf_escaped()
:
C code
const char *format = "<span style=\"italic\">\%s</span>"; char *markup; markup = g_markup_printf_escaped (format, str); gtk_label_set_markup (GTK_LABEL (label), markup); g_free (markup);
This function will set the Label
:use-markup
property to True
as
a side effect.
If you set the label contents using the Label
:label
property you
should also ensure that you set the Label
:use-markup
property
accordingly.
See also: labelSetText
setMarkupWithMnemonic
data LabelSetMarkupWithMnemonicMethodInfo Source #
((~) * signature (Text -> m ()), MonadIO m, IsLabel a) => MethodInfo * LabelSetMarkupWithMnemonicMethodInfo a signature Source # | |
labelSetMarkupWithMnemonic Source #
:: (HasCallStack, MonadIO m, IsLabel a) | |
=> a |
|
-> Text |
|
-> m () |
Parses str
which is marked up with the
[Pango text markup language][PangoMarkupFormat],
setting the label’s text and attribute list based on the parse results.
If characters in str
are preceded by an underscore, they are underlined
indicating that they represent a keyboard accelerator called a mnemonic.
The mnemonic key can be used to activate another widget, chosen
automatically, or explicitly using labelSetMnemonicWidget
.
setMaxWidthChars
data LabelSetMaxWidthCharsMethodInfo Source #
((~) * signature (Int32 -> m ()), MonadIO m, IsLabel a) => MethodInfo * LabelSetMaxWidthCharsMethodInfo a signature Source # | |
labelSetMaxWidthChars Source #
:: (HasCallStack, MonadIO m, IsLabel a) | |
=> a |
|
-> Int32 |
|
-> m () |
Sets the desired maximum width in characters of label
to nChars
.
Since: 2.6
setMnemonicWidget
data LabelSetMnemonicWidgetMethodInfo Source #
((~) * signature (Maybe b -> m ()), MonadIO m, IsLabel a, IsWidget b) => MethodInfo * LabelSetMnemonicWidgetMethodInfo a signature Source # | |
labelSetMnemonicWidget Source #
:: (HasCallStack, MonadIO m, IsLabel a, IsWidget b) | |
=> a |
|
-> Maybe b |
|
-> m () |
If the label has been set so that it has an mnemonic key (using
i.e. labelSetMarkupWithMnemonic
,
labelSetTextWithMnemonic
, labelNewWithMnemonic
or the “use_underline” property) the label can be associated with a
widget that is the target of the mnemonic. When the label is inside
a widget (like a Button
or a Notebook
tab) it is
automatically associated with the correct widget, but sometimes
(i.e. when the target is a Entry
next to the label) you need to
set it explicitly using this function.
The target widget will be accelerated by emitting the GtkWidget::mnemonic-activate signal on it. The default handler for this signal will activate the widget if there are no mnemonic collisions and toggle focus between the colliding widgets otherwise.
setPattern
data LabelSetPatternMethodInfo Source #
((~) * signature (Text -> m ()), MonadIO m, IsLabel a) => MethodInfo * LabelSetPatternMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsLabel a) | |
=> a |
|
-> Text |
|
-> m () |
The pattern of underlines you want under the existing text within the
Label
widget. For example if the current text of the label says
“FooBarBaz” passing a pattern of “_ _” will underline
“Foo” and “Baz” but not “Bar”.
setSelectable
data LabelSetSelectableMethodInfo Source #
((~) * signature (Bool -> m ()), MonadIO m, IsLabel a) => MethodInfo * LabelSetSelectableMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsLabel a) | |
=> a |
|
-> Bool |
|
-> m () |
Selectable labels allow the user to select text from the label, for copy-and-paste.
setSingleLineMode
data LabelSetSingleLineModeMethodInfo Source #
((~) * signature (Bool -> m ()), MonadIO m, IsLabel a) => MethodInfo * LabelSetSingleLineModeMethodInfo a signature Source # | |
labelSetSingleLineMode Source #
:: (HasCallStack, MonadIO m, IsLabel a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets whether the label is in single line mode.
Since: 2.6
setText
data LabelSetTextMethodInfo Source #
((~) * signature (Text -> m ()), MonadIO m, IsLabel a) => MethodInfo * LabelSetTextMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsLabel a) | |
=> a |
|
-> Text |
|
-> m () |
Sets the text within the Label
widget. It overwrites any text that
was there before.
This function will clear any previously set mnemonic accelerators, and
set the Label
:use-underline
property to False
as a side effect.
This function will set the Label
:use-markup
property to False
as a side effect.
See also: labelSetMarkup
setTextWithMnemonic
data LabelSetTextWithMnemonicMethodInfo Source #
((~) * signature (Text -> m ()), MonadIO m, IsLabel a) => MethodInfo * LabelSetTextWithMnemonicMethodInfo a signature Source # | |
labelSetTextWithMnemonic Source #
:: (HasCallStack, MonadIO m, IsLabel a) | |
=> a |
|
-> Text |
|
-> m () |
Sets the label’s text from the string str
.
If characters in str
are preceded by an underscore, they are underlined
indicating that they represent a keyboard accelerator called a mnemonic.
The mnemonic key can be used to activate another widget, chosen
automatically, or explicitly using labelSetMnemonicWidget
.
setTrackVisitedLinks
data LabelSetTrackVisitedLinksMethodInfo Source #
((~) * signature (Bool -> m ()), MonadIO m, IsLabel a) => MethodInfo * LabelSetTrackVisitedLinksMethodInfo a signature Source # | |
labelSetTrackVisitedLinks Source #
:: (HasCallStack, MonadIO m, IsLabel a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets whether the label should keep track of clicked links (and use a different color for them).
Since: 2.18
setUseMarkup
data LabelSetUseMarkupMethodInfo Source #
((~) * signature (Bool -> m ()), MonadIO m, IsLabel a) => MethodInfo * LabelSetUseMarkupMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsLabel a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets whether the text of the label contains markup in
[Pango’s text markup language][PangoMarkupFormat].
See labelSetMarkup
.
setUseUnderline
data LabelSetUseUnderlineMethodInfo Source #
((~) * signature (Bool -> m ()), MonadIO m, IsLabel a) => MethodInfo * LabelSetUseUnderlineMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsLabel a) | |
=> a |
|
-> Bool |
|
-> m () |
If true, an underline in the text indicates the next character should be used for the mnemonic accelerator key.
setWidthChars
data LabelSetWidthCharsMethodInfo Source #
((~) * signature (Int32 -> m ()), MonadIO m, IsLabel a) => MethodInfo * LabelSetWidthCharsMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsLabel a) | |
=> a |
|
-> Int32 |
|
-> m () |
Sets the desired width in characters of label
to nChars
.
Since: 2.6
setXalign
data LabelSetXalignMethodInfo Source #
((~) * signature (Float -> m ()), MonadIO m, IsLabel a) => MethodInfo * LabelSetXalignMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsLabel a) | |
=> a |
|
-> Float |
|
-> m () |
Sets the Label
:xalign
property for label
.
Since: 3.16
setYalign
data LabelSetYalignMethodInfo Source #
((~) * signature (Float -> m ()), MonadIO m, IsLabel a) => MethodInfo * LabelSetYalignMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsLabel a) | |
=> a |
|
-> Float |
|
-> m () |
Sets the Label
:yalign
property for label
.
Since: 3.16
Properties
angle
data LabelAnglePropertyInfo Source #
constructLabelAngle :: IsLabel o => Double -> IO (GValueConstruct o) Source #
labelAngle :: AttrLabelProxy "angle" Source #
attributes
data LabelAttributesPropertyInfo Source #
clearLabelAttributes :: (MonadIO m, IsLabel o) => o -> m () Source #
constructLabelAttributes :: IsLabel o => AttrList -> IO (GValueConstruct o) Source #
labelAttributes :: AttrLabelProxy "attributes" Source #
cursorPosition
data LabelCursorPositionPropertyInfo Source #
labelCursorPosition :: AttrLabelProxy "cursorPosition" Source #
ellipsize
data LabelEllipsizePropertyInfo Source #
constructLabelEllipsize :: IsLabel o => EllipsizeMode -> IO (GValueConstruct o) Source #
getLabelEllipsize :: (MonadIO m, IsLabel o) => o -> m EllipsizeMode Source #
labelEllipsize :: AttrLabelProxy "ellipsize" Source #
setLabelEllipsize :: (MonadIO m, IsLabel o) => o -> EllipsizeMode -> m () Source #
justify
data LabelJustifyPropertyInfo Source #
constructLabelJustify :: IsLabel o => Justification -> IO (GValueConstruct o) Source #
getLabelJustify :: (MonadIO m, IsLabel o) => o -> m Justification Source #
labelJustify :: AttrLabelProxy "justify" Source #
setLabelJustify :: (MonadIO m, IsLabel o) => o -> Justification -> m () Source #
label
data LabelLabelPropertyInfo Source #
constructLabelLabel :: IsLabel o => Text -> IO (GValueConstruct o) Source #
labelLabel :: AttrLabelProxy "label" Source #
lines
data LabelLinesPropertyInfo Source #
constructLabelLines :: IsLabel o => Int32 -> IO (GValueConstruct o) Source #
labelLines :: AttrLabelProxy "lines" Source #
maxWidthChars
data LabelMaxWidthCharsPropertyInfo Source #
constructLabelMaxWidthChars :: IsLabel o => Int32 -> IO (GValueConstruct o) Source #
labelMaxWidthChars :: AttrLabelProxy "maxWidthChars" Source #
mnemonicKeyval
data LabelMnemonicKeyvalPropertyInfo Source #
labelMnemonicKeyval :: AttrLabelProxy "mnemonicKeyval" Source #
mnemonicWidget
data LabelMnemonicWidgetPropertyInfo Source #
clearLabelMnemonicWidget :: (MonadIO m, IsLabel o) => o -> m () Source #
constructLabelMnemonicWidget :: (IsLabel o, IsWidget a) => a -> IO (GValueConstruct o) Source #
labelMnemonicWidget :: AttrLabelProxy "mnemonicWidget" Source #
pattern
data LabelPatternPropertyInfo Source #
constructLabelPattern :: IsLabel o => Text -> IO (GValueConstruct o) Source #
labelPattern :: AttrLabelProxy "pattern" Source #
selectable
data LabelSelectablePropertyInfo Source #
constructLabelSelectable :: IsLabel o => Bool -> IO (GValueConstruct o) Source #
labelSelectable :: AttrLabelProxy "selectable" Source #
selectionBound
data LabelSelectionBoundPropertyInfo Source #
labelSelectionBound :: AttrLabelProxy "selectionBound" Source #
singleLineMode
data LabelSingleLineModePropertyInfo Source #
constructLabelSingleLineMode :: IsLabel o => Bool -> IO (GValueConstruct o) Source #
labelSingleLineMode :: AttrLabelProxy "singleLineMode" Source #
trackVisitedLinks
data LabelTrackVisitedLinksPropertyInfo Source #
constructLabelTrackVisitedLinks :: IsLabel o => Bool -> IO (GValueConstruct o) Source #
labelTrackVisitedLinks :: AttrLabelProxy "trackVisitedLinks" Source #
useMarkup
data LabelUseMarkupPropertyInfo Source #
constructLabelUseMarkup :: IsLabel o => Bool -> IO (GValueConstruct o) Source #
labelUseMarkup :: AttrLabelProxy "useMarkup" Source #
useUnderline
data LabelUseUnderlinePropertyInfo Source #
constructLabelUseUnderline :: IsLabel o => Bool -> IO (GValueConstruct o) Source #
labelUseUnderline :: AttrLabelProxy "useUnderline" Source #
widthChars
data LabelWidthCharsPropertyInfo Source #
constructLabelWidthChars :: IsLabel o => Int32 -> IO (GValueConstruct o) Source #
labelWidthChars :: AttrLabelProxy "widthChars" Source #
wrap
data LabelWrapPropertyInfo Source #
constructLabelWrap :: IsLabel o => Bool -> IO (GValueConstruct o) Source #
labelWrap :: AttrLabelProxy "wrap" Source #
wrapMode
data LabelWrapModePropertyInfo Source #
constructLabelWrapMode :: IsLabel o => WrapMode -> IO (GValueConstruct o) Source #
labelWrapMode :: AttrLabelProxy "wrapMode" Source #
xalign
data LabelXalignPropertyInfo Source #
constructLabelXalign :: IsLabel o => Float -> IO (GValueConstruct o) Source #
labelXalign :: AttrLabelProxy "xalign" Source #
yalign
data LabelYalignPropertyInfo Source #
constructLabelYalign :: IsLabel o => Float -> IO (GValueConstruct o) Source #
labelYalign :: AttrLabelProxy "yalign" Source #
Signals
activateCurrentLink
type LabelActivateCurrentLinkCallback = IO () Source #
afterLabelActivateCurrentLink :: (GObject a, MonadIO m) => a -> LabelActivateCurrentLinkCallback -> m SignalHandlerId Source #
mk_LabelActivateCurrentLinkCallback :: C_LabelActivateCurrentLinkCallback -> IO (FunPtr C_LabelActivateCurrentLinkCallback) Source #
onLabelActivateCurrentLink :: (GObject a, MonadIO m) => a -> LabelActivateCurrentLinkCallback -> m SignalHandlerId Source #
wrap_LabelActivateCurrentLinkCallback :: LabelActivateCurrentLinkCallback -> Ptr () -> Ptr () -> IO () Source #
activateLink
afterLabelActivateLink :: (GObject a, MonadIO m) => a -> LabelActivateLinkCallback -> m SignalHandlerId Source #
mk_LabelActivateLinkCallback :: C_LabelActivateLinkCallback -> IO (FunPtr C_LabelActivateLinkCallback) Source #
onLabelActivateLink :: (GObject a, MonadIO m) => a -> LabelActivateLinkCallback -> m SignalHandlerId Source #
wrap_LabelActivateLinkCallback :: LabelActivateLinkCallback -> Ptr () -> CString -> Ptr () -> IO CInt Source #
copyClipboard
type LabelCopyClipboardCallback = IO () Source #
afterLabelCopyClipboard :: (GObject a, MonadIO m) => a -> LabelCopyClipboardCallback -> m SignalHandlerId Source #
mk_LabelCopyClipboardCallback :: C_LabelCopyClipboardCallback -> IO (FunPtr C_LabelCopyClipboardCallback) Source #
onLabelCopyClipboard :: (GObject a, MonadIO m) => a -> LabelCopyClipboardCallback -> m SignalHandlerId Source #
wrap_LabelCopyClipboardCallback :: LabelCopyClipboardCallback -> Ptr () -> Ptr () -> IO () Source #
moveCursor
type LabelMoveCursorCallback = MovementStep -> Int32 -> Bool -> IO () Source #
afterLabelMoveCursor :: (GObject a, MonadIO m) => a -> LabelMoveCursorCallback -> m SignalHandlerId Source #
mk_LabelMoveCursorCallback :: C_LabelMoveCursorCallback -> IO (FunPtr C_LabelMoveCursorCallback) Source #
onLabelMoveCursor :: (GObject a, MonadIO m) => a -> LabelMoveCursorCallback -> m SignalHandlerId Source #
wrap_LabelMoveCursorCallback :: LabelMoveCursorCallback -> Ptr () -> CUInt -> Int32 -> CInt -> Ptr () -> IO () Source #
populatePopup
type LabelPopulatePopupCallback = Menu -> IO () Source #
afterLabelPopulatePopup :: (GObject a, MonadIO m) => a -> LabelPopulatePopupCallback -> m SignalHandlerId Source #
mk_LabelPopulatePopupCallback :: C_LabelPopulatePopupCallback -> IO (FunPtr C_LabelPopulatePopupCallback) Source #
onLabelPopulatePopup :: (GObject a, MonadIO m) => a -> LabelPopulatePopupCallback -> m SignalHandlerId Source #
wrap_LabelPopulatePopupCallback :: LabelPopulatePopupCallback -> Ptr () -> Ptr Menu -> Ptr () -> IO () Source #