Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2019
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <curses.h>
  4.  
  5. void ramki()
  6. {
  7. int wys=LINES/2;
  8. int szer=COLS/2;
  9. int starty, startx;
  10.  
  11. starty=0;
  12. startx=0;
  13. WINDOW *win1 = newwin(wys, szer, starty, startx);
  14.  
  15. starty=0;
  16. startx=szer;
  17. WINDOW *win2 = newwin(wys, szer, starty, startx);
  18.  
  19. starty=wys;
  20. startx=0;
  21. WINDOW *win3 = newwin(wys, szer, starty, startx);
  22.  
  23. starty=wys;
  24. startx=szer;
  25. WINDOW *win4 = newwin(wys, szer, starty, startx);
  26.  
  27. int j;
  28. int ch;
  29. ch=getch();
  30. if(ch==9)
  31. {
  32. j=0;
  33. while(j<8)
  34. {
  35. if(j==0)
  36. {
  37. box(win1, 0, 0);
  38. wrefresh(win1);
  39. }
  40. if(j==1)
  41. {
  42. box(win2, 0, 0);
  43. wrefresh(win2);
  44. }
  45. if(j==2)
  46. {
  47. box(win3, 0, 0);
  48. wrefresh(win3);
  49. }
  50. if(j==3)
  51. {
  52. box(win4, 0, 0);
  53. wrefresh(win4);
  54. }
  55. if(j==4)
  56. {
  57. wborder(win1,' ',' ',' ',' ',' ',' ',' ',' ');
  58. wrefresh(win1);
  59. }
  60. if(j==5)
  61. {
  62. wborder(win2,' ',' ',' ',' ',' ',' ',' ',' ');
  63. wrefresh(win2);
  64. }
  65. if(j==6)
  66. {
  67. wborder(win3,' ',' ',' ',' ',' ',' ',' ',' ');
  68. wrefresh(win3);
  69. }
  70. if(j==7)
  71. {
  72. wborder(win4,' ',' ',' ',' ',' ',' ',' ',' ');
  73. wrefresh(win4);
  74. }
  75. ch=getch();
  76. if(ch==9)
  77. j++;
  78. if(ch==27)
  79. break;
  80. if(j==8)
  81. j=0;
  82. }
  83. }
  84. }
  85.  
  86. int main()
  87. {
  88. initscr();
  89. noecho();
  90. ramki();
  91. endwin();
  92. return 0;
  93. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement