Advertisement
Guest User

Untitled

a guest
Nov 17th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. static void
  2. file_manager(int width, int height, struct nk_context *ctx)
  3. {
  4. if (nk_begin(ctx, "File Manager", nk_rect(0, 0, width, height ),
  5. NK_WINDOW_NO_SCROLLBAR))
  6. {
  7. nk_layout_row_dynamic(ctx, height - 48, 2); /* todo figure out why there is border padding */
  8.  
  9. if (nk_group_begin(ctx, "File Tree", NK_WINDOW_BORDER))
  10. {
  11. if (nk_tree_push(ctx, NK_TREE_NODE, "/", NK_MAXIMIZED))
  12. {
  13. if (nk_tree_push(ctx, NK_TREE_NODE, "/bin", NK_MAXIMIZED))
  14. {
  15. nk_layout_row_dynamic(ctx, 30, 1);
  16. nk_label(ctx, "file 1", NK_TEXT_ALIGN_LEFT);
  17. nk_label(ctx, "file 2", NK_TEXT_ALIGN_LEFT);
  18. nk_label(ctx, "file 3", NK_TEXT_ALIGN_LEFT);
  19. nk_label(ctx, "file 4", NK_TEXT_ALIGN_LEFT);
  20. nk_tree_pop(ctx);
  21. }
  22. nk_layout_row_dynamic(ctx, 30, 1);
  23. nk_label(ctx, "dhtt", NK_TEXT_ALIGN_LEFT);
  24. nk_tree_pop(ctx);
  25. }
  26.  
  27. nk_group_end(ctx);
  28. }
  29.  
  30. if (nk_group_begin(ctx, "column2", NK_WINDOW_BORDER)) {
  31. nk_layout_row_dynamic(ctx, 30, 1);
  32. nk_label(ctx, "file 1", NK_TEXT_CENTERED);
  33.  
  34. nk_layout_row_dynamic(ctx, 30, 1);
  35. nk_label(ctx, "file 2", NK_TEXT_CENTERED);
  36.  
  37. nk_group_end(ctx);
  38. }
  39.  
  40. /* command prompt section */
  41. nk_layout_row_static(ctx, 30, width, 1);
  42. if (nk_group_begin(ctx, "command prompt", NK_WINDOW_BORDER))
  43. {
  44. nk_label(ctx, "ls /", NK_TEXT_ALIGN_LEFT);
  45.  
  46. nk_group_end(ctx);
  47. }
  48. };
  49. nk_end(ctx);
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement