loveframes column list selecting

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
Coder567
Prole
Posts: 42
Joined: Sun Apr 07, 2019 12:32 pm

loveframes column list selecting

Post by Coder567 »

Hi
Does anyone know how to use loveframes column list selecting? I can't figure out how to get the column user clicks.
In below code I'm printing the row variables but no row index there

Code: Select all

list.OnRowSelected = function(parent, row, data)
  
    for k, v in ipairs(data) do
        print("Column " ..k.. ": " ..v)
    end
    
    for k, v in pairs(row) do
      if type(v) == "number" then
        print("row " ..k.. ": " ..v)
        end
    end
    
end
i tried already looking in the loveframes doc but there's no info about index


Also is it possible to change the color of the text on specific field in the list?


thanks!
monolifed
Party member
Posts: 188
Joined: Sat Feb 06, 2016 9:42 pm

Re: loveframes column list selecting

Post by monolifed »

https://github.com/linux-man/LoveFrames ... t.lua#L562
it doesn't pass index k to onrowselected. You might do this:

Code: Select all

onrowselected(self, row, row:GetColumnData(), k)
You might try using love's colored texts:

Code: Select all

text = {{1,0,0}, "red text"}
Coder567
Prole
Posts: 42
Joined: Sun Apr 07, 2019 12:32 pm

Re: loveframes column list selecting

Post by Coder567 »

ingsoc451 wrote: Tue Oct 01, 2019 2:46 pm https://github.com/linux-man/LoveFrames ... t.lua#L562
it doesn't pass index k to onrowselected. You might do this:

Code: Select all

onrowselected(self, row, row:GetColumnData(), k)
You might try using love's colored texts:

Code: Select all

text = {{1,0,0}, "red text"}
i don't get how that onrowselected works..

tried the color but didn't work

thanks
Coder567
Prole
Posts: 42
Joined: Sun Apr 07, 2019 12:32 pm

Re: loveframes column list selecting

Post by Coder567 »

I read from somewhere that loveframes is no longer maintained? could it be this isn't fully featured?
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 68 guests