const std = @import("std"); const raylib = @import("raylib.zig"); const sqlite = @cImport({ @cInclude("sqlite3.h"); }); pub fn main() !void { const screen_width = 800; const screen_height = 450; raylib.InitWindow(screen_width, screen_height, "FabApp"); raylib.SetTargetFPS(60); var file_dialog_state = raylib.InitGuiWindowFileDialog(raylib.GetWorkingDirectory()); while (!raylib.WindowShouldClose()) { raylib.BeginDrawing(); defer raylib.EndDrawing(); raylib.ClearBackground(raylib.RAYWHITE); { if (file_dialog_state.windowActive) raylib.GuiLock(); defer raylib.GuiUnlock(); const button_size = 200; if (raylib.GuiButton(.{ .x = (screen_width - button_size) / 2, .y = (screen_height - button_size) / 2, .width = 200, .height = 200 }, "Load db file") == 1) { file_dialog_state.windowActive = true; } } raylib.GuiWindowFileDialog(&file_dialog_state); // // if (GuiButton((Rectangle){ 20, 20, 140, 30 }, GuiIconText(ICON_FILE_OPEN, "Open Image"))) fileDialogState.windowActive = true; } raylib.CloseWindow(); } test "simple test" { var list = std.ArrayList(i32).init(std.testing.allocator); defer list.deinit(); // try commenting this out and see if zig detects the memory leak! try list.append(42); try std.testing.expectEqual(@as(i32, 42), list.pop()); }