aboutsummaryrefslogtreecommitdiff
path: root/tests/test_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_main.c')
-rw-r--r--tests/test_main.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/tests/test_main.c b/tests/test_main.c
index c171192..5bef6d5 100644
--- a/tests/test_main.c
+++ b/tests/test_main.c
@@ -1,10 +1,10 @@
+#include <stdio.h>
+#include <saffron.h>
#include <SDL3/SDL.h>
-#include <saffron_api.h>
#include <SDL3/SDL_rect.h>
#include <SDL3/SDL_render.h>
-#include <saffron.h>
-/* PLEASE don't do this in production
+/* PLEASE don't do this in production!
* when wrappers are implemented,
* THEY will make draw functions for you
* THIS IS A BAD IDEA */
@@ -17,6 +17,12 @@ void my_test_draw(SaffronWidget* self, SDL_Renderer* renderer) {
SDL_RenderRect(renderer, &rect);
}
+/* YET AGAIN DONT DO THIS IN PROD PLEASE
+ * this is very lunatic */
+void my_test_onclick(SaffronWidget* self) {
+ printf("clicked!\n");
+}
+
int main(void) {
saffron_init();
@@ -30,6 +36,7 @@ int main(void) {
test->w = 200;
test->h = 150;
test->draw = my_test_draw;
+ test->on_click = my_test_onclick;
/* lunatic method 2 */
SaffronWidget* test2 = saffron_widget_new();