[gnome-devel-docs] demos: Demo consistently includes lang and specified Gtk version.



commit ce4a4b6583be6923541c6450d98c54ecb779d907
Author: Sebastian Rasmussen <sebras gmail com>
Date:   Sat Feb 2 03:45:23 2019 +0100

    demos: Demo consistently includes lang and specified Gtk version.

 platform-demos/C/hello-world.js.page             | 2 ++
 platform-demos/C/samples/hello-in-js/hello-world | 2 ++
 2 files changed, 4 insertions(+)
---
diff --git a/platform-demos/C/hello-world.js.page b/platform-demos/C/hello-world.js.page
index ef02a04c..ec85e4e0 100644
--- a/platform-demos/C/hello-world.js.page
+++ b/platform-demos/C/hello-world.js.page
@@ -52,6 +52,8 @@
 
     <section id="imports"><title>Libraries to import</title>
       <code mime="application/javascript"><![CDATA[const Lang = imports.lang;
+
+imports.gi.versions.Gtk = '3.0'
 const Gtk = imports.gi.Gtk;]]></code>
       <p>In order for our script to work with GNOME, we need to import GNOME libraries via GObject 
Introspection. Here we import the language bindings and GTK+, the library which contains the graphical 
widgets used to make GNOME applications.  </p>
     </section>
diff --git a/platform-demos/C/samples/hello-in-js/hello-world 
b/platform-demos/C/samples/hello-in-js/hello-world
index 17aafac2..ed343506 100755
--- a/platform-demos/C/samples/hello-in-js/hello-world
+++ b/platform-demos/C/samples/hello-in-js/hello-world
@@ -1,5 +1,7 @@
 #!/usr/bin/gjs
 
+const Lang = imports.lang;
+
 imports.gi.versions.Gtk = '3.0'
 const Gtk = imports.gi.Gtk;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]