1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 20:38:08 +01:00
Files
wmaker/WINGs/Examples/colorpick.c
Carlos R. Mafra 688a56e8ab Change to the linux kernel coding style
for arq in `git ls-files *.c`; do
    echo $arq;
    indent -linux -l115 $arq;
    done

The different line break at 115 columns is because
I use a widescreen monitor :-)
2009-08-20 00:59:40 +02:00

40 lines
692 B
C

#include <stdlib.h>
#include <stdio.h>
#include <WINGs/WINGs.h>
void showSelectedColor(void *self, void *cdata)
{
WMColorPanel *panel = (WMColorPanel *) self;
printf("Selected Color: %s\n", WMGetColorRGBDescription(WMGetColorPanelColor(panel)));
}
int main(int argc, char **argv)
{
Display *dpy;
WMScreen *scr;
WMInitializeApplication("wmcolorpick", &argc, argv);
dpy = XOpenDisplay("");
if (!dpy) {
printf("could not open display\n");
exit(1);
}
scr = WMCreateScreen(dpy, DefaultScreen(dpy));
{
WMColorPanel *panel = WMGetColorPanel(scr);
WMSetColorPanelAction(panel, showSelectedColor, NULL);
WMShowColorPanel(panel);
}
WMScreenMainLoop(scr);
return 0;
}