ae1695e4072920d695e329bafee4cf0fe67ebedd
[wmaker-crm.git] / WINGs / Examples / colorpick.c
blobae1695e4072920d695e329bafee4cf0fe67ebedd
2 #include <stdlib.h>
3 #include <stdio.h>
4 #include <WINGs/WINGs.h>
8 void showSelectedColor(void *self, void *cdata)
10 WMColorPanel *panel= (WMColorPanel*)self;
12 printf("Selected Color: %s\n", WMGetColorRGBDescription(WMGetColorPanelColor(panel)));
16 int main(int argc, char **argv)
18 Display *dpy;
19 WMScreen *scr;
21 WMInitializeApplication("wmcolorpick", &argc, argv);
23 dpy = XOpenDisplay("");
24 if (!dpy) {
25 printf("could not open display\n");
26 exit(1);
29 scr = WMCreateScreen(dpy, DefaultScreen(dpy));
32 WMColorPanel *panel= WMGetColorPanel(scr);
34 WMSetColorPanelAction(panel, showSelectedColor, NULL);
36 WMShowColorPanel(panel);
39 WMScreenMainLoop(scr);
41 return 0;