[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: lgi / gtk : Coredump when trying to add a column in a treelist
- From: Laurent Faillie <l_faillie@...>
- Date: Mon, 08 Apr 2013 23:17:26 +0200
Hello,
I found a workaround by using autogenerated code using loadstring() as
bellow :
...
local code = [[
tree = Gtk.TreeView {
id = 'list',
model = list,
Gtk.TreeViewColumn {
title = "Ignore it ?",
sizing = 'FIXED',
fixed_width = 70,
{
Gtk.CellRendererToggle { id = 'ignored' },
}
},
]]
for i=1, #current_list do
code = code .. [[
Gtk.TreeViewColumn {
title = "]] .. current_list[i] .. [[",
{
Gtk.CellRendererText {}
}
},
]]
end
code = code .. "}"
loadstring( code )()
...
But it looks like a bit cumbersome. And I would like to understand why
my initial code doesn't work.
Thanks