gtkmm 3.4.0

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Protected Member Functions | Related Functions
Gtk::LinkButton Class Reference
Widgets

Create buttons bound to a URL. More...

Inheritance diagram for Gtk::LinkButton:
[legend]

List of all members.

## Public Member Functions
virtual | ~LinkButton ()
GtkLinkButton* | gobj ()
| Provides access to the underlying C GtkObject.
const GtkLinkButton* | gobj () const
| Provides access to the underlying C GtkObject.
| LinkButton ()
| LinkButton (const Glib::ustring& uri)
| LinkButton (const Glib::ustring& uri, const Glib::ustring& label)
Glib::ustring | get_uri () const
| Retrieves the URI set using set_uri().
void | set_uri (const Glib::ustring& uri)
| Sets uri as the URI where the Gtk::LinkButton points.
bool | get_visited () const
| Retrieves the 'visited' state of the URI where the Gtk::LinkButton points.
void | set_visited (bool visited=true)
| Sets the 'visited' state of the URI where the Gtk::LinkButton points.
Glib::PropertyProxy < Glib::ustring > | property_uri ()
| The URI bound to this button.
Glib::PropertyProxy_ReadOnly < Glib::ustring > | property_uri () const
| The URI bound to this button.
Glib::PropertyProxy< bool > | property_visited ()
| Whether this link has been visited.
Glib::PropertyProxy_ReadOnly < bool > | property_visited () const
| Whether this link has been visited.
Glib::SignalProxy0< bool > | signal_activate_link ()
## Protected Member Functions
virtual bool | on_activate_link ()
| This is a default handler for the signal signal_activate_link().
## Related Functions
(Note that these are not member functions.)
Gtk::LinkButton* | wrap (GtkLinkButton* object, bool take_copy=false)
| A Glib::wrap() method for this object.

## Detailed Description

Create buttons bound to a URL.

A Gtk::LinkButton is a Gtk::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.

The URI bound to a Gtk::LinkButton can be set specifically using set_uri(), and retrieved using get_uri(). By default, Gtk::LinkButton calls gtk_show_uri() when the button is clicked. This behaviour can be overridden by connecting to the activate_link signal and returning true from the signal handler.

The LinkButton widget looks like this:

Since gtkmm 2.10:

## Constructor & Destructor Documentation

virtual Gtk::LinkButton::~LinkButton | ( |  | ) | `[virtual]`

Gtk::LinkButton::LinkButton | ( |  | ) |

Gtk::LinkButton::LinkButton | ( | const Glib::ustring & | uri | ) | `[explicit]`

Gtk::LinkButton::LinkButton | ( | const Glib::ustring & | uri,
|  | const Glib::ustring & | label
| ) |  | `[explicit]`

## Member Function Documentation

Glib::ustring Gtk::LinkButton::get_uri | ( |  | ) | const

Retrieves the URI set using set_uri().

Since gtkmm 2.10:

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

bool Gtk::LinkButton::get_visited | ( |  | ) | const

Retrieves the 'visited' state of the URI where the Gtk::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 set_visited().

Since gtkmm 2.14:

Returns:
  `true` if the link has been visited, `false` otherwise.

GtkLinkButton* Gtk::LinkButton::gobj | ( |  | ) | `[inline]`

Provides access to the underlying C GtkObject.

Reimplemented from Gtk::Button.

const GtkLinkButton* Gtk::LinkButton::gobj | ( |  | ) | const`[inline]`

Provides access to the underlying C GtkObject.

Reimplemented from Gtk::Button.

virtual bool Gtk::LinkButton::on_activate_link | ( |  | ) | `[protected, virtual]`

This is a default handler for the signal signal_activate_link().

Glib::PropertyProxy< Glib::ustring > Gtk::LinkButton::property_uri | ( |  | ) |

The URI bound to this button.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly< Glib::ustring > Gtk::LinkButton::property_uri | ( |  | ) | const

The URI bound to this button.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy< bool > Gtk::LinkButton::property_visited | ( |  | ) |

Whether this link has been visited.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly< bool > Gtk::LinkButton::property_visited | ( |  | ) | const

Whether this link has been visited.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

void Gtk::LinkButton::set_uri | ( | const Glib::ustring & | uri | ) |

Sets uri as the URI where the Gtk::LinkButton points.

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

Since gtkmm 2.10:

Parameters:

  uri | A valid URI.

void Gtk::LinkButton::set_visited | ( | bool | visited = `true` | ) |

Sets the 'visited' state of the URI where the Gtk::LinkButton points.

See get_visited() for more details.

Since gtkmm 2.14:

Parameters:

  visited | The new 'visited' state.

Glib::SignalProxy0< bool > Gtk::LinkButton::signal_activate_link | ( |  | ) |

Slot Prototype:
  `bool on_my_activate_link()`

The signal_activate_link() signal is emitted each time the Gtk::LinkButton has been clicked.

The default handler will call gtk_show_uri() with the URI stored inside the Gtk::LinkButton::property_uri() property.

To override the default behavior, you can connect to the signal_activate_link() signal and stop the propagation of the signal by returning `true` from your handler.

## Friends And Related Function Documentation

Gtk::LinkButton* wrap | ( | GtkLinkButton * | object,
|  | bool | take_copy = `false`
| ) |  | `[related]`

A Glib::wrap() method for this object.

Parameters:

  object | The C instance.
  take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref.

Returns:
  A C++ instance that wraps this C instance.

The documentation for this class was generated from the following file:

- gtkmm/linkbutton.h