gi-gtk-3.0.11: Gtk bindings

CopyrightWill Thompson, Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (garetxe@gmail.com)
Safe HaskellNone
LanguageHaskell2010

GI.Gtk.Objects.Label

Contents

Description

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 &lt;, &gt;, and &amp;. 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.

{label-text-layout}

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="&lt;i&gt;Our&lt;/i&gt; 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.

Synopsis

Exported types

newtype Label Source #

Constructors

Label (ManagedPtr Label) 

Instances

Methods

getAngle

data LabelGetAngleMethodInfo Source #

Instances

((~) * signature (m Double), MonadIO m, IsLabel a) => MethodInfo * LabelGetAngleMethodInfo a signature Source # 

labelGetAngle Source #

Arguments

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

label: a Label

-> m Double

Returns: the angle of rotation for the label

Gets the angle of rotation for the label. See labelSetAngle.

Since: 2.6

getAttributes

labelGetAttributes Source #

Arguments

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

label: a Label

-> m (Maybe AttrList)

Returns: the attribute list, or Nothing if none was set.

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

labelGetCurrentUri Source #

Arguments

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

label: a Label

-> 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

labelGetEllipsize Source #

Arguments

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

label: a Label

-> m EllipsizeMode

Returns: EllipsizeMode

Returns the ellipsizing position of the label. See labelSetEllipsize.

Since: 2.6

getJustify

labelGetJustify Source #

Arguments

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

label: a Label

-> m Justification

Returns: Justification

Returns the justification of the label. See labelSetJustify.

getLabel

data LabelGetLabelMethodInfo Source #

Instances

((~) * signature (m Text), MonadIO m, IsLabel a) => MethodInfo * LabelGetLabelMethodInfo a signature Source # 

labelGetLabel Source #

Arguments

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

label: a Label

-> 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 #

Instances

((~) * signature (m Layout), MonadIO m, IsLabel a) => MethodInfo * LabelGetLayoutMethodInfo a signature Source # 

labelGetLayout Source #

Arguments

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

label: a Label

-> m Layout

Returns: the Layout for this label

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

labelGetLayoutOffsets Source #

Arguments

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

label: a Label

-> m (Int32, Int32) 

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 #

Instances

((~) * signature (m Bool), MonadIO m, IsLabel a) => MethodInfo * LabelGetLineWrapMethodInfo a signature Source # 

labelGetLineWrap Source #

Arguments

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

label: a Label

-> m Bool

Returns: True if the lines of the label are automatically wrapped.

Returns whether lines in the label are automatically wrapped. See labelSetLineWrap.

getLineWrapMode

labelGetLineWrapMode Source #

Arguments

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

label: a Label

-> m WrapMode

Returns: True if the lines of the label are automatically wrapped.

Returns line wrap mode used by the label. See labelSetLineWrapMode.

Since: 2.10

getLines

data LabelGetLinesMethodInfo Source #

Instances

((~) * signature (m Int32), MonadIO m, IsLabel a) => MethodInfo * LabelGetLinesMethodInfo a signature Source # 

labelGetLines Source #

Arguments

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

label: a Label

-> 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

labelGetMaxWidthChars Source #

Arguments

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

label: a Label

-> 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

labelGetMnemonicKeyval Source #

Arguments

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

label: a Label

-> m Word32

Returns: GDK keyval usable for accelerators, or KEY_VoidSymbol

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

labelGetMnemonicWidget Source #

Arguments

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

label: a Label

-> m (Maybe Widget)

Returns: the target of the label’s mnemonic, or Nothing if none has been set and the default algorithm will be used.

Retrieves the target of the mnemonic (keyboard shortcut) of this label. See labelSetMnemonicWidget.

getSelectable

labelGetSelectable Source #

Arguments

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

label: a Label

-> m Bool

Returns: True if the user can copy text from the label

Gets the value set by labelSetSelectable.

getSelectionBounds

labelGetSelectionBounds Source #

Arguments

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

label: a Label

-> m (Bool, Int32, Int32)

Returns: True if selection is non-empty

