1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
|
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "libsx.h"
static void color_exec(Widget w, CSelData *cdata)
{
char cmd[256];
sprintf(cmd, "xsetroot -solid \\#%02X%02X%02X ",
(int)(cdata->r+0.5), (int)(cdata->g+0.5), (int)(cdata->b+0.5));
system(cmd);
}
int main(int argc, char **argv)
{
char *args[] = { "-bg" , "gray76", NULL };
char label[80];
char *ptr;
PredefArgs = args;
argc = OpenDisplay(argc, argv);
if (argc == FALSE)
return argc;
GetStandardColors();
INPUTBG = WHITE;
BUTTONBG = GetNamedColor("Gray84");
#ifndef Xaw
SetScrollbarDirection(-1);
#endif
ptr = getenv("LANG");
if (!strncmp(ptr, "de", 2))
strcpy(label, "Grund Farbe");
else
if (!strncmp(ptr, "fr", 2))
strcpy(label, "Couleur fond d'cran");
else
strcpy(label, "Background color");
SelectColor("40,80,120", 0, label, color_exec, NULL);
return(0);
}
|