Re: GtkTransparent



On Qua, 2006-07-12 at 23:47 +0900, Kouhei Sutou wrote:
> Hi,
> 
> In <1152712764 13123 50 camel localhost>
>   "Re: GtkTransparent" on Wed, 12 Jul 2006 14:59:24 +0100,
>   "Gustavo J. A. M. Carneiro" <gjc inescporto pt> wrote:
> 
> >   Can you stack GtkTransparent widgets?
> 
> Yes.
> 
> > If so, does it have the expected result with translucency?
> 
> Yes. See this screenshot:
>   http://pub.cozmixng.org/~kou/images/screenshot-gtktransparent.png

  This screenshot doesn't show translucency, only shaped widgets.

> 
> > If so, does it work correctly even with non-composite
> > aware X servers (most of them so far)?
> 
> Yes if gtk_widget_shape_combine_mask() can work with
> non-composite aware X servers.

  shape_combine_mask only works with bit bitmap masks; you can't get
translucency (alpha blending).

> 
> > What about performance; does each widget require a
> > separate X11 window?
> 
> No. GtkTransparent uses gtk_widget_shape_combine_mask().

  I see that it draws to the container window; but you still have one
bitmap per widget.

  If a widget draws in the parent window it should pay very much
attention to allocation.x and allocation.y.  I couldn't see this in your
examples (a bug?) and it could complicate matters a bit more.  Of course
the API could transparently do a translation so that programmers don't
have to deal with it, same as a canvas system would do.

> 
> >   And I'm not convinced that writing a gtk+ widget from scratch is
> > easier than writing a canvas item...
> 
> You can only implement expose-event callback. You don't need
> to write your GTK+ widget from scratch.

  With a canvas system -- if done right -- you also only need to
implement a sort of expose event callback.

  Anyway, I'm not saying that widgets is inherently worse than canvas
items, it's just that widgets usually tend to have X11 resources
associated, and so if you have a hundreds of widgets with only a few
inside the scrollable area the cost can be very high compared to a
canvas system, in which canvas items only have client-side resources
exclusively.

  There have been some discussions (havoc IIRC) regarding willingness to
have gtk+ widget system work more like a canvas, i.e. a single window,
all widgets drawing to the same toplevel window, etc.  That could an
interesting scenario; I hope it gets considered for gtk+ 3.0...

  Regards.

-- 
Gustavo J. A. M. Carneiro
<gjc inescporto pt> <gustavo users sourceforge net>
The universe is always one step beyond logic.

Attachment: smime.p7s
Description: S/MIME cryptographic signature



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