kellex

X11lib-CTemplate

Sep 10th, 2014
290
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.66 KB | None | 0 0
  1. #include<X11/Xlib.h>
  2. #include<X11/Xutil.h>
  3. #include<stdio.h>
  4.  
  5. //Makefile: gcc -o window window.c -L/usr/X11R6/lib -lX11
  6.  
  7. int main(){
  8.  
  9. //Creates Window
  10.  
  11. Display *display;
  12. Window window, rootwindow;
  13. int screen;
  14.  
  15. display = XOpenDisplay(NULL);
  16. screen = DefaultScreen(display);
  17. rootwindow = RootWindow(display,screen);
  18. window = XCreateSimpleWindow(display, rootwindow,0, 0, 100, 100, 1, 0, 0);
  19. XMapWindow(display, window);
  20. XFlush(display);
  21.  
  22. //End (Window)
  23.  
  24. //DrawLine Function:
  25.  
  26. XDrawLine(display, d, gc, x1, y1, x2, y2){
  27. Display *display;
  28. Drawable d;
  29. GC gc;
  30. int x1, y1, x2, y2;
  31. }
  32.  
  33. //Close Window
  34.  
  35. sleep(10);
  36. XCloseDisplay(display);
  37.  
  38. return 0;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment