{"id":28455491,"url":"https://github.com/kaliforniagator/window-go","last_synced_at":"2025-06-27T02:32:06.533Z","repository":{"id":294123675,"uuid":"985993990","full_name":"KaliforniaGator/Window-Go","owner":"KaliforniaGator","description":"Window-Go is an easy to use CLI GUI Library written in Go","archived":false,"fork":false,"pushed_at":"2025-05-19T22:41:26.000Z","size":3236,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-06T22:09:21.145Z","etag":null,"topics":["cli","go","gui","window"],"latest_commit_sha":null,"homepage":"https://gatorsecc.com","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KaliforniaGator.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-19T00:04:05.000Z","updated_at":"2025-05-19T22:41:29.000Z","dependencies_parsed_at":"2025-05-19T01:38:43.852Z","dependency_job_id":null,"html_url":"https://github.com/KaliforniaGator/Window-Go","commit_stats":null,"previous_names":["kaliforniagator/window-go"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/KaliforniaGator/Window-Go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KaliforniaGator%2FWindow-Go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KaliforniaGator%2FWindow-Go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KaliforniaGator%2FWindow-Go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KaliforniaGator%2FWindow-Go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KaliforniaGator","download_url":"https://codeload.github.com/KaliforniaGator/Window-Go/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KaliforniaGator%2FWindow-Go/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262177742,"owners_count":23270926,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","go","gui","window"],"created_at":"2025-06-06T22:09:23.945Z","updated_at":"2025-06-27T02:32:06.525Z","avatar_url":"https://github.com/KaliforniaGator.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Window-Go\n![Screen Shot 2025-05-18 at 10(1)](https://github.com/user-attachments/assets/0bfb3598-18e7-4615-b155-33580f1b7b2f)\n\n## Features\n\n### Window Core Features\n\n*   **Customization:**\n    *   Set window title and icon.\n    *   Define position (X, Y) and dimensions (Width, Height).\n    *   Choose from various box drawing styles (e.g., \"single\", \"double\").\n    *   Customize colors for title, border, background, and default content text.\n*   **Element Management:**\n    *   Add and remove UI elements dynamically.\n    *   Automatic focus management for interactive elements (Buttons, TextBoxes, CheckBoxes, RadioButtons, ScrollBars, Containers, TextAreas, MenuBars, Prompts).\n    *   Elements are rendered based on a Z-index, allowing for overlapping (e.g., submenus, prompts).\n*   **Interaction:**\n    *   Built-in raw terminal input handling for keyboard events (arrow keys, Enter, Tab, Shift+Tab, Backspace, Delete, printable characters, Ctrl+C).\n    *   Extensible key stroke handling via `KeyStrokeHandler` interface for custom window-level input processing.\n*   **Rendering:**\n    *   Efficient rendering using an internal buffer.\n    *   Automatic cursor management: shows cursor for active input elements (TextBox, TextArea), hides otherwise.\n    *   Smart title truncation with \"...\" for titles longer than available width.\n    *   Basic support for wide character and emoji display width in titles.\n\n\n![Screen Shot 2025-05-18 at 10(1)(1)](https://github.com/user-attachments/assets/d5bd3076-69da-4b08-8485-96815b113459)\n\n\n### UI Elements\n\n*   **Label:**\n    *   Displays simple text.\n    *   Customizable text color.\n    *   Positionable (X, Y relative to window content area).\n    *   Automatic word wrapping within the label's implicitly defined width (based on window content width and label's X position).\n*   **Button:**\n    *   Clickable button with customizable text.\n    *   Define normal and active (focused) colors.\n    *   Assign an action (callback function) to be executed on activation (Enter key).\n    *   Fixed width.\n*   **TextBox:**\n    *   Single-line editable text input field.\n    *   Normal and active (focused) color customization.\n    *   Cursor management (visible when active, moves with input).\n    *   Horizontal text scrolling if text exceeds width.\n    *   Pristine state: default text can be cleared on first input.\n*   **CheckBox:**\n    *   Toggleable checkbox with a label.\n    *   Normal and active (focused) color customization.\n    *   Can be checked or unchecked.\n*   **Spacer:**\n    *   Provides vertical empty space for layout purposes.\n*   **RadioButton \u0026 RadioGroup:**\n    *   Allows selection of one option from a group.\n    *   Each `RadioButton` has a label and an associated value.\n    *   Normal and active (focused) color customization.\n    *   `RadioGroup` manages the selection state of its buttons.\n*   **ProgressBar:**\n    *   Visual indicator of progress.\n    *   Set current value and maximum value.\n    *   Customizable colors for filled and unfilled portions.\n    *   Optionally displays percentage text.\n*   **GradientProgressBar:**\n    *   Progress bar with a two-color gradient fill.\n    *   Customizable start and end hex colors for the gradient.\n    *   Customizable color for the unfilled portion.\n    *   Optionally displays percentage text.\n*   **ScrollBar:**\n    *   Vertical scrollbar for indicating position within scrollable content.\n    *   Customizable height, current value, and maximum value.\n    *   Normal and active (focused) color customization.\n    *   Can be set to visible or hidden.\n    *   `OnScroll` callback triggered when value changes.\n*   **Container:**\n    *   Scrollable area for displaying a list of string content.\n    *   Manages an internal `ScrollBar` which becomes visible if content exceeds container height.\n    *   Supports item highlighting (via arrow keys when focused) and selection (via Enter key).\n    *   Customizable colors for default content and selected/highlighted item.\n    *   `OnItemSelected` callback triggered when an item is selected.\n*   **TextArea:**\n    *   Multi-line editable text input area.\n    *   Supports vertical scrolling with an internal `ScrollBar`.\n    *   Cursor management (visible when active, moves with input across lines and columns).\n    *   Text manipulation: insert characters (including newlines), delete (Backspace), delete forward (Delete).\n    *   Optional maximum character limit.\n    *   Displays word count and character count (optionally).\n    *   Normal and active (focused) color customization.\n*   **MenuBar, Menu, MenuItem:**\n    *   Hierarchical menu system.\n    *   `MenuBar` is the top-level container.\n    *   `Menu` can contain `MenuItem`s or other `Menu`s (submenus).\n    *   `MenuItem`s have text, can trigger an action, or open a submenu.\n    *   Customizable colors for items (normal/active) and menu background/borders.\n    *   Keyboard navigation (arrows, Enter, Escape).\n    *   Submenus appear with a Z-index above other elements.\n*   **Prompt:**\n    *   Displays messages to the user with interactive buttons.\n    *   Two styles: `SingleLinePrompt` and `DialogBoxPrompt`.\n    *   Customizable title, message, and button text/actions.\n    *   Customizable colors for background, border, title, and message.\n    *   `DialogBoxPrompt` can be modal, blocking interaction with elements behind it.\n    *   Keyboard navigation between buttons (Left/Right arrows or Tab for non-modal).\n    *   Renders with a high Z-index to appear above other content.\n\n\n![Screen Shot 2025-05-18 at 10(1)(2)](https://github.com/user-attachments/assets/ebc5c114-bd2d-4a25-b7dc-9a240d9c78da)\n\n### Box Drawing Styles\n\nThe following box drawing styles are available:\n* `single` - Single line borders (┌─┐│└┘)\n* `double` - Double line borders (╔═╗║╚╝)\n* `round` - Rounded corners (╭─╮│╰╯)\n* `bold` - Bold lines (┏━┓┃┗┛)\n\n![Screen Shot 2025-05-18 at 10(1)(3)](https://github.com/user-attachments/assets/ff618996-d19f-40f6-b7b9-095b18fb956e)\n\n### Color Support\n\nWindow-Go provides extensive color support through the `colors` package:\n\n* Regular Colors: red, green, yellow, blue, purple, cyan, gray, white, black\n* Bold Colors: bold_red, bold_green, bold_yellow, bold_blue, bold_purple, bold_cyan, bold_gray, bold_white, bold_black\n* Background Colors: bg_red, bg_green, bg_yellow, bg_blue, bg_purple, bg_cyan, bg_gray, bg_white, bg_black\n* Gray Shades: gray1, gray2, gray3, gray4, gray5\n* Background Grays: bg_gray1, bg_gray2, bg_gray3, bg_gray4, bg_gray5\n\nColors can be combined using the + operator: `colors.BgBlue + colors.BoldWhite`\n\n![Screen Shot 2025-05-18 at 10(1)(4)](https://github.com/user-attachments/assets/f72a0500-5e54-483c-8e9f-ab038480b112)\n\n### Helper Functions\n\n* `ClearScreen()` - Clears the terminal screen\n* `ClearScreenAndBuffer()` - Clears both screen and scrollback buffer\n* `MoveCursor(row, col)` - Positions cursor at specific coordinates\n* `HideCursor()` / `ShowCursor()` - Controls cursor visibility\n* `PrintColoredText()` - Print text with specified color\n* `PrintError()` / `PrintSuccess()` / `PrintWarning()` / `PrintInfo()` / `PrintDebug()` / `PrintAlert()` - Print formatted messages\n* `GetTerminalWidth()` / `GetTerminalHeight()` - Get terminal dimensions\n\n### Demo Applications\n\nThe project includes several demo applications showcasing different features:\n\n1. **Freedom Task** - Task management demo\n   * CRUD operations for tasks\n   * Priority levels with color coding\n   * Progress tracking\n   * Scrollable task list with selection\n\n2. **Segmented Notes** - Note-taking demo\n   * Split-pane interface\n   * Note list with selection\n   * Multi-line text editing\n   * Word and character counting\n\n3. **Menu Demo** - Menu system showcase\n   * Hierarchical menu structure\n   * Nested submenus\n   * Keyboard navigation\n   * Modal and non-modal interactions\n\n4. **Dialog Demo** - Dialog system showcase\n   * Single line prompts\n   * Modal dialog boxes\n   * Various dialog types (info, warning, error)\n   * Custom dialog configurations\n\n### Running the Demos\n\n```bash\n# Build and run a specific demo\nwindow-go -app \u003cnumber\u003e\n\n# Available demos:\nwindow-go -app 1    # Freedom Task\nwindow-go -app 2    # Segmented Notes\nwindow-go -app 3    # Menu Demo\nwindow-go -app 4    # Dialog Demo\n```\n\n### Common Key Bindings\n\n* `Tab` / `Shift+Tab` - Navigate between interactive elements\n* `Arrow Keys` - Navigate within elements (lists, menus)\n* `Enter` - Activate buttons, select items\n* `Escape` - Close menus, non-modal dialogs\n* `Backspace` / `Delete` - Text editing\n* `q` or `Ctrl+C` - Quit application\n\n### Element Hierarchy and Z-Index\n\nElements are rendered in layers based on their Z-index:\n1. Regular UI elements (default: 0)\n2. MenuBar (100)\n3. Menus and Submenus (150)\n4. Prompts and Dialogs (1000)\n\n### Custom Key Handling\n\nImplement the `KeyStrokeHandler` interface to add custom keyboard handling:\n```go\ntype KeyStrokeHandler interface {\n    HandleKeyStroke(key []byte, w *Window) (handled bool, needsRender bool, shouldQuit bool)\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaliforniagator%2Fwindow-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkaliforniagator%2Fwindow-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaliforniagator%2Fwindow-go/lists"}