gi-gtk-4.0.6: Gtk bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Gtk.Objects.LinkButton

Description

A GtkLinkButton is a button with a hyperlink.

It is useful to show quick links to resources.

A link button is created by calling either linkButtonNew or linkButtonNewWithLabel. If using the former, the URI you pass to the constructor is used as a label for the widget.

The URI bound to a GtkLinkButton can be set specifically using linkButtonSetUri.

By default, GtkLinkButton calls showUri when the button is clicked. This behaviour can be overridden by connecting to the LinkButton::activateLink signal and returning True from the signal handler.

CSS nodes

GtkLinkButton has a single CSS node with name button. To differentiate it from a plain GtkButton, it gets the .link style class.

Accessibility

GtkLinkButton uses the AccessibleRoleLink role.

Synopsis

Exported types

newtype LinkButton Source #

Memory-managed wrapper type.

Constructors

LinkButton (ManagedPtr LinkButton) 

Instances

Instances details
Eq LinkButton Source # 
Instance details

Defined in GI.Gtk.Objects.LinkButton

GObject LinkButton Source # 
Instance details

Defined in GI.Gtk.Objects.LinkButton

ManagedPtrNewtype LinkButton Source # 
Instance details

Defined in GI.Gtk.Objects.LinkButton

Methods

toManagedPtr :: LinkButton -> ManagedPtr LinkButton

TypedObject LinkButton Source # 
Instance details

Defined in GI.Gtk.Objects.LinkButton

Methods

glibType :: IO GType

HasParentTypes LinkButton Source # 
Instance details

Defined in GI.Gtk.Objects.LinkButton

IsGValue (Maybe LinkButton) Source #

Convert LinkButton to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Gtk.Objects.LinkButton

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe LinkButton -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe LinkButton)

type ParentTypes LinkButton Source # 
Instance details

Defined in GI.Gtk.Objects.LinkButton

class (GObject o, IsDescendantOf LinkButton o) => IsLinkButton o Source #

Type class for types which can be safely cast to LinkButton, for instance with toLinkButton.

Instances

Instances details
(GObject o, IsDescendantOf LinkButton o) => IsLinkButton o Source # 
Instance details

Defined in GI.Gtk.Objects.LinkButton

toLinkButton :: (MonadIO m, IsLinkButton o) => o -> m LinkButton Source #

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

Methods

Click to display all available methods, including inherited ones

Expand

Methods

actionSetEnabled, activate, activateAction, activateDefault, addController, addCssClass, addMnemonicLabel, addTickCallback, allocate, bindProperty, bindPropertyFull, childFocus, computeBounds, computeExpand, computePoint, computeTransform, contains, createPangoContext, createPangoLayout, disposeTemplate, dragCheckThreshold, errorBell, forceFloating, freezeNotify, getv, grabFocus, hasCssClass, hasDefault, hasFocus, hasVisibleFocus, hide, inDestruction, initTemplate, insertActionGroup, insertAfter, insertBefore, isAncestor, isDrawable, isFloating, isFocus, isSensitive, isVisible, keynavFailed, listMnemonicLabels, map, measure, mnemonicActivate, notify, notifyByPspec, observeChildren, observeControllers, pick, queueAllocate, queueDraw, queueResize, realize, ref, refSink, removeController, removeCssClass, removeMnemonicLabel, removeTickCallback, resetProperty, resetRelation, resetState, runDispose, shouldLayout, show, sizeAllocate, snapshotChild, stealData, stealQdata, thawNotify, translateCoordinates, triggerTooltipQuery, unmap, unparent, unrealize, unref, unsetStateFlags, updateProperty, updateRelation, updateState, watchClosure.

Getters

getAccessibleRole, getActionName, getActionTargetValue, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAncestor, getBuildableId, getCanFocus, getCanTarget, getChild, getChildVisible, getClipboard, getCssClasses, getCssName, getCursor, getData, getDirection, getDisplay, getFirstChild, getFocusChild, getFocusOnClick, getFocusable, getFontMap, getFontOptions, getFrameClock, getHalign, getHasFrame, getHasTooltip, getHeight, getHexpand, getHexpandSet, getIconName, getLabel, getLastChild, getLayoutManager, getMapped, getMarginBottom, getMarginEnd, getMarginStart, getMarginTop, getName, getNative, getNextSibling, getOpacity, getOverflow, getPangoContext, getParent, getPreferredSize, getPrevSibling, getPrimaryClipboard, getProperty, getQdata, getRealized, getReceivesDefault, getRequestMode, getRoot, getScaleFactor, getSensitive, getSettings, getSize, getSizeRequest, getStateFlags, getStyleContext, getTemplateChild, getTooltipMarkup, getTooltipText, getUri, getUseUnderline, getValign, getVexpand, getVexpandSet, getVisible, getVisited, getWidth.