Gets the selected range of characters in the label, returning True if there’s a selection.

getSingleLineMode

labelGetSingleLineMode Source #

Arguments

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

label: a Label

-> m Bool

Returns: True when the label is in single line mode.

Returns whether the label is in single line mode.

Since: 2.6

getText

data LabelGetTextMethodInfo Source #

Instances

((~) * signature (m Text), MonadIO m, IsLabel a) => MethodInfo * LabelGetTextMethodInfo a signature Source # 

labelGetText Source #

Arguments

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

label: a Label

-> 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

labelGetTrackVisitedLinks Source #

Arguments

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

label: a Label

-> m Bool

Returns: True if clicked links are remembered

Returns whether the label is currently keeping track of clicked links.

Since: 2.18

getUseMarkup

labelGetUseMarkup Source #

Arguments

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

label: a Label

-> m Bool

Returns: True if the label’s text will be parsed for markup.

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

labelGetUseUnderline Source #

Arguments

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

label: a Label

-> m Bool

Returns: True whether an embedded underline in the label indicates the mnemonic accelerator keys.

Returns whether an embedded underline in the label indicates a mnemonic. See labelSetUseUnderline.

getWidthChars

labelGetWidthChars Source #

Arguments

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

label: a Label

-> 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 #

Instances

((~) * signature (m Float), MonadIO m, IsLabel a) => MethodInfo * LabelGetXalignMethodInfo a signature Source # 

labelGetXalign Source #

Arguments

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

label: a Label

-> m Float

Returns: the xalign property

Gets the Label:xalign property for label.

Since: 3.16

getYalign

data LabelGetYalignMethodInfo Source #

Instances

((~) * signature (m Float), MonadIO m, IsLabel a) => MethodInfo * LabelGetYalignMethodInfo a signature Source # 

labelGetYalign Source #

Arguments

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

label: a Label

-> m Float

Returns: the yalign property

Gets the Label:yalign property for label.

Since: 3.16

new

labelNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Maybe Text

str: The text of the label

-> m Label

Returns: the new Label

Creates a new label with the given text inside it. You can pass Nothing to get an empty label widget.

newWithMnemonic

labelNewWithMnemonic Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Maybe Text

str: The text of the label, with an underscore in front of the mnemonic character

-> m Label

Returns: the new Label

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 #

Instances

((~) * signature (Int32 -> Int32 -> m ()), MonadIO m, IsLabel a) => MethodInfo * LabelSelectRegionMethodInfo a signature Source # 

labelSelectRegion Source #

Arguments

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

label: a Label

-> Int32

startOffset: start offset (in characters not bytes)

-> Int32

endOffset: end offset (in characters not bytes)

-> 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 #

Instances

((~) * signature (Double -> m ()), MonadIO m, IsLabel a) => MethodInfo * LabelSetAngleMethodInfo a signature Source # 

labelSetAngle Source #

Arguments

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

label: a Label

-> Double

angle: the angle that the baseline of the label makes with the horizontal, in degrees, measured counterclockwise

-> 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

labelSetAttributes Source #

Arguments

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

label: a Label

-> Maybe AttrList

attrs: a AttrList, or Nothing

-> m () 

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

labelSetEllipsize Source #

Arguments

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

label: a Label

-> EllipsizeMode

mode: 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 #

Instances

((~) * signature (Justification -> m ()), MonadIO m, IsLabel a) => MethodInfo * LabelSetJustifyMethodInfo a signature Source # 

labelSetJustify Source #

Arguments

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

label: a Label

-> Justification

jtype: 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 #

Instances

((~) * signature (Text -> m ()), MonadIO m, IsLabel a) => MethodInfo * LabelSetLabelMethodInfo a signature Source # 

labelSetLabel Source #

Arguments

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

label: a Label

-> Text

str: the new text to set for the label

-> m () 

Sets the text of the label. The label is interpreted as including embedded underlines and/or Pango markup depending on the values of the Label:use-underline and Label:use-markup properties.

setLineWrap

data LabelSetLineWrapMethodInfo Source #

