SexyUrlLabel

SexyUrlLabel — A GtkLabel with support for embedded hyperlinks.

Synopsis




            SexyUrlLabel;
GtkWidget*  sexy_url_label_new              (void);
void        sexy_url_label_set_markup       (SexyUrlLabel *url_label,
                                             const gchar *markup);

Object Hierarchy


  GObject
   +----GInitiallyUnowned
         +----GtkObject
               +----GtkWidget
                     +----GtkMisc
                           +----GtkLabel
                                 +----SexyUrlLabel

Implemented Interfaces

SexyUrlLabel implements AtkImplementorIface.

Signals


"url-activated"
            void        user_function      (SexyUrlLabel *url_label,
                                            gchar        *url,
                                            gpointer      user_data)      : Run last / Action

Description

SexyUrlLabel is a GtkLabel with support for embedded hyperlinks. It uses a modified form of the Pango markup format that supports the <a href="...">...</a> tag. The hyperlink will appear in blue and can be activated by clicking it. Right-clicking the hyperlink displays a menu offering the ability to activate it or to copy the URL.

Details

SexyUrlLabel

typedef struct _SexyUrlLabel SexyUrlLabel;

The SexyUrlLabel struct contains private data only, and should be manipulated using the functions below.


sexy_url_label_new ()

GtkWidget*  sexy_url_label_new              (void);

Creates a new SexyUrlLabel widget.

Returns : a new SexyUrlLabel.

sexy_url_label_set_markup ()

void        sexy_url_label_set_markup       (SexyUrlLabel *url_label,
                                             const gchar *markup);

Parses markup which is marked up with the Pango text markup language as well as HTML-style hyperlinks, setting the label's text and attribute list based on the parse results. If the markup is external data, you may need to escape it with g_markup_escape_text() or g_markup_printf_escaped()

url_label : A SexyUrlLabel.
markup : a markup string (see Pango markup format)

Signal Details

The "url-activated" signal

void        user_function                  (SexyUrlLabel *url_label,
                                            gchar        *url,
                                            gpointer      user_data)      : Run last / Action

The ::url-activated signal is emitted when a URL in the label was clicked.

url_label : The label on which the signal was emitted.
url : The URL which was activated.
user_data : user data set when the signal handler was connected.