Setters

setActionName, setActionTargetValue, setCanFocus, setCanTarget, setChild, setChildVisible, setCssClasses, setCursor, setCursorFromName, setData, setDataFull, setDetailedActionName, setDirection, setFocusChild, setFocusOnClick, setFocusable, setFontMap, setFontOptions, setHalign, setHasFrame, setHasTooltip, setHexpand, setHexpandSet, setIconName, setLabel, setLayoutManager, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setName, setOpacity, setOverflow, setParent, setProperty, setReceivesDefault, setSensitive, setSizeRequest, setStateFlags, setTooltipMarkup, setTooltipText, setUri, setUseUnderline, setValign, setVexpand, setVexpandSet, setVisible, setVisited.

getUri

linkButtonGetUri Source #

Arguments

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

linkButton: a GtkLinkButton

-> m Text

Returns: a valid URI. The returned string is owned by the link button and should not be modified or freed.

Retrieves the URI of the GtkLinkButton.

getVisited

linkButtonGetVisited Source #

Arguments

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

linkButton: a GtkLinkButton

-> m Bool

Returns: True if the link has been visited, False otherwise

Retrieves the “visited” state of the GtkLinkButton.

The button becomes visited when it is clicked. If the URI is changed on the button, the “visited” state is unset again.

The state may also be changed using linkButtonSetVisited.

new

linkButtonNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

uri: a valid URI

-> m LinkButton

Returns: a new link button widget.

Creates a new GtkLinkButton with the URI as its text.

newWithLabel

linkButtonNewWithLabel Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

uri: a valid URI

-> Maybe Text

label: the text of the button

-> m LinkButton

Returns: a new link button widget.

Creates a new GtkLinkButton containing a label.

setUri

linkButtonSetUri Source #

Arguments

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

linkButton: a GtkLinkButton

-> Text

uri: a valid URI

-> m () 

Sets uri as the URI where the GtkLinkButton points.

As a side-effect this unsets the “visited” state of the button.

setVisited

linkButtonSetVisited Source #

Arguments

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

linkButton: a GtkLinkButton

-> Bool

visited: the new “visited” state

-> m () 

Sets the “visited” state of the GtkLinkButton.

See linkButtonGetVisited for more details.

Properties

uri

The URI bound to this button.

constructLinkButtonUri :: (IsLinkButton o, MonadIO m) => Text -> m (GValueConstruct o) Source #

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

getLinkButtonUri :: (MonadIO m, IsLinkButton o) => o -> m Text Source #

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

get linkButton #uri

setLinkButtonUri :: (MonadIO m, IsLinkButton o) => o -> Text -> m () Source #

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

set linkButton [ #uri := value ]

visited

The 'visited' state of this button.

A visited link is drawn in a different color.

constructLinkButtonVisited :: (IsLinkButton o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

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

getLinkButtonVisited :: (MonadIO m, IsLinkButton o) => o -> m Bool Source #

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

get linkButton #visited

setLinkButtonVisited :: (MonadIO m, IsLinkButton o) => o -> Bool -> m () Source #

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

set linkButton [ #visited := value ]

Signals

activateLink

type LinkButtonActivateLinkCallback Source #

Arguments

 = IO Bool

Returns: True if the signal has been handled

Emitted each time the GtkLinkButton is clicked.

The default handler will call showUri with the URI stored inside the LinkButton:uri property.

To override the default behavior, you can connect to the activateLink signal and stop the propagation of the signal by returning True from your handler.

afterLinkButtonActivateLink :: (IsLinkButton a, MonadIO m) => a -> ((?self :: a) => LinkButtonActivateLinkCallback) -> m SignalHandlerId Source #

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

after linkButton #activateLink callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onLinkButtonActivateLink :: (IsLinkButton a, MonadIO m) => a -> ((?self :: a) => LinkButtonActivateLinkCallback) -> m SignalHandlerId Source #

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

on linkButton #activateLink callback