Re: basic questions



Hi Luca,
here are some examples of what you need, I hope.

On Sun, 22 Jan 2012 09:38:50 +0100, Luca Vercelli <ororo email it> wrote:

Hi all,
I have some basic questions about development of extensions.

(1) Can I use more than 1 .js file inside the extension? How can I access files different from "extension.js" ?

Here's an example from https://extensions.gnome.org/extension/141/lame-extensions-manager/

const mgr = imports.ui.extensionSystem.extensions["ExtManager ilikepepper tk"];
const extManager = new mgr.manager.ExtManager;

(2) How can I catch the event "a window has been activated" ?

Here's an example from https://extensions.gnome.org/extension/59/status-title-bar/
        tracker.connect('notify::focus-app', Lang.bind(this, this._sync));

(3) How can I catch the event "a new window was just created"?

you can use 'window-added' event.
sample from workspace.js file:
this._windowAddedId = this.metaWorkspace.connect('window-added', Lang.bind(this, this._windowAdded));
for more examples:
$ grep -n window-added /usr/share/gnome-shell/js/ui/*

(4) and "a window was just destroyed" ?

you can use 'window-removed' event.
sample from workspace.js file:
this._windowRemovedId = this.metaWorkspace.connect('window-removed', Lang.bind(this, this._windowRemoved));
for more examples:
$ grep -n window-removed /usr/share/gnome-shell/js/ui/*


Thank you.


   --
Caselle da 1GB, trasmetti allegati fino a 3GB e in piu' IMAP, POP3 e SMTP autenticato? GRATIS solo con Email.it http://www.email.it/f
  Sponsor:
Conto Arancio al 4,20%. Soldi sempre disponibili, zero spese, aprilo in due minuti!
 Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=11923&d=22-1
_______________________________________________
gnome-shell-list mailing list
gnome-shell-list gnome org
http://mail.gnome.org/mailman/listinfo/gnome-shell-list


--
Using Opera's revolutionary email client: http://www.opera.com/mail/


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