Instances

((~) * signature (Bool -> m ()), MonadIO m, IsLabel a) => MethodInfo * LabelSetLineWrapMethodInfo a signature Source # 

labelSetLineWrap Source #

Arguments

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

label: a Label

-> Bool

wrap: the setting

-> 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

labelSetLineWrapMode Source #

Arguments

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

label: a Label

-> WrapMode

wrapMode: the line wrapping mode

-> 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 #

Instances

((~) * signature (Int32 -> m ()), MonadIO m, IsLabel a) => MethodInfo * LabelSetLinesMethodInfo a signature Source # 

labelSetLines Source #

Arguments

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

label: a Label

-> Int32

lines: the desired number of lines, or -1

-> 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 #

Instances

((~) * signature (Text -> m ()), MonadIO m, IsLabel a) => MethodInfo * LabelSetMarkupMethodInfo a signature Source # 

labelSetMarkup Source #

Arguments

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

label: a Label

-> Text

str: a markup string (see [Pango markup format][PangoMarkupFormat])

-> 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

labelSetMarkupWithMnemonic Source #

Arguments

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

label: a Label

-> Text

str: a markup string (see [Pango markup format][PangoMarkupFormat])

-> 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

labelSetMaxWidthChars Source #

Arguments

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

label: a Label

-> Int32

nChars: the new desired maximum width, in characters.

-> m () 

Sets the desired maximum width in characters of label to nChars.

Since: 2.6

setMnemonicWidget

labelSetMnemonicWidget Source #

Arguments

:: (HasCallStack, MonadIO m, IsLabel a, IsWidget b) 
=> a

label: a Label

-> Maybe b

widget: the target Widget

-> 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 #

Instances

((~) * signature (Text -> m ()), MonadIO m, IsLabel a) => MethodInfo * LabelSetPatternMethodInfo a signature Source # 

labelSetPattern Source #

Arguments

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

label: The Label you want to set the pattern to.

-> Text

pattern: The pattern as described above.

-> 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 #

Instances

((~) * signature (Bool -> m ()), MonadIO m, IsLabel a) => MethodInfo * LabelSetSelectableMethodInfo a signature Source # 

labelSetSelectable Source #

Arguments

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

label: a Label

-> Bool

setting: True to allow selecting text in the label

-> m () 

Selectable labels allow the user to select text from the label, for copy-and-paste.

setSingleLineMode

labelSetSingleLineMode Source #

Arguments

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

label: a Label

-> Bool

singleLineMode: True if the label should be in single line mode

-> m () 

Sets whether the label is in single line mode.

Since: 2.6

setText

data LabelSetTextMethodInfo Source #

Instances

((~) * signature (Text -> m ()), MonadIO m, IsLabel a) => MethodInfo * LabelSetTextMethodInfo a signature Source # 

labelSetText Source #

Arguments

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

label: a Label

-> Text

str: The text you want to set

-> 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

labelSetTextWithMnemonic Source #

Arguments

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

label: a Label

-> Text

str: a string

-> 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

labelSetTrackVisitedLinks Source #

Arguments

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

label: a Label

-> Bool

trackLinks: True to track visited links

-> 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 #

Instances

((~) * signature (Bool -> m ()), MonadIO m, IsLabel a) => MethodInfo * LabelSetUseMarkupMethodInfo a signature Source # 

labelSetUseMarkup Source #

Arguments

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

label: a Label

-> Bool

setting: True if the label’s text should be parsed for markup.

-> m () 

Sets whether the text of the label contains markup in [Pango’s text markup language][PangoMarkupFormat]. See labelSetMarkup.

setUseUnderline

labelSetUseUnderline Source #

Arguments

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

label: a Label

-> Bool

setting: True if underlines in the text indicate mnemonics

-> m () 

If true, an underline in the text indicates the next character should be used for the mnemonic accelerator key.

setWidthChars

data LabelSetWidthCharsMethodInfo Source #

Instances

((~) * signature (Int32 -> m ()), MonadIO m, IsLabel a) => MethodInfo * LabelSetWidthCharsMethodInfo a signature Source # 

