Building a GnomeStockPixmapEntry from a GdkPixmap
- From: Dave Cole <dave dccs com au>
- To: gnome-devel-list gnome org
- Subject: Building a GnomeStockPixmapEntry from a GdkPixmap
- Date: 30 Mar 2000 23:02:14 +1000
After a long time of doing other things, I have decided to try to
devote more time on my little Gnome game, Gnocatan. I have an
unfinished upgrade to the version in the software map, and would like
to get it to a playable state.
One of the things I want to do is paint a collection of GdkPixmap
images and then turn them into gnome stock pixmaps to display in the
toolbar.
Currently I am loading PNG files into a GnomeStockPixmapEntry then
using gnome_stock_pixmap_register(). Something exactly like this:
#define GNOCATAN_PIXMAP_SHIP "gnocatan/ship.png"
GnomeStockPixmapEntryPath *entry;
entry = g_malloc0(sizeof(*entry));
entry->type = GNOME_STOCK_PIXMAP_TYPE_PATH;
entry->pathname = gnome_pixmap_file(GNOCATAN_PIXMAP_SHIP);
gnome_stock_pixmap_register(GNOCATAN_PIXMAP_SHIP,
GNOME_STOCK_PIXMAP_REGULAR,
(GnomeStockPixmapEntry *)entry);
Then using a GnomeUIInfo structure like this:
{ GNOME_APP_UI_ITEM, N_("Ship"), NULL,
client_event_cb, (gpointer)GUI_SHIP, NULL,
GNOME_APP_PIXMAP_STOCK, GNOCATAN_PIXMAP_SHIP, 0, 0, NULL },
I would really like to paint the pixmap in the program as it will
allow me to do nice things like get the shape correct and set the
colour of the shape according to the player colour you have been
assigned.
I have been looking at the gnome-stock and gnome-pixmap API and have
gotten my little brain all confused. I am sure one of the clever
people out there can point me in the right direction...
- Dave
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]