How are out-of-parameters options for GObject bindings for Seed JavaScript presented?

I just started using Seed for development. One thing the Seed webpage mentions is that it is "Maps C-isms (say arguments or enumerations) for things that make sense in JavaScript." Unfortunately, I cannot find any documentation or examples of how arguments should work. So, for example, the following call to Seed:

window.get_size()

Will return the error "GInvokeError Too few" from "arguments (processing)"

In C, a call will be expressed through two arguments:

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

I tried various permutations in the JavaScript call without success. I also looked at the documentation and sample code, but found nothing. Despite the code, I think I'm running out of options.

I would appreciate any insight that anyone can offer in this.

+3
source share
2 answers
var o1 = {};
var o2 = {};
window.get_size(o1, o2);

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

Here is an example at http://git.gnome.org/browse/seed/tree/tests/javascript/out-test.js (in the absence of documentation it is sometimes useful to look at the tests.)

+2
source

. - - params gtk_window_get_size, . , js, .

0

Source: https://habr.com/ru/post/1769189/


All Articles