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.

Como unha excepción especial, os propietarios do copyright danlle permiso para copiar, modificar e distribuír o código de exemplo contido neste documento baixo os termos da súa elección, sen restricións.

Bind functions to events using Lang.
Fran Diéguez
frandieguez@gnome.org 2009-2020.
Leandro Regueiro
leandro.regueiro@gmail.com 2011.

# Actions and signals

# Get started with GNOME

Gtk has a set of predefined events that you can use in your application.

Declare `HelloWorld` as a new class.

class HelloWorld {

`constructor` is called when a new instance is created. Create a `GtkApplication`, then connect `activate` to the existing Gtk event `_onActivate` and `startup` to `_onStartup`:

constructor() { this.application = new Gtk.Application(); this.application.connect('activate', this._onActivate.bind(this)); this.application.connect('startup', this._onStartup.bind(this)); }

Show the window upon application activation:

_onActivate() { this._window.show_all(); }