How to to show nested tables in GUI?

Discuss your Lua playlist, album art and interface scripts.
147852369
Blank Cone
Blank Cone
Posts: 55
Joined: 01 Mar 2013 12:18

How to to show nested tables in GUI?

Postby 147852369 » 05 Feb 2015 23:12

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?

mederi
Big Cone-huna
Big Cone-huna
Posts: 1951
Joined: 15 Mar 2011 16:38
VLC version: 2.0.8
Operating System: Windows Vista/XP

Re: How to to show nested tables in GUI?

Postby mederi » 06 Feb 2015 21:09

I do not quite understand what exactly you need, but "<table>" html tag and related stuff is available to you.

147852369
Blank Cone
Blank Cone
Posts: 55
Joined: 01 Mar 2013 12:18

Re: How to to show nested tables in GUI?

Postby 147852369 » 07 Feb 2015 02:57

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.

mederi
Big Cone-huna
Big Cone-huna
Posts: 1951
Joined: 15 Mar 2011 16:38
VLC version: 2.0.8
Operating System: Windows Vista/XP

Re: How to to show nested tables in GUI?

Postby mederi » 15 Feb 2015 14:23

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


Return to “Scripting VLC in lua”

Who is online

Users browsing this forum: No registered users and 14 guests