lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I can't seem to find anywhere how to provide a cell data function[1]
to a GtkTreeViewColumn using lgi. I'm doing:

gtk.TreeViewColumn { title = "Val", {
	gtk.CellRendererText { font = "monospace" },
	{ text = reg_column.Value, data_func = function(...)
		print("render", ...)
		return "x"
	  end },
}},

I tried cell_data_func as well, but both give the same error:
lua5.1: /usr/share/lua/5.1/lgi/override/Gtk.lua:363: attempt to
perform arithmetic on local 'column' (a function value)
stack traceback:
	/usr/share/lua/5.1/lgi/override/Gtk.lua:363: in function 'set'
	/usr/share/lua/5.1/lgi/override/Gtk.lua:379: in function 'add'
	/usr/share/lua/5.1/lgi/override/GObject-Object.lua:95: in function '_construct'
	/usr/share/lua/5.1/lgi/override/GObject-Object.lua:117: in function
</usr/share/lua/5.1/lgi/override/GObject-Object.lua:116>
	(tail call): ?
	(tail call): ?
	./system/interface/gtk/debugger/disasm.lua:163: in function 'create_controls'

Am I just using the wrong name, or is there more to this?

[1] http://en.wikibooks.org/wiki/GTK%2B_By_Example/Tree_View/Columns_and_Renderers
- a function that generates the actual string to display, usually for
formatting purposes.

-- 
Sent from my Game Boy.