gui_element_button.h 578 B

123456789101112131415161718192021222324
  1. #pragma once
  2. #include <stdint.h>
  3. typedef struct GuiElement GuiElement;
  4. typedef enum {
  5. GuiButtonTypeLeft,
  6. GuiButtonTypeCenter,
  7. GuiButtonTypeRight,
  8. } GuiButtonType;
  9. typedef void (*ButtonCallback)(GuiButtonType button, void* context);
  10. /** Allocate Button Element
  11. * @param button_type GuiButtonType instance
  12. * @param text text on allocated button
  13. * @param callback ButtonCallback instance
  14. * @param context pointer to context
  15. */
  16. GuiElement* gui_button_create(
  17. GuiButtonType button_type,
  18. const char* text,
  19. ButtonCallback callback,
  20. void* context);