Re: clutter: python3 button press event




On Mon, October 22, 2012 8:34 pm, Lionel Landwerlin wrote:
I'm not python expert, but why not trying something like this :

box = self.get_allocation_box()
self.__draw_shape(box.x2 - box.x1, box.y2 - box.y1, pick_color)


Ok, thanks for your help. That is working now.

Couldn't see the forest for the trees :-)



-Lionel

On 22/10/12 10:31, Patrick Shirkey wrote:
On Mon, October 22, 2012 8:27 pm, Lionel Landwerlin wrote:
It looks like the pick function is not implemented correctly.
It's code is commented out.

I get this error with it enabled:

Traceback (most recent call last):
   File "shapes.py", line 128, in do_pick
     (x1, y1, x2, y2) = self.get_allocation_box()
TypeError: 'ActorBox' object is not iterable



-Lionel

On 22/10/12 10:19, Patrick Shirkey wrote:
On Mon, October 22, 2012 7:55 pm, Emmanuele Bassi wrote:
hi;

On 22 October 2012 09:31, Patrick Shirkey<pshirkey boosthardware com>
wrote:
On Mon, October 22, 2012 6:57 pm, Lionel Landwerlin wrote:
You might want to make sure that roundrect is reactive.

           roundrect.set_reactive(True)

Thanks for the tip but it didn't work for me.
this is... not good. can you describe your environment?

- I have put the code up here:

http://boosthardware.com/code/clutter-keyboard.tar.bz2

I'm hoping it is just user error.


- I borrowed the base code from the pyclutter-widgets which is working
with python2 and I have converted it to python3.

- Tested on Fedora 16&   17 and Debian wheezy

On Fedora 16 I am running:

Name        : clutter
Arch        : i686
Version     : 1.8.4

Name        : cogl
Arch        : i686
Version     : 1.8.2

Name        : python3-gobject
Arch        : i686
Version     : 3.0.3


On f17 I have :

Name        : clutter
Arch        : i686
Version     : 1.10.8

Name        : cogl
Arch        : i686
Version     : 1.10.2

Name        : python3-gobject
Arch        : i686
Version     : 3.2.2




Should I be using

      roundrect.connect("button-press-event", on_click)
yes, you should use connect(); only reactive actors emit
event-related
signals, so you'll also need to set the reactive property to True.

Or should I be calling add_action() to handle click events?
ClutterAction implementations merely use the event-related signals,
and the actor still needs to be reactive.

ciao,
   Emmanuele.

--
W: http://www.emmanuelebassi.name
B: http://blogs.gnome.org/ebassi/

--
Patrick Shirkey
Boost Hardware Ltd
_______________________________________________
clutter-list mailing list
clutter-list gnome org
https://mail.gnome.org/mailman/listinfo/clutter-list


--
Patrick Shirkey
Boost Hardware Ltd
_______________________________________________
clutter-list mailing list
clutter-list gnome org
https://mail.gnome.org/mailman/listinfo/clutter-list

_______________________________________________
clutter-list mailing list
clutter-list gnome org
https://mail.gnome.org/mailman/listinfo/clutter-list



--
Patrick Shirkey
Boost Hardware Ltd



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