IT IS JUST A PROTOTYPE FOR NOW AND SUBJECT TO HEAVYLY CHANGE
A new Terminal UI kit for go
Every ui element is a window (pencere) and ui is built by compositing new windows adding as child window. Every window can focus, receive mouse events, keyboard events, drag, drop, render and so on.
Pencere takes and dispatches terminal events to windows and renders windows based on Zindexes and window attributes like Visible and HasBorder
Every window has it's Layout event to change layout of itself or childs. Also every window has LayoutOrder attribute to take precedence on layout event order. So we can easly implement window slider where slider manages side windows layouts
Windows support Draggable,Droppable attributes to be come eligible for Drag and Drop events. OnDragBegin, OnDragEnd, OnDragging, OnDragEnter, OnDragOver, OnDragLeave, CanDrop and OnDrop events are supported.
Windows can receive keyboard events when they are focused. Managed by CanFocus attribute.
Windows suport mouse events and events canbe received if relavent eventhandler is implemented, if not event may be handled by parent windows
New event system will be implemented as message bus to support inter window communication
Windows has left right sidebar , top and bottom toolbars as window (pencere) means can be implemented as menu, toolbar or sticked toolboxes
Menu systems and menu events ( in progress)
Because usage of window ui is very elastic and mature concept, many many widgets and features can be implemented.
Inspired and used some code from these libraries. Basicly tried to be like and compatible to reuse of widgets and other stuff
-
https://github.com/nsf/termbox
- Pencere use termbox for base Terminal functions like rendering and events
-
https://github.com/gizak/termui
- Buffer struct taken so widgets are almost compatible with minimal modifications
-
https://github.com/cjbassi/termui
- Some widgets taken and converted
- Theming is inspired and taken (it subject to improve)
-
https://github.com/marcusolsson/tui-go
- Widgets are not dropin compatible but can easly be converted.
- Runebuffer taken