lua-users home
lua-l archive

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


Hello,

The development of my application is moving ahead : thanks to this list's participants :)

But I'm lost with methods calls : I'm trying to use GLib's KeyFile to store / retrieve the configuration and I found 
load_from_file methods and its C definition : http://developer.gnome.org/glib/2.32/glib-Key-value-file-parser.html#g-key-file-load-from-file

But I didn't find the way to convert this C interface to Lua/Lgi one.

My code is the following :

cfg_filename = GLib.get_user_config_dir() .. "/IMAPNotifyMe.conf"
local config = GLib.KeyFile
config:load_from_file( cfg_filename )

but I got the following error message :

lua: IMAPNotifyMe.lua:57: bad argument #1 to 'load_from_file' (GLib.KeyFile expected, got table)
stack traceback:
    [C]: in function 'load_from_file'
    IMAPNotifyMe.lua:57: in main chunk
    [C]: ?

Idem with simple methods like to_data :

config:to_data()

=>

lua: IMAPNotifyMe.lua:59: bad argument #1 to 'to_data' (GLib.KeyFile expected, got table)
stack traceback:
    [C]: in function 'to_data'
    IMAPNotifyMe.lua:59: in main chunk
    [C]: ?

Any tips ?

Bye

Laurent