Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<X11/Xlib.h>
- #include<X11/Xutil.h>
- #include<stdio.h>
- //Makefile: gcc -o window window.c -L/usr/X11R6/lib -lX11
- int main(){
- //Creates Window
- Display *display;
- Window window, rootwindow;
- int screen;
- display = XOpenDisplay(NULL);
- screen = DefaultScreen(display);
- rootwindow = RootWindow(display,screen);
- window = XCreateSimpleWindow(display, rootwindow,0, 0, 100, 100, 1, 0, 0);
- XMapWindow(display, window);
- XFlush(display);
- //End (Window)
- //DrawLine Function:
- XDrawLine(display, d, gc, x1, y1, x2, y2){
- Display *display;
- Drawable d;
- GC gc;
- int x1, y1, x2, y2;
- }
- //Close Window
- sleep(10);
- XCloseDisplay(display);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment