Skip to main content

LinkButtonExt

Trait LinkButtonExt 

Source
pub trait LinkButtonExt:
    IsA<LinkButton>
    + Sealed
    + 'static {
    // Provided methods
    fn uri(&self) -> Option<GString> { ... }
    fn is_visited(&self) -> bool { ... }
    fn set_uri(&self, uri: &str) { ... }
    fn set_visited(&self, visited: bool) { ... }
    fn connect_activate_link<F: Fn(&Self) -> Propagation + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId { ... }
    fn connect_uri_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId { ... }
    fn connect_visited_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId { ... }
}
Expand description

Trait containing all LinkButton methods.

§Implementors

LinkButton

Provided Methods§

Source

fn uri(&self) -> Option<GString>

Retrieves the URI set using set_uri().

§Returns

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

Source

fn is_visited(&self) -> bool

Retrieves the “visited” state of the URI where the 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().

§Returns

true if the link has been visited, false otherwise

Source

fn set_uri(&self, uri: &str)

Sets uri as the URI where the LinkButton points. As a side-effect this unsets the “visited” state of the button.

§uri

a valid URI

Source

fn set_visited(&self, visited: bool)

Sets the “visited” state of the URI where the LinkButton points. See is_visited() for more details.

§visited

the new “visited” state

The ::activate-link signal is emitted each time the LinkButton has been clicked.

The default handler will call show_uri_on_window() with the URI stored inside the uri property.

To override the default behavior, you can connect to the ::activate-link signal and stop the propagation of the signal by returning true from your handler.

Source

fn connect_uri_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

Source

fn connect_visited_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§