labelSetWidthChars Source #

Arguments

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

label: a Label

-> Int32

nChars: the new desired width, in characters.

-> m () 

Sets the desired width in characters of label to nChars.

Since: 2.6

setXalign

data LabelSetXalignMethodInfo Source #

Instances

((~) * signature (Float -> m ()), MonadIO m, IsLabel a) => MethodInfo * LabelSetXalignMethodInfo a signature Source # 

labelSetXalign Source #

Arguments

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

label: a Label

-> Float

xalign: the new xalign value, between 0 and 1

-> m () 

Sets the Label:xalign property for label.

Since: 3.16

setYalign

data LabelSetYalignMethodInfo Source #

Instances

((~) * signature (Float -> m ()), MonadIO m, IsLabel a) => MethodInfo * LabelSetYalignMethodInfo a signature Source # 

labelSetYalign Source #

Arguments

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

label: a Label

-> Float

yalign: the new yalign value, between 0 and 1

-> m () 

Sets the Label:yalign property for label.

Since: 3.16

Properties

angle

data LabelAnglePropertyInfo Source #

Instances

AttrInfo LabelAnglePropertyInfo Source # 
type AttrOrigin LabelAnglePropertyInfo Source # 
type AttrLabel LabelAnglePropertyInfo Source # 
type AttrGetType LabelAnglePropertyInfo Source # 
type AttrBaseTypeConstraint LabelAnglePropertyInfo Source # 
type AttrSetTypeConstraint LabelAnglePropertyInfo Source # 
type AttrAllowedOps LabelAnglePropertyInfo Source # 

setLabelAngle :: (MonadIO m, IsLabel o) => o -> Double -> m () Source #

attributes

data LabelAttributesPropertyInfo Source #

Instances

AttrInfo LabelAttributesPropertyInfo Source # 
type AttrOrigin LabelAttributesPropertyInfo Source # 
type AttrLabel LabelAttributesPropertyInfo Source # 
type AttrGetType LabelAttributesPropertyInfo Source # 
type AttrBaseTypeConstraint LabelAttributesPropertyInfo Source # 
type AttrSetTypeConstraint LabelAttributesPropertyInfo Source # 
type AttrAllowedOps LabelAttributesPropertyInfo Source # 

cursorPosition

data LabelCursorPositionPropertyInfo Source #

Instances

AttrInfo LabelCursorPositionPropertyInfo Source # 
type AttrOrigin LabelCursorPositionPropertyInfo Source # 
type AttrLabel LabelCursorPositionPropertyInfo Source # 
type AttrGetType LabelCursorPositionPropertyInfo Source # 
type AttrBaseTypeConstraint LabelCursorPositionPropertyInfo Source # 
type AttrSetTypeConstraint LabelCursorPositionPropertyInfo Source # 
type AttrAllowedOps LabelCursorPositionPropertyInfo Source # 

ellipsize

data LabelEllipsizePropertyInfo Source #

Instances

AttrInfo LabelEllipsizePropertyInfo Source # 
type AttrOrigin LabelEllipsizePropertyInfo Source # 
type AttrLabel LabelEllipsizePropertyInfo Source # 
type AttrGetType LabelEllipsizePropertyInfo Source # 
type AttrBaseTypeConstraint LabelEllipsizePropertyInfo Source # 
type AttrSetTypeConstraint LabelEllipsizePropertyInfo Source # 
type AttrAllowedOps LabelEllipsizePropertyInfo Source # 

justify

data LabelJustifyPropertyInfo Source #

Instances

AttrInfo LabelJustifyPropertyInfo Source # 
type AttrOrigin LabelJustifyPropertyInfo Source # 
type AttrLabel LabelJustifyPropertyInfo Source # 
type AttrGetType LabelJustifyPropertyInfo Source # 
type AttrBaseTypeConstraint LabelJustifyPropertyInfo Source # 
type AttrSetTypeConstraint LabelJustifyPropertyInfo Source # 
type AttrAllowedOps LabelJustifyPropertyInfo Source # 

