Ekaterina Gerasimova
kittykat3756@gmail.com 2013
Gordon Hill
caseyweederman@gmail.com 2013

This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.

As a special exception, the copyright holders give you permission to copy, modify, and distribute the example code contained in this document under the terms of your choosing, without restriction.

Include bindings necessary to run your script.

# Gjs and Gtk

# Get started with GNOME

Gjs is a JavaScript binding for GNOME and can be used to interact with Gtk. Gtk is a toolkit for creating graphical user interfaces.

Open a text editor and paste in the lines of code. The complete script is available in the Summary.

Create an `object` using your `class` and call the `run()` method:

Call the Gjs JavaScript binding. This instructs the shell to run this script with Gjs.

#!/usr/bin/gjs

Import `gi.Gtk` for `Gtk` functions. As both version 3.0 and 4.0 may be installed, make sure that the desired version is imported first.

imports.gi.versions.Gtk = '3.0'; const Gtk = imports.gi.Gtk;