Update Serbian translation from master branch
[wmaker-crm.git] / WINGs / Examples / colorpick.c
blob3d6a2dc4dce8be8b2baff49928ea454809b410c1
2 #include <stdlib.h>
3 #include <stdio.h>
4 #include <WINGs/WINGs.h>
6 void showSelectedColor(void *self, void *cdata)
8 WMColorPanel *panel = (WMColorPanel *) self;
10 (void) cdata;
11 printf("Selected Color: %s\n", WMGetColorRGBDescription(WMGetColorPanelColor(panel)));
14 int main(int argc, char **argv)
16 Display *dpy;
17 WMScreen *scr;
19 WMInitializeApplication("wmcolorpick", &argc, argv);
21 dpy = XOpenDisplay("");
22 if (!dpy) {
23 printf("could not open display\n");
24 exit(1);
27 scr = WMCreateScreen(dpy, DefaultScreen(dpy));
30 WMColorPanel *panel = WMGetColorPanel(scr);
32 WMSetColorPanelAction(panel, showSelectedColor, NULL);
34 WMShowColorPanel(panel);
37 WMScreenMainLoop(scr);
39 return 0;