Page 1 of 1

How to to show nested tables in GUI?

Posted: 05 Feb 2015 23:12
by 147852369
Hello,

is it possible to show nested tables in a GUI?

I want to display a table like this:
Info1 | Status | another column
Info2 | Status | another column


Is it possible with add_html and <td> within? Should I add_list twice and position these horizontal?
Do you have any ideas?

Re: How to to show nested tables in GUI?

Posted: 06 Feb 2015 21:09
by mederi
I do not quite understand what exactly you need, but "<table>" html tag and related stuff is available to you.

Re: How to to show nested tables in GUI?

Posted: 07 Feb 2015 02:57
by 147852369
I'm thinking about the performance of my extension.

Here's the repository: https://bitbucket.org/alibranic/vlc_extensions/src
Look at default branch.

There are the tables moveList and deleteList. The keys are autoincremented Integers and the values are paths of files to move or delete. I created moveListGUI and deleteListGUI with d:add_list() to show the content of these tables.

My extension became very big so I want to merge moveList and deleteList into one list. But I need to save the path and a status code for each row which indicates "to move", "to delete", "moved", "deleted" and so on.

In this way I could reduce the number of functions and lines of code.

A another idea was to get the playlist item's id and just save this as foreign key and the status code in my table.
I'm not sure.

Re: How to to show nested tables in GUI?

Posted: 15 Feb 2015 14:23
by mederi
You could define one universal table to store all entries. You could allow users to create additional custom lists for various purpose (moveList, deleteList, copyList, subPlaylist, ...). If you use table index for list id, then you just use key (index) of the selection to identify appropriate entry in the table (list, status, path). You could reduce the size of the dialog box: implement "show/hide" button for ListGUI (list widget) and all its necessary controls (buttons). ...

Code: Select all

Lists = {moveList, deleteList, ...} Statuses = {...} UniTable = { {moveList, status, path}, {deleteList, status, path}, {moveList, status, path}, {moveList, status, path}, ... } ListGUI = d:add_list(1,3,3,1) for i,v in ipairs(UniTable) do ListGUI:add_value("["..v[1].."]["..v[2].."] "..v[3], i) end local selected = ListGUI:get_selection() for k, v in pairs(selected) do list = UniTable[k][1] status = UniTable[k][2] path = UniTable[k][3] end