View Tooltip

It is a good practice to give more information for the end users of the application during interaction. Especially when our UI interfaces are quite complex and it is not obvious for the users what will happen on a certain actions. For this purpose each view in RUI library may have a tooltip which will popup while hovering over the view. To set the tooltip we utilize a "tooltip" property. That property accept a string value and can contain text in HTML format.

Example

Setting tooltip for the buttons in resource description file.

RUI

ListLayout {
    width = 100%,
    content = [
        Button {
            content = "Save",
            tooltip = "<b>Save</b> settings",
        },
        Button {
            content = "Cancel",
            tooltip = "<b>Discard</b> changes",
        }
    ]
}

Same but using the source code.

Go

view := rui.NewListLayout(session, rui.Params{
    rui.Width: rui.Percent(100),
    rui.Content: []rui.View{
        rui.NewButton(session, rui.Params{
            rui.Content: "Save",
            rui.Tooltip: "<b>Save</b> settings",
        }),
        rui.NewButton(session, rui.Params{
            rui.Content: "Cancel",
            rui.Tooltip: "<b>Discard</b> changes",
        }),
    },
})

And the result.

Tooltip