diff options
| author | Arslaan Pathan <[email protected]> | 2026-05-03 08:02:11 +1200 |
|---|---|---|
| committer | Arslaan Pathan <[email protected]> | 2026-05-03 08:02:11 +1200 |
| commit | c622d906e7aafb66477a784ac14eda3ebf50d135 (patch) | |
| tree | 4d68f83430f937a9d9b618d88270f29a57f0a21f /tests/sfwk-minimal.c | |
| parent | ab7a235f895013343500a0a4fe478634c0a7b17d (diff) | |
| download | saffronwebkit-c622d906e7aafb66477a784ac14eda3ebf50d135.tar.xz saffronwebkit-c622d906e7aafb66477a784ac14eda3ebf50d135.zip | |
IT RUNS!!!!!!!!!
Diffstat (limited to 'tests/sfwk-minimal.c')
| -rw-r--r-- | tests/sfwk-minimal.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/tests/sfwk-minimal.c b/tests/sfwk-minimal.c index 192dbe6..68dcd3c 100644 --- a/tests/sfwk-minimal.c +++ b/tests/sfwk-minimal.c @@ -1,3 +1,4 @@ +#include "glib.h" #include <saffron.h> #include <saffronwebkit.h> @@ -10,9 +11,21 @@ bool hook_callback(SDL_Event* event) { return true; } +void btn_callback(SaffronButton* btn) { + // do nothing +} + int main() { + // if (!SDL_SetHint(SDL_HINT_VIDEO_DRIVER, "x11")) { + // printf("Warning: Could not set SDL_HINT_VIDEO_DRIVER\n"); + // } saffron_init(); + const char* driver = SDL_GetCurrentVideoDriver(); + printf("SDL is using driver: %s\n", driver); // please say x11 + + // make a button to prove the layout engine can move the webview around + SaffronButton* button = saffron_button_new(true, btn_callback, 200, 150); SaffronWindow* window = saffron_window_new("SaffronWebKit (SFWK) Test", 1024, 768); window->root->theme = SF_MACRO_DEFAULT_THEME; @@ -20,8 +33,11 @@ int main() { ctx = sfwk_init(); if (!ctx) return 1; - SFWKWebView* webview = sfwk_webview_new(ctx, "https://arslaancodes.com", 900, 600); + SFWKWebView* webview = sfwk_webview_new(ctx, "https://brickmii.xyz", 900, 600); + + saffron_widget_add_child(window->root, (SaffronWidget*)button); saffron_widget_add_child(window->root, (SaffronWidget*)webview); + webview->window = window; // so the webview can access the GL context saffron_hook_sdl_all_events(window, hook_callback, 999); |
