Module ui.widget.listview

Widget component that handles pagination for a list of items.

Example:

local list_view = ListView:new{
    height = 400,
    width = 200,
    page_update_cb = function(curr_page_num, total_pages)
        -- This callback function will be called whenever a page
        -- turn event is triggered. You can use it to update
        -- information on the parent widget.
    end,
    items = {
        FrameContainer:new{
            bordersize = 0,
            background = Blitbuffer.COLOR_WHITE,
            TextWidget:new{
                text = "foo",
                fact = Font:getFace("cfont"),
            }
        },
        FrameContainer:new{
            bordersize = 0,
            background = Blitbuffer.COLOR_LIGHT_GREY,
            TextWidget:new{
                text = "bar",
                fact = Font:getFace("cfont"),
            }
        },
        -- You can add as many widgets as you want here...
    }
}

Note that ListView is created mainly to be used as a building block for other widgets like NetworkSetting, so they can share the same pagination code.



generated by LDoc 1.4.6 Last updated 2017-08-17 09:26:49