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

Contents

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 showUri when the button is clicked. This behaviour can be overridden by connecting to the LinkButton::activate-link 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

Methods

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

data LinkButtonSetUriMethodInfo Source #

Instances

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

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

data LinkButtonUriPropertyInfo Source #

Instances

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

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

visited

data LinkButtonVisitedPropertyInfo Source #

Instances

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

Signals

activateLink