Your SlideShare is downloading. ×
  • Like
Developing GNOME Apps in Javascript
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Now you can save presentations on your phone or tablet

Available for both IPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Developing GNOME Apps in Javascript

  • 215 views
Published

 

Published in Software , Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
215
On SlideShare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
0
Comments
0
Likes
1

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Developing GNOME Apps in Javascript Felipe Borges <felipeborges@gnome.org>
  • 2. Why talk about Gjs?
  • 3. GNOME is.... Desktop environment Development platform
  • 4. GNOME Developer Platform
  • 5. Javascript is pretty cool!
  • 6. It has bad parts! Globals Unexpected behaviour No block scope
  • 7. But it also has good parts! Closures are central Functions are first-class objects Prototypal inheritance Is everywhere!
  • 8. Gjs First released in 2008 Well maintained Main development language for writing GNOME Apps
  • 9. GNOME Apps in JS Documents Shell Polari
  • 10. gjs-console
  • 11. Get started Gjs and Gtk Actions and signals Run your application
  • 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. _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. Run your application let app = new App(); app.run(ARGV); $ gjs helloWorld.js
  • 15. http://developer.gnome.org/
  • 16. Become a Friend of GNOME Individual donation program Donations support the GNOME project http://gnome.org/friends
  • 17. Developing GNOME Apps in Javascript Felipe Borges <felipeborges@gnome.org>