LinkButton


Object Hierarchy:

Object hierarchy for LinkButton

Description:

public class LinkButton : Button, Implementor, Actionable, Activatable, Buildable

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 LinkButton or LinkButton.with_label. 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 set_uri, and retrieved using get_uri.

By default, GtkLinkButton calls show_uri_on_window when the button is clicked. This behaviour can be overridden by connecting to the 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.

GtkLinkButton

Example: LinkButton:

public class Application : Gtk.Window {
public Application () {
// Prepare Gtk.Window:
this.title = "My Gtk.LinkButton";
this.window_position = Gtk.WindowPosition.CENTER;
this.destroy.connect (Gtk.main_quit);
this.set_default_size (350, 70);

// The button:
Gtk.LinkButton button = new Gtk.LinkButton.with_label ("http://www.valadoc.org", "Valadoc");
this.add (button);
}

public static int main (string[] args) {
Gtk.init (ref args);

Application app = new Application ();
app.show_all ();
Gtk.main ();
return 0;
}
}

valac --pkg gtk+-3.0 Gtk.LinkButton.vala


Namespace: Gtk
Package: gtk+-3.0

Content:

Properties:

Creation methods:

Methods:

Signals:

Inherited Members:

All known members inherited from class Gtk.Bin
All known members inherited from class Gtk.Widget
All known members inherited from interface Atk.Implementor