Re: Icon click event
- From: Florian Müllner <fmuellner gnome org>
- To: behrooz shafiee <shafiee01 gmail com>
- Cc: gnome-shell-list <gnome-shell-list gnome org>, javascript-list gnome org
- Subject: Re: Icon click event
- Date: Thu, 23 Jun 2011 23:19:30 +0200
Hey,
I'm CC'ing gnome-shell-list, which is probably a better place for this
question.
On Fri, 2011-06-24 at 01:02 +0430, behrooz shafiee wrote:
> i have an icon:
> let Icon = new St.Icon(icon_prop);
> and i want to bind on it a clicked or button-release-event, like a
> button!
> i dont know if it's possible or not!!
It is, but in order to receive events, an actor has to be
"reactive" (blame Clutter, not gnome-shell ;-)
To achieve that, just add
reactive: true
to icon_prop.
Though a better approach would probably be something like the following:
let icon = new St.Icon(iconProps);
let button = new St.Button({ child: icon });
button.connect('clicked', Lang.bind(this, this._onButtonClicked));
Florian
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]