Other things you can do with pixmaps

Another nice thing you can do with a pixmap or better a pixmask is defining your own shape for widgets or whole windows. This means you can have can have a button with rounded corners or a window with "holes" in it by using the shape_combine_mask method of GtkWidget.

The XPM specification allows the use of symbolic color names in the xpm. For example, if your pixmap should display a symbol of a button, the button could have the real button colors: light shadow, dark shadow and the normal flat surface color. The only thing you would have to do is writing something like this:
/* XPM */
static char * button[] = {
"16 16 3 1",
". s foreground",
"X s lightshadow",
"X s darkshadow",
"...pixels here"
};

Unfortunately, the Gtk, unlike CDE, does not support symbolic color names. So you cannot use them unless you define your own names and write a function which replaces the symbolic names by real colors.

Pixmaps are nice, but what if you want to display a jpg or png image? As the gtk libraries don't support this, you could use the gd or gd2 to transform the image to xpm format and go on with the normal xpm functions.