diff options
author | Philip Chimento <philip.chimento@gmail.com> | 2019-08-03 17:19:32 -0700 |
---|---|---|
committer | Philip Chimento <philip.chimento@gmail.com> | 2019-08-13 21:07:56 -0700 |
commit | 49f42a5196bcf65ae10527a654666eb078bf6f08 (patch) | |
tree | 943af3d5b448e4df45518d5f420519854274ba96 /examples | |
parent | 386f85e8fc32762013c817386dfe8bf49b6cd02f (diff) | |
download | gjs-49f42a5196bcf65ae10527a654666eb078bf6f08.tar.gz |
js: Fix remaining eslint complaints
Some of these show that there were rules active that we didn't really
care about, so we disable those rules; others were fixed.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/gtk.js | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/examples/gtk.js b/examples/gtk.js index c3bf3836..36c4b5c7 100644 --- a/examples/gtk.js +++ b/examples/gtk.js @@ -7,7 +7,7 @@ const Gtk = imports.gi.Gtk; Gtk.init(null); // Construct a top-level window -let window = new Gtk.Window ({ +let win = new Gtk.Window ({ type: Gtk.WindowType.TOPLEVEL, title: 'A default title', default_width: 300, @@ -20,7 +20,7 @@ let window = new Gtk.Window ({ // Object properties can also be set or changed after construction, unless they // are marked construct-only. -window.title = 'Hello World!'; +win.title = 'Hello World!'; // This is a callback function function onDeleteEvent() { @@ -36,14 +36,14 @@ function onDeleteEvent() { // When the window is given the "delete_event" signal (this is given by the // window manager, usually by the "close" option, or on the titlebar), we ask // it to call the onDeleteEvent() function as defined above. -window.connect('delete-event', onDeleteEvent); +win.connect('delete-event', onDeleteEvent); // GJS will warn when calling a C function with unexpected arguments... // // window.connect("destroy", Gtk.main_quit); // // ...so use arrow functions for inline callbacks with arguments to adjust -window.connect('destroy', () => { +win.connect('destroy', () => { Gtk.main_quit(); }); @@ -60,13 +60,13 @@ let button = new Gtk.Button({ }); // Connect to the 'clicked' signal, using another way to call an arrow function -button.connect('clicked', () => window.destroy()); +button.connect('clicked', () => win.destroy()); // Add the button to the window -window.add(button); +win.add(button); // Show the window -window.show(); +win.show(); // All gtk applications must have a Gtk.main(). Control will end here and wait // for an event to occur (like a key press or mouse event). The main loop will |