JosephABudd/kickzig
A zig application framework. A CLI that generates the framework code, adds and removes GUI components, adds and removes messages that the front-end an...
This page displays a few screen shots of tab-bars.
Each tab in a tab-bar now has the following attributes which are laid-out from left to right in the tab's rendering. Each optional attribute can be added, removed, and changed at any time. The required text for the label can be changed at any time.
Another attribute of a Tab is it's context menu. The context menu can be available or unavailable. The developer can also provide a tab with customized context menu items each with it's own call-back. (example: to save the form which has been edited.)
While the tab-bar has it's general settings that it applies to each tab, the developer can override those settings for individual tabs.
kickzig creates a framework that is ready to build and run as soon as you create it. There are 2 options for creating a framework.
kickzig framework
generates the source code for a framework that is ready to build and run.kickzig framework add-messages
generates the source code for a framework that is ready to build and run. The framework's front-end screens will have messengers to handle messages and channels for sending and receiving messages. The framework's back-end will have messengers to handle messages and channels for sending and receiving messages.Nota Bene: Currently, the kickzig generated framework must be built using zig version 0.1.0.
$ mkdir myapp
$ cd myapp
$ kickzig framework add-messages
$ zig fetch https://github.com/david-vanderson/dvui/archive/refs/tags/v0.1.0.tar.gz --save
$ zig build -freference-trace=255
$ ./zig-out/bin/myapp
The framework's front-end is a collection of screens. A screen is a layout of panels. When a screen is added to the framework it functions perfectly.
kickzig screen add-panel Edit Select Edit
creates a panel screen named Edit in the panel/ folder. The default panel is named Select and another panel is named Edit. By default the Select and Edit panels each display their screen and panel name. It's the developers job to edit any panel's file to achieve the propper functionality.
kickzig screen add-panel Remove Select Confirm
creates a panel screen named Remove in the panel/ folder. The default panel is named Select and another panel named Confirm. By default the Select and Confirm panels each display their screen and panel name. Again, it's the developers job to edit any panel's file to achieve the propper functionality.
A horizontal tab-bar layout lays the horizontal tab-bar above where the selected tab's content is displayed.
A vertical tab-bar layout lays the vertical tab-bar left of where the selected tab's content is displayed.
A tab's content can be any other screen of a panel in the same screen package.
kickzig screen add-tab Contacts Add *Edit *Remove
creates a tab screen named Contacts with 3 tab types ( Add, Edit, Remove ) and 1 instance of each tab running in the tab-bar as an example.
Below is the Contacts screen with the horizontal layout. I turned off the tab movement and closing buttons. Notice that the Remove tab is selected and is displaying the Remove content-screen.
Below is the Contacts screen with the vertical layout. Again, I turned off the tab movement and closing buttons. Notice that the Edit tab is selected and is displaying the Edit panel-screen.
Below is the Contacts screen with the vertical layout. Notice that the tab-bar is closed even though the Edit tab is selected and is displaying the Edit panel-screen.
Modal screens are the framework's dialogs. Like panel screens, modal screens display only one panel at a time.
When a modal screen is to be displayed, the framwork caches the current screen before displaying the modal screen. When a modal screen is finally closed, the framework gets that cached previous screen and displays it.
The OK modal screen and YesNo modal screen are part of the framework. They also work as examples for writing other types of dialogs although they do not have a messenger. The YesNo modal screen is interesting because it demostrates how to use call backs.
The EOJ modal screen is also part of the framework. It is only used in the shutdown process.
kickzig screen add-modal YesNoMaybe YesNoMaybe
creates a modal screen named YesNoMaybe with a panel named YesNoMaybe. It also creates a YesNoMaybe modal parameter for passing information to the screen's setState function.
kickzig screen remove YesNoMaybe
removes the screen named YesNoMaybe.
pub const show_developer_menu_items: bool = false;
in src/frontent/api.zig.The front-end and back-end communicate asynchronously using messages. Messages are sent and messages are received. There is no waiting for a message.
kickzig message add-bf «message_name»
will add a 1 way message which travels back-to-front.kickzig message add-fbf «message_name»
will add a 2 way message which travels front-to-back and back-to-front.kickzig message add-bf-fbf «message_name»
will add a message that is both 1 way and 2 way. That is to say that the back-end messenger has 2 different functions for sending a message.kickzig message remove AddContact
will remove the AddContact message from the framework.
kickzig message list
will display each message.
Front-end startup parameters are the only parameter passed to the front-end packages at startup. Back-end startup parameters are the only parameter passed to the back-end packages at startup.
The developer can add to the startup parameters.
close_down_jobs: *_closedownjobs_.Jobs
allows modules to add their shut down call back to be executed during the closing down process.exit: ExitFn
is the function called only when there is a fatal error. It starts the shut down process with an error message.main_loop:
in src/main.zig calls the closer module's fn close(user_message: []const u8) void
which starts the closing process.exit
which starts the closing process. Example below. self.receiveJob(message) catch |err| {
// Fatal error.
self.exit(@src(), err, "self.receiveJob(message)");
return err;
};