libseed-list Advanced use of Gtk.TreeView



Hello Seed users/developers,

I'm writing my first extension for epiphany using Seed, and being
unfamiliar with Seed I got stuck on what is probably a dumb issue, and I
could use your help to carry on.
I'm using a Gtk.TreeView populated with a Gtk.TreeStore model. I need to
know when the selected item (cursor) changed, so I connect a callback to
the cursor_changed signal:

    treeview.signal.cursor_changed.connect(cursor_changed_cb)

and in the callback itself, I want to get hold of the cursor, and this
is where I fail miserably. I tried several things, but I couldn't get it
to work:

    var path = tree.get_cursor()
    print(path);
    // [undefined]

or:

    var path = new Gtk.TreePath();
    tree.get_cursor(path);
    print(path);
    // [object seed_struct]
    print(path.to_string());
    // GInvokeError Too few "in" arguments (handling this)

or:

    var path = new Gtk.TreePath.first();
    tree.get_cursor(path);
    print(path);
    // [object seed_struct]
    print(path.to_string());
    // segmentation fault!

I guess I'm not calling get_cursor correctly. Or am I hitting a bug?

Help on this is much appreciated! Thanks in advance,

Olivier


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