Successfully reported this slideshow.
Your SlideShare is downloading. ×

Developing GNOME Apps in Javascript

Ad

Developing GNOME Apps in
Javascript
Felipe Borges
<felipeborges@gnome.org>

Ad

Why talk about Gjs?

Ad

GNOME is....
Desktop environment
Development platform

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Upcoming SlideShare
Javascript in Linux Desktop
Javascript in Linux Desktop
Loading in …3
×

Check these out next

1 of 18 Ad
1 of 18 Ad
Advertisement

More Related Content

Advertisement

Developing GNOME Apps in Javascript

  1. 1. Developing GNOME Apps in Javascript Felipe Borges <felipeborges@gnome.org>
  2. 2. Why talk about Gjs?
  3. 3. GNOME is.... Desktop environment Development platform
  4. 4. GNOME Developer Platform
  5. 5. Javascript is pretty cool!
  6. 6. It has bad parts! Globals Unexpected behaviour No block scope
  7. 7. But it also has good parts! Closures are central Functions are first-class objects Prototypal inheritance Is everywhere!
  8. 8. Gjs First released in 2008 Well maintained Main development language for writing GNOME Apps
  9. 9. GNOME Apps in JS Documents Shell Polari
  10. 10. gjs-console
  11. 11. Get started Gjs and Gtk Actions and signals Run your application
  12. 12. const Lang = imports.lang; const Gtk = imports.gi.Gtk; const App = new Lang.Class({ Name: 'App', Extends: Gtk.Application, _init: function () { this.parent({ application_id: 'org.example.App' }); this.connect('activate', Lang.bind(this, this._onActivate)); this.connect('startup', Lang.bind(this, this._onStartup)); },
  13. 13. _onActivate: function () { this._window.show_all(); }, _onStartup: function () { this._window = new Gtk.ApplicationWindow({ application: this, title: "Hello World!" }); this._window.set_default_size(200, 200); let label = new Gtk.Label({ label: "Hello World" }); this._window.add(label); } });
  14. 14. Run your application let app = new App(); app.run(ARGV); $ gjs helloWorld.js
  15. 15. http://developer.gnome.org/
  16. 16. Become a Friend of GNOME Individual donation program Donations support the GNOME project http://gnome.org/friends
  17. 17. Developing GNOME Apps in Javascript Felipe Borges <felipeborges@gnome.org>

×