gi-gtk-3.0.37: Gtk bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
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, similar to the one used by web browsers, which triggers an action when clicked. 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, and retrieved using linkButtonGetUri.

By default, GtkLinkButton calls showUriOnWindow when the button is clicked. This behaviour can be overridden by connecting to the 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 Button, it gets the .link style class.

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

type ParentTypes LinkButton = '[Button, Bin, Container, Widget, Object, ImplementorIface, Actionable, Activatable, Buildable]

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

activate, add, addAccelerator, addChild, addDeviceEvents, addEvents, addMnemonicLabel, addTickCallback, bindProperty, bindPropertyFull, canActivateAccel, checkResize, childFocus, childGetProperty, childNotify, childNotifyByPspec, childSetProperty, childType, classPath, clicked, computeExpand, constructChild, createPangoContext, createPangoLayout, customFinished, customTagEnd, customTagStart, destroy, destroyed, deviceIsShadowed, doSetRelatedAction, dragBegin, dragBeginWithCoordinates, dragCheckThreshold, dragDestAddImageTargets, dragDestAddTextTargets, dragDestAddUriTargets, dragDestFindTarget, dragDestGetTargetList, dragDestGetTrackMotion, dragDestSet, dragDestSetProxy, dragDestSetTargetList, dragDestSetTrackMotion, dragDestUnset, dragGetData, dragHighlight, dragSourceAddImageTargets, dragSourceAddTextTargets, dragSourceAddUriTargets, dragSourceGetTargetList, dragSourceSet, dragSourceSetIconGicon, dragSourceSetIconName, dragSourceSetIconPixbuf, dragSourceSetIconStock, dragSourceSetTargetList, dragSourceUnset, dragUnhighlight, draw, ensureStyle, enter, errorBell, event, forall, forceFloating, foreach, freezeChildNotify, freezeNotify, getv, grabAdd, grabDefault, grabFocus, grabRemove, hasDefault, hasFocus, hasGrab, hasRcStyle, hasScreen, hasVisibleFocus, hide, hideOnDelete, inDestruction, initTemplate, inputShapeCombineRegion, insertActionGroup, intersect, isAncestor, isComposited, isDrawable, isFloating, isFocus, isSensitive, isToplevel, isVisible, keynavFailed, leave, listAccelClosures, listActionPrefixes, listMnemonicLabels, map, mnemonicActivate, modifyBase, modifyBg, modifyCursor, modifyFg, modifyFont, modifyStyle, modifyText, notify, notifyByPspec, overrideBackgroundColor, overrideColor, overrideCursor, overrideFont, overrideSymbolicColor, parserFinished, path, pressed, propagateDraw, queueAllocate, queueComputeExpand, queueDraw, queueDrawArea, queueDrawRegion, queueResize, queueResizeNoRedraw, realize, ref, refSink, regionIntersect, registerWindow, released, remove, removeAccelerator, removeMnemonicLabel, removeTickCallback, renderIcon, renderIconPixbuf, reparent, resetRcStyles, resetStyle, resizeChildren, runDispose, sendExpose, sendFocusChange, shapeCombineRegion, show, showAll, showNow, sizeAllocate, sizeAllocateWithBaseline, sizeRequest, stealData, stealQdata, styleAttach, styleGetProperty, syncActionProperties, thawChildNotify, thawNotify, translateCoordinates, triggerTooltipQuery, unmap, unparent, unrealize, unref, unregisterWindow, unsetFocusChain, unsetStateFlags, watchClosure.

Getters

