demo_panel.c 571 B

123456789101112131415161718192021222324252627
  1. #include <rtgui/rtgui.h>
  2. #include <rtgui/rtgui_server.h>
  3. /*
  4. * Panel demo for 240x320
  5. * info panel: (0, 0) - (240, 25)
  6. * main panel: (0, 25) - (240, 320)
  7. */
  8. void panel_init(void)
  9. {
  10. rtgui_rect_t rect;
  11. /* register dock panel */
  12. rect.x1 = 0;
  13. rect.y1 = 0;
  14. rect.x2 = 240;
  15. rect.y2 = 25;
  16. rtgui_panel_register("info", &rect);
  17. /* register main panel */
  18. rect.x1 = 0;
  19. rect.y1 = 25;
  20. rect.x2 = 240;
  21. rect.y2 = 320;
  22. rtgui_panel_register("main", &rect);
  23. rtgui_panel_set_default_focused("main");
  24. }