add gui tab bar

main
Fabien Freling 2023-10-31 14:04:35 +01:00
parent 133b5a9559
commit ac2748ea6b
1 changed files with 5 additions and 4 deletions

View File

@ -35,9 +35,7 @@ fn loadSqlite(path: [:0]const u8) State {
pub fn main() !void {
var state = State{ .unloaded = {} };
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
defer _ = gpa.deinit();
const alloc = gpa.allocator();
const alloc = std.heap.c_allocator;
const args = try std.process.argsAlloc(alloc);
defer std.process.argsFree(alloc, args);
@ -50,10 +48,11 @@ pub fn main() !void {
const screen_width = 800;
const screen_height = 450;
raylib.InitWindow(screen_width, screen_height, "FabApp");
raylib.InitWindow(screen_width, screen_height, "Loggy");
raylib.SetTargetFPS(60);
var file_dialog_state = raylib.InitGuiWindowFileDialog(raylib.GetWorkingDirectory());
var active_tab: c_int = 0;
// const ext = ".sqlite3";
// @memcpy(file_dialog_state.filterExt[0..ext.len], ext);
@ -96,6 +95,8 @@ pub fn main() !void {
.loaded => |*db| {
_ = db;
var tabs = [_][*c]const u8{ "Fabs", "Marvel" };
_ = raylib.GuiTabBar(.{ .x = 20, .y = screen_height - 60, .width = screen_width - 40, .height = 40 }, &tabs, tabs.len, &active_tab);
},
}