gtk-0.12.2: Binding to the Gtk+ graphical user interface library.

Portability | portable (depends on GHC)
Stability | provisional
Maintainer | gtk2hs-users@lists.sourceforge.net

Graphics.UI.Gtk.Buttons.LinkButton

Contents

- Detail
- Class Hierarchy
- Types
- Constructors
- Methods
- Attributes

Description

Create buttons bound to a URL

- Module available since Gtk+ version 2.10

Synopsis

- data LinkButton
- class ButtonClass o => LinkButtonClass o
- castToLinkButton :: GObjectClass obj => obj -> LinkButton
- toLinkButton :: LinkButtonClass o => o -> LinkButton
- linkButtonNew :: String -> IO LinkButton
- linkButtonNewWithLabel :: String -> String -> IO LinkButton
- linkButtonSetUriHook :: (String -> IO ()) -> IO ()
- linkButtonURI :: LinkButtonClass self => Attr self String
- linkButtonVisited :: LinkButtonClass self => Attr self Bool

# Detail

A `LinkButton` 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 `LinkButton` can be set specifically using "set linkButton [linkButtonURI := uri]", and retrieved using "uri <- get linkButton linkButtonURI".

`LinkButton` offers a global hook, which is called when the used clicks on it: see `linkButtonSetURIHook`.

`LinkButton` was added in Gtk+ 2.10.

# Class Hierarchy

     | GObject
     | +----Object
     | +----Widget
     | +----Container
     | +----Bin
     | +----Button
     | +----LinkButton

# Types

data LinkButton

Instances

Eq LinkButton |
Ord LinkButton |
GObjectClass LinkButton |
LinkButtonClass LinkButton |
ButtonClass LinkButton |
BinClass LinkButton |
ContainerClass LinkButton |
WidgetClass LinkButton |
ObjectClass LinkButton |

class ButtonClass o => LinkButtonClass o

Instances

LinkButtonClass LinkButton |

castToLinkButton :: GObjectClass obj => obj -> LinkButton

toLinkButton :: LinkButtonClass o => o -> LinkButton

# Constructors

linkButtonNew

Arguments

:: String | `uri` - a valid URI
-> IO LinkButton |

Creates a new `LinkButton` with the URI as its text.

linkButtonNewWithLabel

Arguments

:: String | `uri` - a valid URI
-> String | `label` - the text of the button
-> IO LinkButton |

Creates a new `LinkButton` containing a label.

# Methods

linkButtonSetUriHook :: (String -> IO ()) -> IO ()

Sets `func` as the function that should be invoked every time a user clicks a `LinkButton`. This function is called before every callback registered for the `buttonClicked` signal.

If no uri hook has been set, Gtk+ defaults to calling `showURI`.

# Attributes

linkButtonURI :: LinkButtonClass self => Attr self String

The URI bound to this button.

Default value: ""

- Available since Gtk+ version 2.10

linkButtonVisited :: LinkButtonClass self => Attr self Bool

The `visited` state of this button. A visited link is drawn in a different color.

Default value: `False`

- Available since Gtk+ version 2.14