On Tue, 2008-03-18 at 15:22 +0200, Oskar Lönnberg wrote:
> I have been playing around with Clutter and I must admit that I am
> impressed by the toolkit.
>
> I was trying to embed the Clutter to a GTK window. But I ended up
> with problems. I was
> trying to handle all mouse motion, press and release events on the GTK
> window level,
no: you need to connect to the button press, release and motion events
on the ClutterStage. the GtkClutterEmbed widget will automatically
handle the events to propagate them to the embedded stage.
just call:
ClutterState *stage;
stage = gtk_clutter_embed_get_stage (GTK_CLUTTER_EMBED (embed));
g_signal_connect (stage, "button-press-event",
G_CALLBACK (on_button_press_event),
NULL);
etc.
the GtkClutterEmbed widget is a transparent wrapper around the
ClutterStage.
> but Clutter doesn't propagate these events to upper levels. The key
> press events are nicely
> delivered to the GTK main window level.
key events are handled differently, so they will get to the top-level
window unless you set the GTK_CAN_FOCUS flag and call
gtk_widget_grab_focus() on the GtkClutterEmbed widget.
> And also a small annoyance when using Clutter embedded into GTK window
> is that the I need to call
> clutter_actor_show_all() for stage even I am calling later on the
> gtk_widget_show_all()
this should have been fixed in SVN.
ciao,
Emmanuele.
--
Emmanuele Bassi, OpenedHand Ltd.
Unit R, Homesdale Business Centre
216-218 Homesdale Rd., Bromley - BR12QZ
http://www.o-hand.com
--
To unsubscribe send a mail to [EMAIL PROTECTED]