[Sugar-devel] Native GTK activities with Javascript?

Sebastian Silva sebastian at fuentelibre.org
Thu Sep 21 15:29:22 EDT 2017


Thanks for your answer, but it is not what I meant.

If look at the link I provided, you'll see that it is now possible to
write Gtk3 apps in Javascript.

For instance, the following is a simple Hello World in Javascript:

#!/usr/bin/gjs

const Gtk = imports.gi.Gtk;
Gtk.init(null);

let win = new Gtk.Window();
win.connect("delete-event", Gtk.main_quit);
win.show_all();
Gtk.main();

Looks a lot like Python! But it's Javascript. I think this is pretty cool.

Here's a tutorial:
http://gjs-tutorial.readthedocs.io/en/latest/

And here's the API docs:
http://devdocs.baznga.org/ (this is where we should aim to put
sugar-toolkit-gtk)

From my research yesterday it would appear we would need to find a way
to generate a GIR file but I don't know how it all couples together.

This is what I was asking if somebody knew.

Hope I was more clear in my question now.

Thanks in advance.

Regards,
Sebastian

On 21/09/17 10:03, Tony Anderson wrote:
>
> cgi scripts
>
>
> Tony
>
>
> On 09/21/2017 02:06 AM, Sebastian Silva wrote:
>>
>> Hi,
>>
>> I've tinkered a little with gjs <https://wiki.gnome.org/Projects/Gjs>
>> and was wondering what would it take to access the sugar-toolkit-gtk3
>> from Javascript (or Vala for that matter?).
>>
>> Thanks in advance to any pointers.
>>
>> Regards,
>>
>> Sebastian
>>
>>
>>
>> _______________________________________________
>> Sugar-devel mailing list
>> Sugar-devel at lists.sugarlabs.org
>> http://lists.sugarlabs.org/listinfo/sugar-devel
>
>
>
> _______________________________________________
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20170921/f1118f64/attachment.html>


More information about the Sugar-devel mailing list