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 » Tue Oct 01, 2019 8:34 am

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!

User avatar
ingsoc451
Citizen
Posts: 89
Joined: Sat Feb 06, 2016 9:42 pm
Location: Oceania

Re: loveframes column list selecting

Post by ingsoc451 » 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"}
eom

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

Re: loveframes column list selecting

Post by Coder567 » Tue Oct 01, 2019 3:31 pm

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 » Wed Oct 02, 2019 11:03 am

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: No registered users and 18 guests