Re: Complicated GdkWindow



La plume légère, à Fri, Jun 30, 2000 at 10:25:36AM +0800, heure d'inpiration,
Nengming Zhang écrivait en ces mots:
> I'm a new Gtker, I'd like to know the deferences between the following
> four _GdkWindows, where and when to use them, why not the other.   It
> seems it easy to program in Gtk when I read some examples.
> typedef struct _GdkWindow             GdkWindow;
> typedef struct _GdkWindow             GdkPixmap;
> typedef struct _GdkWindow             GdkBitmap;
> typedef struct _GdkWindow             GdkDrawable;
> 
> A GdkBitmap as a mask is somewhat confused me.
> GdkBitmap *mask = NULL;
> 

When GTK was designed, its designers saw that the X Windows, the X Pixmaps and
the X Bitmaps were equivalent enough that the same memory structure could be
used for all of them (and actually, they are the same type of objects).

If I am correct, an X Window is a screen area on an X display on which graphics
can be traced and which can receive events. At this level those objects have
the same level of complexity.

The difference is made when you create the actual object with gtk functions.
There are certain particularities that windows have, that pixmaps don't.
For what the bitmaps are concerned, they are just 1 bit depth pixmaps.
You could for example create a bitmap with gtk_pixmap function and by giving
them a 1 bit graphic context.

Why a gtkbitmap is used as a mask. Because a mask is simply an area which
describes basically which points can be drawn on screen (value = 1) and which
points can't (value = 0). As gdkbitmaps are 1 bit pixmaps, they fully fit this
role.


Wolfgang
-- 
A chicken is an egg's way of producing more eggs.




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