Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How are "out parameters" represented for Seed JavaScript GObject bindings?

I've just started using Seed for development. One thing that Seed's web page mentions is that it "Maps C-isms (say, out arguments, or enums) to things that make sense in JavaScript." Unfortunately, I can't find any documentation or examples for how out arguments should work. So, for example, the following call in Seed:

window.get_size()

Will return the error "GInvokeError Too few "out" arguments (handling out)"

In C, the call would be expressed by passing in two out arguments:

gtk_window_get_size(GTK_WINDOW(widget), &width, &height);

I've tried various permutations on the JavaScript call without success. I've also looked at the documentation and sample code, but haven't found anything. Short of looking at the code, I think I'm running out of options.

I'd appreciate any insight anyone can offer into this.

like image 477
jbeard4 Avatar asked Jul 21 '26 07:07

jbeard4


1 Answers

var o1 = {};
var o2 = {};
window.get_size(o1, o2);

var width = o1.value;
var height = o2.value;

There's an example in http://git.gnome.org/browse/seed/tree/tests/javascript/out-test.js (when lacking documentation it's sometimes useful to look at the tests.)

like image 160
Tommi Komulainen Avatar answered Jul 23 '26 22:07

Tommi Komulainen