Mailinglist Archive: opensuse (1377 mails)
| < Previous | Next > |
[S.u.S.E. Linux] Xlib programming
- From: ariggins@xxxxxxxx (Alan Riggins)
- Date: Mon, 03 Aug 1998 09:05:53 -0700
- Message-id: <35C5DFE1.DAD73B8B@xxxxxxxx>
I know this is slightly off the normal subject matter, but I'm getting
desperate, so here goes:
I need to create a read/write colormap for a Motif program. The
program offers the user the option of selecting colors via three scroll
bars (RGB values 0 to 64k). The color selected by the user should then
be stored in the colormap for use by the program.
Here's what I'm trying to do:
def_colormap = DefaultColormap(mydisplay, DefaultScreen(mydisplay);
for (i=0; i < NUMCOLORS; i++) /* NUMCOLORS = 256 */
{
Colors[i].pixel = i;
Colors[i].flags = DoRed | DoGreen | DoBlue;
}
XQueryColors(mydisplay, def_colormap, Colors, NUMCOLORS);
my_colormap = XCreateColormap(mydisplay, DefaultRootWindow(mydisplay),
DefaultVisual(mydisplay,
DefaultScreen(mydisplay)),
AllocAll);
XStoreColors(mydisplay, my_colormap,Colors,NUMCOLORS);
// XInstallColormap(mydisplay, my_colormap);
Any suggestions would be much appreciated.
--
/ / __ _ _ _ _ __ __
/ /__ / / / \// //_// \ \/ /
/____/ /_/ /_/\/ /___/ /_/\_\
mail to: ariggins@xxxxxxxx
-
To get out of this list, please send email to majordomo@xxxxxxxx with
this text in its body: unsubscribe suse-linux-e
| < Previous | Next > |