Module ui.widget.radiobuttonwidget

Widget that allows selecting an entry from a RadioButton list.

Example:

local RadioButtonWidget = require("ui/widget/radiobuttonwidget")

local radio_buttons = {
    { {text = _("Radio 1"), provider = 1} },
    { {text = _("Radio 2"), provider = 2, checked = true} },
    { {text = _("Radio 3"), provider = "identifier"} },
}
UIManager:show(RadioButtonWidget:new{
    title_text = _("Example Title"),
    info_text = _("Some more information"),
    cancel_text = _("Close"),
    ok_text = _("Apply"),
    width_factor = 0.9,
    radio_buttons = radio_buttons,
    callback = function(radio)
        if radio.provider == 1 then
            -- do something here
        elseif radio.provider == 2 then
            -- do some other things here
        elseif radio.provider == "identifier" then
            -- or do a third thing here
        end
    end,
})



generated by LDoc 1.4.6 Last updated 2022-11-28 07:59:11