Skip to main content

hyperlink

Macro hyperlink 

Source
hyperlink!() { /* proc-macro */ }
Expand description

Creates a new hyperlink control. The format is hyperlink!("attributes") where the attributes are pairs of key-value, separated by comma, in the format key=value or key:value. If the value is a string, use single quotes to delimit the value. The following attributes are supported:

  • name or text - the text displayed by the hyperlink. If not specified, the url itself will be displayed.
  • url or link - the url the hyperlink points to (required)
  • tooltip - the text shown when the mouse hovers over the hyperlink
  • position attributes: x and y,
  • size attributes: width or w (alias)
  • margin attributes: left or l(alias), right or r(alias), top or t(alias), bottom or b(alias)
  • Alignment attributes:
    • align or a(alias) - one of Left, Right, Top, Bottom, Center, TopLeft, TopRight, BottomLeft, BottomRight
    • dock or d(alias) - one of Left, Right, Top, Bottom, Center, TopLeft, TopRight, BottomLeft, BottomRight
  • State attributes: enabled, visible

ยงExample

hyperlink!("name='AppCUI-rs', url='https://github.com/gdt050579/AppCUI-rs', tooltip='A cross-platform TUI framework for Rust', x=1, y=1, w=10")

Alternatively, the first parameter (if the key is not specified) is considered the name:

hyperlink!("'AppCUI-rs', url:'https://github.com/gdt050579/AppCUI-rs', x:1, y:1, w:10")