gtk.LinkButton — a button bound to a URL (new in PyGTK 2.10)
class gtk.LinkButton(gtk.Button): |
Functions
def gtk.link_button_set_uri_hook(func
, data
=None)
+--gobject.GObject +-- gtk.Object +-- gtk.Widget +-- gtk.Container +-- gtk.Bin +-- gtk.Button +-- gtk.LinkButton
|
The gtk.LinkButton
is available in PyGTK 2.10 and above.
A gtk.LinkButton
is a gtk.Button
with
a hyperlink, similar to the one used by web browsers, that triggers an
action when clicked. It is useful to show quick links to
resources.
A link button is created by calling the gtk.LinkButton constructor. The URI you pass to the constructor is used as a label for the widget.
The URI bound to a gtk.LinkButton
can be set specifically using the set_uri
())
method, and retrieved using the get_uri
()
method.
gtk.LinkButton
offers a global hook, which is called when the used clicks on it: see
the gtk.link_button_set_uri_hook
()
function.
gtk.LinkButton(uri
, label
=None)
| a valid URI |
| the text of the button or
None |
Returns : | a new link button widget. |
This constructor is available in PyGTK 2.10 and above.
Creates a new gtk.LinkButton
with the URI specified by uri
as its text if
label
is None
. If
label
is not None
, it is
used as the text of the button.
def get_uri()
Returns : | the associated URI. |
This method is available in PyGTK 2.10 and above.
The get_uri
() method returns the URI
set using the gtk.LinkButton.set_uri()
method or the gtk.LinkButton()
constructor.
def get_visited()
Returns : | True if the link has been visited,
False otherwise |
This method is available in PyGTK 2.14 and above.
The get_visited
() method retrieves the 'visited'
state of the URI where the GtkLinkButton points. The button becomes visited
when it is clicked. If the URI is changed on the button, the 'visited'
state is unset again.
def set_uri(uri
)
| a valid URI |
This method is available in PyGTK 2.10 and above.
The set_uri
() method sets the string
specified by uri
as the URI the gtk.LinkButton
points to.
def set_visited(visited
)
| the new 'visited' state. |
This method is available in PyGTK 2.14 and above.
The set_visited
() method setsthe 'visited' state
of the URI where the
gtk.LinkButton
points. See
gtk.LinkButton.get_visited
()
for more details.
def gtk.link_button_set_uri_hook(func
, data
=None)
| a function called each time a gtk.LinkButton
is clicked, or None |
| user data to be passed to
func |
This function is available in PyGTK 2.10 and above.
The gtk.link_button_set_uri_hook
() function
sets func
as the function that should be
invoked every time a user clicks a gtk.LinkButton
.
This function is called before every callback registered for the
"clicked" signal. If func
is
None
the current callback function will be
removed.