getAccessible, getActionGroup, getActionName, getActionTargetValue, getAlignment, getAllocatedBaseline, getAllocatedHeight, getAllocatedSize, getAllocatedWidth, getAllocation, getAlwaysShowImage, getAncestor, getAppPaintable, getBorderWidth, getCanDefault, getCanFocus, getChild, getChildRequisition, getChildVisible, getChildren, getClip, getClipboard, getCompositeName, getData, getDeviceEnabled, getDeviceEvents, getDirection, getDisplay, getDoubleBuffered, getEventWindow, getEvents, getFocusChain, getFocusChild, getFocusHadjustment, getFocusOnClick, getFocusVadjustment, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHasWindow, getHexpand, getHexpandSet, getImage, getImagePosition, getInternalChild, getLabel, getMapped, getMarginBottom, getMarginEnd, getMarginLeft, getMarginRight, getMarginStart, getMarginTop, getModifierMask, getModifierStyle, getName, getNoShowAll, getOpacity, getPangoContext, getParent, getParentWindow, getPath, getPathForChild, getPointer, getPreferredHeight, getPreferredHeightAndBaselineForWidth, getPreferredHeightForWidth, getPreferredSize, getPreferredWidth, getPreferredWidthForHeight, getProperty, getQdata, getRealized, getReceivesDefault, getRelatedAction, getRelief, getRequestMode, getRequisition, getResizeMode, getRootWindow, getScaleFactor, getScreen, getSensitive, getSettings, getSizeRequest, getState, getStateFlags, getStyle, getStyleContext, getSupportMultidevice, getTemplateChild, getTooltipMarkup, getTooltipText, getTooltipWindow, getToplevel, getUri, getUseActionAppearance, getUseStock, getUseUnderline, getValign, getValignWithBaseline, getVexpand, getVexpandSet, getVisible, getVisited, getVisual, getWindow.

Setters

setAccelPath, setActionName, setActionTargetValue, setAlignment, setAllocation, setAlwaysShowImage, setAppPaintable, setBorderWidth, setBuildableProperty, setCanDefault, setCanFocus, setChildVisible, setClip, setCompositeName, setData, setDataFull, setDetailedActionName, setDeviceEnabled, setDeviceEvents, setDirection, setDoubleBuffered, setEvents, setFocusChain, setFocusChild, setFocusHadjustment, setFocusOnClick, setFocusVadjustment, setFontMap, setFontOptions, setHalign, setHasTooltip, setHasWindow, setHexpand, setHexpandSet, setImage, setImagePosition, setLabel, setMapped, setMarginBottom, setMarginEnd, setMarginLeft, setMarginRight, setMarginStart, setMarginTop, setName, setNoShowAll, setOpacity, setParent, setParentWindow, setProperty, setRealized, setReallocateRedraws, setReceivesDefault, setRedrawOnAllocate, setRelatedAction, setRelief, setResizeMode, setSensitive, setSizeRequest, setState, setStateFlags, setStyle, setSupportMultidevice, setTooltipMarkup, setTooltipText, setTooltipWindow, setUri, setUseActionAppearance, setUseStock, setUseUnderline, setValign, setVexpand, setVexpandSet, setVisible, setVisited, setVisual, setWindow.

getUri

linkButtonGetUri Source #

Arguments

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

linkButton: a LinkButton

-> 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 set using linkButtonSetUri.

Since: 2.10

getVisited

linkButtonGetVisited Source #

Arguments

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

linkButton: a LinkButton

-> m Bool

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

Retrieves the “visited” state of the URI where the LinkButton points. 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.

Since: 2.14

new

linkButtonNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

uri: a valid URI

-> m LinkButton

Returns: a new link button widget.

Creates a new LinkButton with the URI as its text.

Since: 2.10

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 LinkButton containing a label.

Since: 2.10

setUri

linkButtonSetUri Source #

Arguments

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

linkButton: a LinkButton

-> Text

uri: a valid URI

-> m () 

Sets uri as the URI where the LinkButton points. As a side-effect this unsets the “visited” state of the button.

Since: 2.10

setVisited

linkButtonSetVisited Source #

Arguments

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

linkButton: a LinkButton

-> Bool

visited: the new “visited” state

-> m () 

Sets the “visited” state of the URI where the LinkButton points. See linkButtonGetVisited for more details.

Since: 2.14

Properties

uri

The URI bound to this button.

Since: 2.10

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.

Since: 2.14

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 C_LinkButtonActivateLinkCallback = Ptr () -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type LinkButtonActivateLinkCallback = IO Bool Source #

The activateLink signal is emitted each time the LinkButton has been clicked.

The default handler will call showUriOnWindow 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 -> 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

onLinkButtonActivateLink :: (IsLinkButton a, MonadIO m) => 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