I've updated to GJS 1.50 (and I've seen 1.54 is actually the latest) and
things are becoming better and better on daily basis.

Seeing that I can also extends Gtk classes without needing the (obsolete?)
Lang namespace is wonderful, yet beside having almost fully implemented
ES2015 syntax I've seen zero changes in terms of "camelCasization".

I've created a method that does only that [1] so that I can write code like
the following one and see it working without a glitch.

```js

const Gtk   = imports.gi.Gtk;
Gtk.init(null);

class Dialog extends camelPatched(Gtk.Window) {
  constructor(...args) {
    super(...args);
    this.connect('show', () => {
      this.setKeepAbove(true);
      Gtk.main();
    });
    this.connect('destroy', () => Gtk.main_quit());
  }
}

const win = new Dialog({
  type: Gtk.WindowType.TOPLEVEL,
  window_position: Gtk.WindowPosition.CENTER
});
win.setDefaultSize(200, 80);
win.add(new Gtk.Label({label: 'Hello GJS!'}));
win.showAll();

```

Now, I understand that properties and configuration objects might require
huge time/resources investment but can we please consider a migration plan
for at least camelCase methods?

Or could we at least add a method that does basically exactly the same
thing I am doing so that GJS could offer a more JS friendly environment?

Thanks in advance for any sort of outcome.


[1] https://gist.github.com/WebReflection/c1a438d90708e71cf1f2bd742a721311
_______________________________________________
javascript-list mailing list
javascript-list@gnome.org
https://mail.gnome.org/mailman/listinfo/javascript-list

Reply via email to