label

data LabelLabelPropertyInfo Source #

Instances

AttrInfo LabelLabelPropertyInfo Source # 
type AttrOrigin LabelLabelPropertyInfo Source # 
type AttrLabel LabelLabelPropertyInfo Source # 
type AttrGetType LabelLabelPropertyInfo Source # 
type AttrBaseTypeConstraint LabelLabelPropertyInfo Source # 
type AttrSetTypeConstraint LabelLabelPropertyInfo Source # 
type AttrAllowedOps LabelLabelPropertyInfo Source # 

setLabelLabel :: (MonadIO m, IsLabel o) => o -> Text -> m () Source #

lines

data LabelLinesPropertyInfo Source #

Instances

AttrInfo LabelLinesPropertyInfo Source # 
type AttrOrigin LabelLinesPropertyInfo Source # 
type AttrLabel LabelLinesPropertyInfo Source # 
type AttrGetType LabelLinesPropertyInfo Source # 
type AttrBaseTypeConstraint LabelLinesPropertyInfo Source # 
type AttrSetTypeConstraint LabelLinesPropertyInfo Source # 
type AttrAllowedOps LabelLinesPropertyInfo Source # 

setLabelLines :: (MonadIO m, IsLabel o) => o -> Int32 -> m () Source #

maxWidthChars

data LabelMaxWidthCharsPropertyInfo Source #

Instances

AttrInfo LabelMaxWidthCharsPropertyInfo Source # 
type AttrOrigin LabelMaxWidthCharsPropertyInfo Source # 
type AttrLabel LabelMaxWidthCharsPropertyInfo Source # 
type AttrLabel LabelMaxWidthCharsPropertyInfo = "max-width-chars"
type AttrGetType LabelMaxWidthCharsPropertyInfo Source # 
type AttrBaseTypeConstraint LabelMaxWidthCharsPropertyInfo Source # 
type AttrSetTypeConstraint LabelMaxWidthCharsPropertyInfo Source # 
type AttrAllowedOps LabelMaxWidthCharsPropertyInfo Source # 

mnemonicKeyval

data LabelMnemonicKeyvalPropertyInfo Source #

Instances

AttrInfo LabelMnemonicKeyvalPropertyInfo Source # 
type AttrOrigin LabelMnemonicKeyvalPropertyInfo Source # 
type AttrLabel LabelMnemonicKeyvalPropertyInfo Source # 
type AttrGetType LabelMnemonicKeyvalPropertyInfo Source # 
type AttrBaseTypeConstraint LabelMnemonicKeyvalPropertyInfo Source # 
type AttrSetTypeConstraint LabelMnemonicKeyvalPropertyInfo Source # 
type AttrAllowedOps LabelMnemonicKeyvalPropertyInfo Source # 

mnemonicWidget

data LabelMnemonicWidgetPropertyInfo Source #

Instances

AttrInfo LabelMnemonicWidgetPropertyInfo Source # 
type AttrOrigin LabelMnemonicWidgetPropertyInfo Source # 
type AttrLabel LabelMnemonicWidgetPropertyInfo Source # 
type AttrGetType LabelMnemonicWidgetPropertyInfo Source # 
type AttrBaseTypeConstraint LabelMnemonicWidgetPropertyInfo Source # 
type AttrSetTypeConstraint LabelMnemonicWidgetPropertyInfo Source # 
type AttrAllowedOps LabelMnemonicWidgetPropertyInfo Source # 

setLabelMnemonicWidget :: (MonadIO m, IsLabel o, IsWidget a) => o -> a -> m () Source #

pattern

data LabelPatternPropertyInfo Source #

Instances

AttrInfo LabelPatternPropertyInfo Source # 
type AttrOrigin LabelPatternPropertyInfo Source # 
type AttrLabel LabelPatternPropertyInfo Source # 
type AttrGetType LabelPatternPropertyInfo Source # 
type AttrBaseTypeConstraint LabelPatternPropertyInfo Source # 
type AttrSetTypeConstraint LabelPatternPropertyInfo Source # 
type AttrAllowedOps LabelPatternPropertyInfo Source # 

