Re: Clutter and GTK

On Thu, 2009-04-16 at 15:03 +0200, Diego Jacobi wrote:
> > On Thu, 2009-04-16 at 01:35 +0200, Diego Jacobi wrote:
> >> Is it possible to draw all GTK stuff inside a Clutter surface?
> >
> > no.
> And what is the current limitation to achieve this?

it's a limitation in gtk+, as I wrote below.

you could take a snapshot of a GtkWidget, get the GdkPixmap and then
draw the contents of the pixmap on the Cairo context provided by
ClutterCairoTexture but that:

  a) would be terribly inefficient
  b) would not offer any kind of user interaction
  c) would require that the widget is parented somewhere inside a gtk+
container widget

at the moment it's not possible to embed gtk+ widgets inside another
toolkit and have them behave like proper gtk+ widgets.

> >
> >> I want to try to develop some widgets with 3D animation (if available)
> >> (like transitions in a tabbed browsing), and i have read that Clutter
> >> cant create more than one Clutter-Gtk per window.
> >
> > no, multiple GtkClutterEmbed widgets can be added to the same window
> > since release 0.8.0.
> >
> >> So i am guessing if there is some sort of feature to enable to draw
> >> GTK completely inside of a Clutter window, and the widgets with its
> >> own animation will create its own surface.
> >
> > no. gtk+ does not currently allow embedding into other toolkits; the
> > client-side-window branch in git is the first step towards offscreen
> > redirection and embeddability.
> But a GtkWidget requires a TopLevel GdkWindow to do the drawings, and
> a GdkPixmap is a compatible drawable. It will only require to write a
> descendant of GdkWindow that draws to a Pixmap and requires no
> xwindow. Then i dont know how will this surface get the mouse and
> keyboard events.

yes, that's the main problem: event redirection would not work, thus
making it possible to display a gtk+ widget like a GtkButton but not
ever interact with it.

hopefully, the client-side-window branch will solve this.


Emmanuele Bassi,

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