Zgt Versions Save

💻Build one codebase and get native UI on Windows, Linux and Web

v0.2.0

1 year ago

What's Changed

General

  • Add FreeBSD support by @zigster64 in https://github.com/zenith391/zgt/pull/6
  • Fix memory leak in calculator example by @iddev5 in https://github.com/zenith391/zgt/pull/7
  • Fix overflow in containers.zig by @frmdstryr in https://github.com/zenith391/zgt/pull/11
  • Add fn to create ImageData from png buffer using @embedFile by @frmdstryr in https://github.com/zenith391/zgt/pull/13
  • Add zgt.Scrollable which takes any component and makes it scrollable by adding scroll bars by @zenith391
  • Add zgt.Tabs as tab view (note: this component is not done yet)
  • Add readOnly property to TextField
  • Most widgets now use the peer's getPreferredSize, that is they are now of the correct size.
  • Add mouse motion event
  • Add Window.getChild to get the child widget of the window
  • Add Window.setIcon to set the icon (takes an ImageData)
  • Add Container.getAs as a shorthand for Container.get(...).as(...)
  • Expose animation lerp function as zgt.lerp, this is a lerp function for ints, floats and structs that have a lerp() function
  • In Row and Column, spacing between elements can now be controlled with .spacing (e.g. Row(.{ .spacing = 10 }, ...) for a spacing of 10 pixels)
  • Added mobile device 'emulation' by passing ZGT_MOBILE_EMULATED environment variable, this works similarly to Chrome and Firefox mobile emulation (that is, it only changes the size of the window)
  • Many fixes in layouting code now allow centering elements.

gtk backend

win32 backend

Note that the win32 backend is still basically pre-alpha and doesn't have feature parity with the gtk backend yet (although it might be reached by 0.2.1)

WebAssembly backend

  • Small fixes to make WASM backend compile with examples/demo by @TapioT in https://github.com/zenith391/zgt/pull/5
  • Added a dev server: WebAssembly apps can now be 'run' with a web server embedded in build.zig, this helps reduce dev time

C API

Some efforts have been started towards exporting zgt API to C. This will allow zgt to be used in any language with an FFI (given the C ABI is the lingua franca of programming languages).
Currently it is still at an early stage and only supports windows and buttons. See c_examples/zgt_app.c

Full Changelog: https://github.com/zenith391/zgt/compare/0.1.0...0.2.0

0.1.0

2 years ago

The first release of zgt.

This initial implementation has buttons, labels, text fields, canvas and containers.

The following backends are implemented:

  • GTK3, used for Linux (as of this release, it is the only 100% complete backend)
  • win32 (80% complete, misses a few features)
  • WebAssembly (20% complete)
  • OpenGL ES (0%, doesn't work)