setLabelPattern :: (MonadIO m, IsLabel o) => o -> Text -> m () Source #

selectable

data LabelSelectablePropertyInfo Source #

Instances

AttrInfo LabelSelectablePropertyInfo Source # 
type AttrOrigin LabelSelectablePropertyInfo Source # 
type AttrLabel LabelSelectablePropertyInfo Source # 
type AttrGetType LabelSelectablePropertyInfo Source # 
type AttrBaseTypeConstraint LabelSelectablePropertyInfo Source # 
type AttrSetTypeConstraint LabelSelectablePropertyInfo Source # 
type AttrAllowedOps LabelSelectablePropertyInfo Source # 

setLabelSelectable :: (MonadIO m, IsLabel o) => o -> Bool -> m () Source #

selectionBound

data LabelSelectionBoundPropertyInfo Source #

Instances

AttrInfo LabelSelectionBoundPropertyInfo Source # 
type AttrOrigin LabelSelectionBoundPropertyInfo Source # 
type AttrLabel LabelSelectionBoundPropertyInfo Source # 
type AttrGetType LabelSelectionBoundPropertyInfo Source # 
type AttrBaseTypeConstraint LabelSelectionBoundPropertyInfo Source # 
type AttrSetTypeConstraint LabelSelectionBoundPropertyInfo Source # 
type AttrAllowedOps LabelSelectionBoundPropertyInfo Source # 

singleLineMode

data LabelSingleLineModePropertyInfo Source #

Instances

AttrInfo LabelSingleLineModePropertyInfo Source # 
type AttrOrigin LabelSingleLineModePropertyInfo Source # 
type AttrLabel LabelSingleLineModePropertyInfo Source # 
type AttrLabel LabelSingleLineModePropertyInfo = "single-line-mode"
type AttrGetType LabelSingleLineModePropertyInfo Source # 
type AttrBaseTypeConstraint LabelSingleLineModePropertyInfo Source # 
type AttrSetTypeConstraint LabelSingleLineModePropertyInfo Source # 
type AttrAllowedOps LabelSingleLineModePropertyInfo Source # 

trackVisitedLinks

data LabelTrackVisitedLinksPropertyInfo Source #

Instances

AttrInfo LabelTrackVisitedLinksPropertyInfo Source # 
type AttrOrigin LabelTrackVisitedLinksPropertyInfo Source # 
type AttrLabel LabelTrackVisitedLinksPropertyInfo Source # 
type AttrLabel LabelTrackVisitedLinksPropertyInfo = "track-visited-links"
type AttrGetType LabelTrackVisitedLinksPropertyInfo Source # 
type AttrBaseTypeConstraint LabelTrackVisitedLinksPropertyInfo Source # 
type AttrSetTypeConstraint LabelTrackVisitedLinksPropertyInfo Source # 
type AttrAllowedOps LabelTrackVisitedLinksPropertyInfo Source # 

useMarkup

data LabelUseMarkupPropertyInfo Source #

Instances

AttrInfo LabelUseMarkupPropertyInfo Source # 
type AttrOrigin LabelUseMarkupPropertyInfo Source # 
type AttrLabel LabelUseMarkupPropertyInfo Source # 
type AttrGetType LabelUseMarkupPropertyInfo Source # 
type AttrBaseTypeConstraint LabelUseMarkupPropertyInfo Source # 
type AttrSetTypeConstraint LabelUseMarkupPropertyInfo Source # 
type AttrAllowedOps LabelUseMarkupPropertyInfo Source # 

setLabelUseMarkup :: (MonadIO m, IsLabel o) => o -> Bool -> m () Source #

useUnderline

data LabelUseUnderlinePropertyInfo Source #

Instances

AttrInfo LabelUseUnderlinePropertyInfo Source # 
type AttrOrigin LabelUseUnderlinePropertyInfo Source # 
type AttrLabel LabelUseUnderlinePropertyInfo Source # 
type AttrGetType LabelUseUnderlinePropertyInfo Source # 
type AttrBaseTypeConstraint LabelUseUnderlinePropertyInfo Source # 
type AttrSetTypeConstraint LabelUseUnderlinePropertyInfo Source # 
type AttrAllowedOps LabelUseUnderlinePropertyInfo Source # 

setLabelUseUnderline :: (MonadIO m, IsLabel o) => o -> Bool -> m () Source #

widthChars

data LabelWidthCharsPropertyInfo Source #

Instances

AttrInfo LabelWidthCharsPropertyInfo Source # 
type AttrOrigin LabelWidthCharsPropertyInfo Source # 
type AttrLabel LabelWidthCharsPropertyInfo Source # 
type AttrGetType LabelWidthCharsPropertyInfo Source # 
type AttrBaseTypeConstraint LabelWidthCharsPropertyInfo Source # 
type AttrSetTypeConstraint LabelWidthCharsPropertyInfo Source # 
type AttrAllowedOps LabelWidthCharsPropertyInfo Source # 

setLabelWidthChars :: (MonadIO m, IsLabel o) => o -> Int32 -> m () Source #

wrap

data LabelWrapPropertyInfo Source #

Instances

AttrInfo LabelWrapPropertyInfo Source # 
type AttrOrigin LabelWrapPropertyInfo Source # 
type AttrLabel LabelWrapPropertyInfo Source # 
type AttrGetType LabelWrapPropertyInfo Source # 
type AttrBaseTypeConstraint LabelWrapPropertyInfo Source # 
type AttrSetTypeConstraint LabelWrapPropertyInfo Source # 
type AttrAllowedOps LabelWrapPropertyInfo Source # 

getLabelWrap :: (MonadIO m, IsLabel o) => o -> m Bool Source #

setLabelWrap :: (MonadIO m, IsLabel o) => o -> Bool -> m () Source #

wrapMode

data LabelWrapModePropertyInfo Source #

Instances

AttrInfo LabelWrapModePropertyInfo Source # 
type AttrOrigin LabelWrapModePropertyInfo Source # 
type AttrLabel LabelWrapModePropertyInfo Source # 
type AttrGetType LabelWrapModePropertyInfo Source # 
type AttrBaseTypeConstraint LabelWrapModePropertyInfo Source # 
type AttrSetTypeConstraint LabelWrapModePropertyInfo Source # 
type AttrAllowedOps LabelWrapModePropertyInfo Source # 

setLabelWrapMode :: (MonadIO m, IsLabel o) => o -> WrapMode -> m () Source #

xalign

data LabelXalignPropertyInfo Source #

Instances

AttrInfo LabelXalignPropertyInfo Source # 
type AttrOrigin LabelXalignPropertyInfo Source # 
type AttrLabel LabelXalignPropertyInfo Source # 
type AttrGetType LabelXalignPropertyInfo Source # 
type AttrBaseTypeConstraint LabelXalignPropertyInfo Source # 
type AttrSetTypeConstraint LabelXalignPropertyInfo Source # 
type AttrAllowedOps LabelXalignPropertyInfo Source # 

setLabelXalign :: (MonadIO m, IsLabel o) => o -> Float -> m () Source #

yalign

data LabelYalignPropertyInfo Source #

Instances

AttrInfo LabelYalignPropertyInfo Source # 
type AttrOrigin LabelYalignPropertyInfo Source # 
type AttrLabel LabelYalignPropertyInfo Source # 
type AttrGetType LabelYalignPropertyInfo Source # 
type AttrBaseTypeConstraint LabelYalignPropertyInfo Source # 
type AttrSetTypeConstraint LabelYalignPropertyInfo Source # 
type AttrAllowedOps LabelYalignPropertyInfo Source # 

setLabelYalign :: (MonadIO m, IsLabel o) => o -> Float -> m () Source #

Signals

activateCurrentLink

activateLink

copyClipboard

moveCursor

type C_LabelMoveCursorCallback = Ptr () -> CUInt -> Int32 -> CInt -> Ptr () -> IO () Source #

populatePopup