Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ZUIL

Caution

WIP

Important

NOT TESTED ON WINDOWS
the build.zig links some libraries as system libraries
which i assume doesnt work on windows


ZUIL (Zig UI Library)

retained mode gui framework written in zig

using sdl3, zopengl, plutosvg, harfbuzz and freetype libs


current plan

rendering:
replace renderer with a painter interface system and allow casting to the actual backend if its a know type for more advanced stuff

examples

widgets

widgets are created using builder functions

// .c for common builder functions
widgets.container()
.c.size(.{.dp = 1200}, .{.percentage = 1})
.color(colors.WHITE)
.child(
	widgets.list()
	.c.size(.fill, .fill) // fill is same as .{.percentage = 1}
	.direction(.vertical)
	.spacing(1)
	.children(.{
		widgets.icon()
		.c.size(.{.dp = 200}, .{.dp = 200})
		.c.keepSizeRatio(true)
		.icon("icon.svg")
		.build(),
		widgets.container()
		.c.size(.{.dp = 50}, .{.dp = 30})
		.c.eventCallback(containerClick) // fn (*ZWidget, *const ZEvent) callconv(.c) c_int
		.color(colors.rgb(0, 1.0, 0.5))
		.build(),
		widgets.container()
		.c.size(.{.pixel = 50}, .{.dp = 30})
		.build(),
		widgets.container()
		.c.size(.{.mm = 50}, .{.dp = 30})
		.build(),
		widgets.container()
		.c.size(.{.percentage = 0.5}, .{.dp = 30})
		.build(),
	})
	.build()
)
.build();

test project

there is a test/example project in the test directory

keybinds:

  • space: change the background color
  • F1: spawn a new window

project structure

directories in src dir:

  • core has the base widget system
  • app has sdl3 specific things and can be used to create windows that use the core widget system
  • widgets has the default widgets

About

WIP GUI framework written in zig

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages