modified: color
modified: color.c
This commit is contained in:
parent
2f1cb688b0
commit
e4d8e80042
39
color.c
39
color.c
@ -1,37 +1,28 @@
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <X11/Xlib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#define START_COLOR 0xffffff
|
||||
|
||||
int main() {
|
||||
int main(void) {
|
||||
Display *display;
|
||||
Window window;
|
||||
XEvent event;
|
||||
int screen;
|
||||
|
||||
|
||||
if((display = XOpenDisplay(NULL)) == NULL) {
|
||||
printf("There was an error opening the screen: %s\n", strerror(errno));
|
||||
exit(errno);
|
||||
d = XOpenDisplay(NULL);
|
||||
if (d == NULL) {
|
||||
fprintf(stderr, "Cannot open display\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
screen = DefaultScreen(display);
|
||||
|
||||
window = XCreateSimpleWindow(
|
||||
display,
|
||||
RootWindow(display, screen),
|
||||
w = XCreateSimpleWindow(display, RootWindow(display, screen),
|
||||
10, 10,
|
||||
1000, 1000,
|
||||
0,
|
||||
BlackPixel(display, screen),
|
||||
WhitePixel(display, screen));
|
||||
100, 100,
|
||||
1,
|
||||
BlackPixel(d, s),
|
||||
WhitePixel(d, s)); //last arg is color
|
||||
|
||||
XMapWindow(display, screen);
|
||||
XFlush(display);
|
||||
|
||||
//github testing
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user