codecaine-zz/simple_gg

simple_gg is a lightweight, beginner-friendly UI framework for building native, hardware-accelerated desktop applications in V. Built on top of V's native gg graphics module (powered by Sokol), simple_gg delivers smooth performance and uniform UI rendering across macOS, Linux, and Windows.

V

10

81 commits

updated Sep 13, 2026

See the code

See what people are saying

SourceMessageScoreDate

V Language Review (2023)

Looks too weird to repost an old 2023 rant about an alpha or very old version of a language, in 2026. Particularly when it's full of outdated, questionable, or outright misinformation. Languages in development are not static, they change. * VUI, Delphi-like visual editor, iOS support There is now…

0

Sep 28, 2026

README

simple_gg - Cross-Platform SimpleGUI for V

simple_gg is a lightweight, beginner-friendly UI framework for building native, hardware-accelerated desktop applications in V. Built on top of V's native gg graphics module (powered by Sokol), simple_gg delivers smooth performance and uniform UI rendering across macOS, Linux, and Windowswithout relying on external C/Obj-C dependencies.


Visual Showcase & Snapshots of All Examples

Modern UI Suite & Ergonomic Enhancements Demo Custom 3D Image Dialogs Demo

Modern Image Controls Demo Super Controls Suite Demo

RAD Controls Showcase Dashboard App Demo

Click to view remaining example screenshots (19 more)

Quickstart Demo 02 - Theme Gallery Demo

04 - Component Gallery Demo 05 - Nameless Shortcuts Demo

07 - Advanced Controls Demo 08 - RAD Application Builder Demo

09 - Control Customization Demo 10 - More UI Controls Demo

11 - Data Table Pro Demo 12 - System & Stdlib Toolkit Demo

13 - Reactive State Store Demo 15 - Modern UI Features Showcase Demo

16 - Interval Timers Demo 17 - Data & Event Binding Demo

18 - Custom Font Typography Demo 19 - Cross-Window Spy Demo

20 - Stdlib Data Structures Demo 21 - Extended OS System Calls Demo


Key Features

  • Cross-Platform: Runs natively on macOS, Linux, and Windows with native OS drag-and-drop support.
  • 87 Built-in Production Themes: The complete 76-theme Bun RAD Studio catalog plus SimpleGUI exclusives, with theme-specific surfaces, borders, secondary accents, and accessible button contrast.
  • RAD Development Controls Suite: Multi-select Tag Input, Dual-Thumb Range Slider, Monospace Code Editor, File Drop Zone, Property Grid Inspector, Sparkline Micro-Charts, Pagination Bar, Resizable Split View, Toast Notification Overlay Stack, Command Palette (Ctrl+K), and Context Menus.
  • Complete Widget Set: ListBox (interactive single/multi select), ComboBox, Transfer List, Console Output Viewer, Color Palette Swatch Grid, Status Bar, Step Slider, text/password inputs, steppers, range sliders, toggle switches, checkboxes, dropdowns, segmented controls, rating stars, date pickers, metric cards, charts, tree views, data tables, breadcrumbs, avatars, status badges, accordions, and alert banners.
  • Layout Engine: Automatic vertical stacking, horizontal rows (begin_row), multi-column grids (begin_grid), flexboxes (begin_flex_box), tab containers, and group cards.
  • Reactive State Management & Universal Persistence (state.v): Key-value reactive store (set_state, get_state), typed accessors, reactive state listeners (on_state_change), atomic crash-proof disk persistence (save_app_state, load_app_state), automated per-application form state restoration on launch, global theme auto-save, and window session restoration (save_window_session, restore_window_session).
  • OS & System Extensions (sys.v): Standardized user directory lookups for macOS (~/Library), Windows (%APPDATA%), and Linux ($XDG_*), path expansion with tilde (~) and environment variable resolution, native notifications, hardware metrics, process execution, clipboard, and file operations.
  • Headless Console & RAD Toolkit (simplecli): Full-featured zero-window CLI framework with flag parsing, ANSI colors, tables, interactive prompts, multi-level logging, process control, hardware probing, and cryptography.
  • V Standard Library Integrations (stdlib.v): Built-in fluent helpers for HTTP requests, RegEx matching, Cryptography (SHA256, MD5, AES, Bcrypt), Gzip/Zlib/Zstd compression, TOML parsing, SemVer checks, and WebSockets.
  • 30 Bundled Production Utility Modules (vlang_utils): Zero-boilerplate ergonomic toolkit ready to import anywhere (fileutils, sqliteutils, strutils, sliceutils, envutils, cryptoutils, timeutils, httputils, cliutils, sysutils, netutils, validutils, structutils, statutils, stateutils, cacheutils, semverutils, flowutils, templateutils, colorutils, archiveutils, asyncutils, regexutils, mockutils, logutils, tomlutils, htmlutils, bitutils, compressutils, tarutils). Full manual in UTILS_API.md.
  • Beginner Friendly: Fluent chainable builder API with zero boilerplate.

📦 Installation & Module Setup

This repository is currently published under the GitHub repo name simple_gg, but the V module you import is simplegui.

If you cloned the project manually, put it in your V module path so imports resolve correctly:

git clone https://github.com/codecaine-zz/simple_gg.git
mkdir -p ~/.vmodules
ln -s "$PWD/simple_gg/simplegui" ~/.vmodules/simplegui

Then run examples from the project directory or from any project that imports simplegui.

If the package is later published to VPM under a matching name, the standard v install ... flow will work as usual. For this repo today, linking the repository's simplegui/ directory at ~/.vmodules/simplegui is the reliable Linux/macOS workflow.

2. Install Homebrew dependencies (macOS)

For a default install on macOS, run the project’s bundled Homebrew installer:

./install_homebrew_dependencies.sh

This installs the required runtime tools used by the project and apps, such as FFmpeg, ImageMagick, jq, rg, pandoc, sqlite, nmap, and related toolchain utilities.

If you also want optional cross-compilation toolchains for Windows builds, install them explicitly:

./install_homebrew_dependencies.sh --optional

This adds zig and mingw-w64, which are only needed for Windows-targeted builds and are not required for the normal app runtime.

You can also install only the base bundle directly:

brew bundle --file ./Brewfile

3. Linux System Dependencies

On Linux (Debian / Ubuntu / Pop!_OS / Mint), ensure standard X11/GL development headers are present:

# The project dependency checker is cross-platform and will show Linux guidance:
v run install_dependencies.vsh --check

# Or install manually via apt:
sudo apt update
sudo apt install -y libx11-dev libxcursor-dev libxi-dev libgl1-mesa-dev libasound2-dev xclip

4. Naming & Import Convention

ElementNameDescription
Repository Namesimple_ggThe GitHub project name (SimpleGUI built on V's gg engine).
V Module NamesimpleguiUsed in all code across macOS, Linux, and Windows: import simplegui
Headless CLI ModulesimplecliZero-window terminal apps across all platforms: import simplecli

5. V Compiler Version & v up Maintenance

simple_gg is developed and validated against V 0.5.2 (commit 9e9f7f05 / V3 compiler backend). All 43 test suites, 30 GUI demos, 29 examples, 47 desktop workstations, and 49 CLI tools are tested and verified on this build.

⚠️ Caution with v up

Running v up directly pulls rolling changes from the V master branch, which can occasionally introduce compiler bootstrap issues or codegen regressions:

  • cheaders.v / EmbedFileData Panic: If v up pulls a commit where embedded C headers are restructured before the bootstrap pre-built vc sources are synchronized, running v will fail with:
    V panic: EmbedFileData error: files ... cheaders.v do not exist
    
  • Interface Dispatch Mismatches (json2, io.Reader): Upstream master changes can affect generic interface method dispatch parameter resolution (e.g., when streaming io.Reader in json2 encounters types with zero-parameter read methods).

🔄 How to Safely Rebuild / Recover V

If running v up leaves your V installation broken or unable to compile, restore it cleanly from bootstrap C code (vc):

cd /path/to/v

# 1. Fetch latest changes or pin to verified commit
git fetch origin
git checkout 9e9f7f05   # Verified working commit (or master)

# 2. Bootstrap from the official vc repository
git clone --depth 1 https://github.com/vlang/vc /tmp/vc
cc -std=gnu99 -w -o v /tmp/vc/v.c -lm -lpthread

# 3. Recompile V self-hosted
./v self

# 4. Clean out any obsolete fallback caches
rm -rf ~/.cache/v/v1-fallback

💡 Environment Flag (VFLAGS) Best Practice

On macOS with Homebrew, if you set library search paths via VFLAGS in ~/.zshrc or ~/.bashrc, specify -ldflags separately for each path to avoid argument-splitting failures during recursive sub-invocations (e.g. v test or v crun):

# ✅ Recommended (avoids nested quoting errors in subshells):
export VFLAGS="-ldflags -L/opt/homebrew/lib -ldflags -L/usr/local/lib"

# ❌ Avoid (inner quotes break argument tokenization in V child processes):
# export VFLAGS="-ldflags '-L/opt/homebrew/lib -L/usr/local/lib'"

Quick Start

module main

import simplegui

fn main() {
	mut win := simplegui.new_simple_window('My App', 520, 380)
	win.set_theme('Apple Dark')
	win.add_heading('SimpleGUI Starter')
	win.add_form_field('Name:', 'username', 'Ada Lovelace')
	win.add_checkbox('agree', 'I agree to the Terms', true)

	win.add_button('btn_save', 'Save')
	win.on_click('btn_save', fn (mut win simplegui.SimpleWindow) {
		println("User: ${win.get_text('username')}")
	})

	win.run()
}

Beginner-Friendly Examples & Snapshots

The repository includes beginner-friendly example programs in the examples/ directory:

ExampleDescriptionRun CommandSnapshot
01_quickstart.vFirst starter app with inputs and button callbacks.v run examples/01_quickstart.v Snapshot
02_theme_gallery.vComplete tabbed control gallery with an always-visible live switcher across 87 production palettes.v run examples/02_theme_gallery.v Snapshot
03_layout_containers.vHorizontal rows, multi-column grids, and group cards.v run examples/03_layout_containers.v Snapshot
04_widgets_and_forms.vForm inputs, sliders, steppers, ratings, dates, and metric cards.v run examples/04_widgets_and_forms.v Snapshot
05_nameless_shortcuts.vRapid prototyping using nameless shortcuts (win.input()).v run examples/05_nameless_shortcuts.v Snapshot
06_dashboard_app.vReal-world dashboard with KPI metrics, charts, and actions.v run examples/06_dashboard_app.v Snapshot
07_advanced_controls.vData tables, tab containers, tree views, search, breadcrumbs, avatars, and shortcuts.v run examples/07_advanced_controls.v Snapshot
08_rad_development.vRapid app builder with batch ops, JSON form export, clipboard, and OS dialogs.v run examples/08_rad_development.v Snapshot
09_control_customization.vCustom geometry, margins/padding, colors, borders, and fluent control chaining.v run examples/09_control_customization.v Snapshot
10_more_controls.vIcon buttons, toolbars, hyperlinks, checklists, chips, and password strength meter.v run examples/10_more_controls.v Snapshot
11_data_table_pro.vSortable data tables, wheel scrolling, row hover, and table manipulation.v run examples/11_data_table_pro.v Snapshot
12_system_and_stdlib_features.vDesktop notifications, hardware specs, clipboard, system paths, HTTP GET, RegEx, Crypto.v run examples/12_system_and_stdlib_features.v Snapshot
13_reactive_state_store.vReactive key-value state store, typed accessors, state change listeners, and JSON disk persistence.v run examples/13_reactive_state_store.v Snapshot
14_rad_controls_showcase.vRAD & Advanced Suite: ListBox, Multi-Select ListBox, ComboBox, Transfer List, Code Editor, Console Log, Color Palette, Step Slider, Status Bar, Tag Input, Range Slider, Drop Zone, Property Grid, Sparkline, Pagination, Split View, Toasts, Command Palette, Context Menu.v run examples/14_rad_controls_showcase.v Snapshot
15_modern_ui_features_showcase.vModern UI Showcase: Window controls, themes, layouts, forms, state store, system utilities.v run examples/15_modern_ui_features_showcase.v Snapshot
16_interval_timers.vInterval Timers & Timeouts: Recurring timers, timeouts, clock, auto progress bar.v run examples/16_interval_timers.v Snapshot
17_data_and_event_binding.vData & Event Binding: Two-way state binding (bind_state), click aliases, shortcut bindings.v run examples/17_data_and_event_binding.v Snapshot
18_custom_font_loading.vCustom Font & Typography: Platform font resolution, custom TTF/OTF setting, font discovery.v run examples/18_custom_font_loading.v Snapshot
19_cross_window_spy_and_automation.vCross-Window Spy++ & Automation: Global window registry, control inspection, event bus.v run examples/19_cross_window_spy_and_automation.v Snapshot
20_stdlib_data_structures_math_and_sockets.vCollections, Math & Sockets: Stack, Queue, Set, MinHeap, BigInt, string distance metrics.v run examples/20_stdlib_data_structures_math_and_sockets.v Snapshot
21_extended_os_system_calls.vExtended OS & Hardware: CPU/memory pressure, environment variables, audio beeps, zip.v run examples/21_extended_os_system_calls.v Snapshot
22_modern_super_controls_showcase.vSuper Controls Suite: Super Terminal, Code Studio, Smart Table, Kanban Board, Wizard Stepper, Floating Toolbar, Score Card, Sparklines, Donut Chart, Chip Input.v run examples/22_modern_super_controls_showcase.v Snapshot
23_modern_image_controls_showcase.vModern Image Controls: User Profile Cards, Product Cards, Multi-Image Showcase Gallery, 3D App Launcher Tiles, Media Player Card, Hero Banners, and Hardware Texture Caching.v run examples/23_modern_image_controls_showcase.v Snapshot
24_custom_image_dialogs_showcase.vRAD Custom 3D Image Dialogs: 3D glossy icons (Success, Error, Warning, Info, Confirm, Danger, Security, Database, Cloud, Tip), 3-button actions, Checkboxes & Inline Input Prompts.v run examples/24_custom_image_dialogs_showcase.v Snapshot
25_modern_ui_suite_and_ergonomics.vModern UI Suite & Ergonomic Enhancements: Slide-over Drawer, Collapsible Nav Rail, Spline Area Chart, Activity Heatmap, Dynamic Flow Chips, Tree Grid, Month Calendar, Masked Inputs & Markdown Viewer.v run examples/25_modern_ui_suite_and_ergonomics.v Snapshot
26_simplecli_system_monitor.vSimpleCLI Headless System Monitor: CPU/RAM/Disk metrics, load averages, battery status, ASCII tables & panels.v run examples/26_simplecli_system_monitor.vConsole CLI
27_simplecli_rad_interactive_tool.vSimpleCLI Interactive RAD Wizard: Banners, selects, multi-selects, prompts, progress bars & state persistence.v run examples/27_simplecli_rad_interactive_tool.vConsole CLI
28_simplecli_process_and_automation.vSimpleCLI Process & Task Automation: Command timeouts, retry loops, AES encryption, clipboard & desktop alerts.v run examples/28_simplecli_process_and_automation.vConsole CLI

simplecli - Headless Console & RAD Toolkit (Zero GUI Dependencies)

Need all the power of OS system calls, process management, hardware monitoring, desktop alerts, speech synthesis, standard paths, and stdlib crypto/HTTP without spinning up a graphical window? Use import simplecli!

module main

import simplecli

fn main() {
	mut app := simplecli.new_app('DeployCLI', '1.0.0')
	app.banner('DeployCLI Workspace', 'v1.0.0')

	// System metrics & paths
	cpu := app.get_cpu_info()
	ram := app.get_memory_info()
	app.print_kv({ 'CPU': cpu, 'RAM': ram })

	// Interactive RAD prompts & tables
	env := app.select('Target environment', ['dev', 'staging', 'prod'])
	app.success('Selected ${env}')

	// Desktop notification
	app.notify('Ready', 'DeployCLI initialized.')
}

See CLI_API.md for the complete SimpleCLI documentation and API reference.


💻 Production Console Applications Suite (cli_apps/ - 49 Utilities)

simple_gg includes 49 zero-window command-line applications and client versions of the GUI workstations in the cli_apps/ directory:

CategoryApplicationsKey Highlights
DevOps & CloudSentinel, Docker CLI, Launchd CLI, Task Manager, Disk CLI, Git Pilot, App BundlerContainer stats, process monitors, backup vaults & crontabs.
Security & NetworkNmap CLI, DNS & SSL CLI, Recon CLI, Subfinder, IFConfig CLI, Crypto Studio, VaultPort scanning, WHOIS, certificate transparency, AES-256 & hashes.
Data & DatabasesJQ CLI, Data Convert CLI, SQLite Studio CLI, API Stress Bench, API Studio CLIJSON queries, CSV/TSV/TOML conversion, SQLite REPL & REST client.
Media & AudioFFmpeg CLI, ImageMagick CLI, yt-dlp CLI, Audio Tag, ExifTool, OCR, Say TTSVideo transcoding, image resizing, stream downloader & speech.
Text & StreamGAWK CLI, Sed CLI, SD CLI, Cut CLI, TR CLI, Regex CLI, Ripgrep, FD, FindFast stream transformation, pattern matching & file traversal.
Math & ScienceNumbat Units, Kalker Math, Qalc Studio, Programmer Calc, Stats, Graph CLIPhysical dimensional analysis, arbitrary precision & ASCII charts.
Docs & ArchivesPandoc CLI, Ouch Archive CLI, Wget2 Downloader, Text Editor CLIDocument conversion, universal archives (ZIP/7z/zstd) & downloader.

See the cli_apps/README.md for the complete catalog of all 49 command-line applications.


Production Workstations & Studio Applications (47 Workstations)

simple_gg includes 47 desktop applications in the applications/ directory, covering devtools, media studios, network utilities, data converters, and security workstations:

OmniTool Studio Pro Watchexec Studio Pro

App Bundler Studio Pro Media & Data Studio Hub

Text Editor Pro Task Manager Pro

ApplicationCategoryDescriptionRun CommandSnapshot
omnitool_studio.vDevToolsAAA utility suite: fd, sd, watchexec, wget2, rg, rip, ouch, bat, eza.v run applications/omnitool_studio.vScreenshot
watchexec_studio.vDevToolsFilesystem watcher, auto-reload runner, debounce & glob filters.v run applications/watchexec_studio.vScreenshot
app_bundler_studio.vDevToolsmacOS .app bundler, Retina .icns generator & packager.v run applications/app_bundler_studio.vScreenshot
api_studio.vDevToolsModern API testing client & HTTP request builder.v run applications/api_studio.vScreenshot
media_studio_hub.vMediaMaster workstation with instant one-click media tools.v run applications/media_studio_hub.vScreenshot
ffmpeg_studio.vMediaVideo/audio encoding, trimming, and format transcoding.v run applications/ffmpeg_studio.vScreenshot
sqlite_studio.vDatabaseInteractive SQLite schema inspector & query executor.v run applications/sqlite_studio.vScreenshot
docker_studio.vDevOpsContainer inspector, logs viewer, and lifecycle manager.v run applications/docker_studio.vScreenshot
task_manager.vSystemReal-time process monitor with CPU/memory telemetry.v run applications/task_manager.vScreenshot
text_editor.vProductivityFull-featured code & markdown text editor.v run applications/text_editor.vScreenshot
regex_studio.vDevToolsReal-time regular expression tester with capture groups.v run applications/regex_studio.vScreenshot
imagemagick_studio.vMediaBatch image manipulation, resizing, and filters.v run applications/imagemagick_studio.vScreenshot
nmap_studio.vSecurityNetwork security scanner & port analyzer.v run applications/nmap_studio.vScreenshot
brew_studio.vPackage MgrHomebrew package browser, installer, and updater.v run applications/brew_studio.vScreenshot
... (33 more)VariousSee complete visual gallery & catalog in applications/README.md.All Snapshots

Security & Safe Execution Engine

simple_gg features a hardened system execution framework (simplegui/security.v) designed to prevent shell injection, command poisoning, and path traversal attacks across all platforms:

  • POSIX Single-Quote Escaping (simplegui.quote_arg, simplegui.quote_path): Wraps and escapes user input safely, neutralizing quotes, semicolons, backticks, dollar signs, and redirection operators.
  • Safe Subshell Execution (simplegui.exec_safe(tool, args)): Automatically quotes all arguments and executes binaries without vulnerability to command injection.
  • Safe Stdin Pipe Execution (simplegui.exec_safe_stdin(tool, args, input_data)): Safely pipes arbitrary data over standard input without shell exposure.
  • Filename Sanitization (simplegui.sanitize_filename(name)): Strips path separators (/, \), null bytes, and traversal tokens (..).

Documentation

  • Full API Guide (GUI): See API.md for complete details on window configuration, controls, layout engine, themes, event callbacks, reactive state management (state.v), system calls (sys.v), and standard library extensions (stdlib.v).
  • SimpleCLI Reference (Headless & Console): See CLI_API.md for complete details on the zero-window console utility framework, flag parsing, ANSI UI, interactive prompts, process management, hardware metrics, and stdlib utilities.
  • 30 Utility Modules Reference (vlang_utils): See UTILS_API.md for complete documentation, function signatures, and beginner-friendly examples for all 30 utility modules.
  • Workstations Catalog: See applications/README.md for the complete list & visual showcase of 47 desktop applications.
  • Examples Guide: See examples/README.md for detailed descriptions of all example scripts.

Related GUI & RAD Desktop Projects

Explore sister projects and complementary GUI frameworks, templates, and RAD visual design suites:

ProjectPrimary StackArchitecture & Description
Vlang Webview RAD StudioV (vlang) + Native OS WebviewCross-platform visual Rapid Application Development (RAD) IDE & enterprise desktop suite. Borland Delphi/VB-inspired form designer with 70+ controls, 42 desktop themes, 16 enterprise studio applications, 16 companion CLIs, and standalone .app/.exe/ELF packager.
Bun RAD StudioBun + TypeScript / Webview-BunHigh-performance visual RAD IDE for Bun and Webview-Bun, featuring instant hot-reload, drag-and-drop form canvas, full TypeScript type safety, and 76 desktop themes.
Vlang macOS Webview App TemplateV (vlang) + Cocoa WebviewStandalone native macOS .app desktop application template for V using ttytm.webview, Cocoa Objective-C window helper integration (window_helper.m), 9-point screen placement geometry, stay-on-top pinning, and two-way IPC.
vlang_simpleguiV (vlang) + Native GUIDeclarative macOS-native GUI starter framework written in V, featuring fluent builder syntax, reactive two-way value synchronization, KPI dashboards, sortable tables, and dynamic live theme switching across 42 themes.

Notable Open-Source Webview Frameworks

  • pywebview - Lightweight, cross-platform native GUI window wrapper around OS webviews for Python applications by Roman Sirokov (r0x0r) and community.
  • Neutralinojs - Portable, lightweight cross-platform desktop application development framework using web technologies and native webview by the Neutralinojs organization.
beginner-friendly
controls
easy
gg
rad
ui
vlang
windows

codecaine-zz/simple_gg

simple_gg is a lightweight, beginner-friendly UI framework for building native, hardware-accelerated desktop applications in V. Built on top of V's native gg graphics module (powered by Sokol), simple_gg delivers smooth performance and uniform UI rendering across macOS, Linux, and Windows.

V

10

81 commits

updated Sep 13, 2026

See the code

See what people are saying

SourceMessageScoreDate

V Language Review (2023)

Looks too weird to repost an old 2023 rant about an alpha or very old version of a language, in 2026. Particularly when it's full of outdated, questionable, or outright misinformation. Languages in development are not static, they change. * VUI, Delphi-like visual editor, iOS support There is now…

0

Sep 28, 2026

README

simple_gg - Cross-Platform SimpleGUI for V

simple_gg is a lightweight, beginner-friendly UI framework for building native, hardware-accelerated desktop applications in V. Built on top of V's native gg graphics module (powered by Sokol), simple_gg delivers smooth performance and uniform UI rendering across macOS, Linux, and Windowswithout relying on external C/Obj-C dependencies.


Visual Showcase & Snapshots of All Examples

Modern UI Suite & Ergonomic Enhancements Demo Custom 3D Image Dialogs Demo

Modern Image Controls Demo Super Controls Suite Demo

RAD Controls Showcase Dashboard App Demo

Click to view remaining example screenshots (19 more)

Quickstart Demo 02 - Theme Gallery Demo

04 - Component Gallery Demo 05 - Nameless Shortcuts Demo

07 - Advanced Controls Demo 08 - RAD Application Builder Demo

09 - Control Customization Demo 10 - More UI Controls Demo

11 - Data Table Pro Demo 12 - System & Stdlib Toolkit Demo

13 - Reactive State Store Demo 15 - Modern UI Features Showcase Demo

16 - Interval Timers Demo 17 - Data & Event Binding Demo

18 - Custom Font Typography Demo 19 - Cross-Window Spy Demo

20 - Stdlib Data Structures Demo 21 - Extended OS System Calls Demo


Key Features

  • Cross-Platform: Runs natively on macOS, Linux, and Windows with native OS drag-and-drop support.
  • 87 Built-in Production Themes: The complete 76-theme Bun RAD Studio catalog plus SimpleGUI exclusives, with theme-specific surfaces, borders, secondary accents, and accessible button contrast.
  • RAD Development Controls Suite: Multi-select Tag Input, Dual-Thumb Range Slider, Monospace Code Editor, File Drop Zone, Property Grid Inspector, Sparkline Micro-Charts, Pagination Bar, Resizable Split View, Toast Notification Overlay Stack, Command Palette (Ctrl+K), and Context Menus.
  • Complete Widget Set: ListBox (interactive single/multi select), ComboBox, Transfer List, Console Output Viewer, Color Palette Swatch Grid, Status Bar, Step Slider, text/password inputs, steppers, range sliders, toggle switches, checkboxes, dropdowns, segmented controls, rating stars, date pickers, metric cards, charts, tree views, data tables, breadcrumbs, avatars, status badges, accordions, and alert banners.
  • Layout Engine: Automatic vertical stacking, horizontal rows (begin_row), multi-column grids (begin_grid), flexboxes (begin_flex_box), tab containers, and group cards.
  • Reactive State Management & Universal Persistence (state.v): Key-value reactive store (set_state, get_state), typed accessors, reactive state listeners (on_state_change), atomic crash-proof disk persistence (save_app_state, load_app_state), automated per-application form state restoration on launch, global theme auto-save, and window session restoration (save_window_session, restore_window_session).
  • OS & System Extensions (sys.v): Standardized user directory lookups for macOS (~/Library), Windows (%APPDATA%), and Linux ($XDG_*), path expansion with tilde (~) and environment variable resolution, native notifications, hardware metrics, process execution, clipboard, and file operations.
  • Headless Console & RAD Toolkit (simplecli): Full-featured zero-window CLI framework with flag parsing, ANSI colors, tables, interactive prompts, multi-level logging, process control, hardware probing, and cryptography.
  • V Standard Library Integrations (stdlib.v): Built-in fluent helpers for HTTP requests, RegEx matching, Cryptography (SHA256, MD5, AES, Bcrypt), Gzip/Zlib/Zstd compression, TOML parsing, SemVer checks, and WebSockets.
  • 30 Bundled Production Utility Modules (vlang_utils): Zero-boilerplate ergonomic toolkit ready to import anywhere (fileutils, sqliteutils, strutils, sliceutils, envutils, cryptoutils, timeutils, httputils, cliutils, sysutils, netutils, validutils, structutils, statutils, stateutils, cacheutils, semverutils, flowutils, templateutils, colorutils, archiveutils, asyncutils, regexutils, mockutils, logutils, tomlutils, htmlutils, bitutils, compressutils, tarutils). Full manual in UTILS_API.md.
  • Beginner Friendly: Fluent chainable builder API with zero boilerplate.

📦 Installation & Module Setup

This repository is currently published under the GitHub repo name simple_gg, but the V module you import is simplegui.

If you cloned the project manually, put it in your V module path so imports resolve correctly:

git clone https://github.com/codecaine-zz/simple_gg.git
mkdir -p ~/.vmodules
ln -s "$PWD/simple_gg/simplegui" ~/.vmodules/simplegui

Then run examples from the project directory or from any project that imports simplegui.

If the package is later published to VPM under a matching name, the standard v install ... flow will work as usual. For this repo today, linking the repository's simplegui/ directory at ~/.vmodules/simplegui is the reliable Linux/macOS workflow.

2. Install Homebrew dependencies (macOS)

For a default install on macOS, run the project’s bundled Homebrew installer:

./install_homebrew_dependencies.sh

This installs the required runtime tools used by the project and apps, such as FFmpeg, ImageMagick, jq, rg, pandoc, sqlite, nmap, and related toolchain utilities.

If you also want optional cross-compilation toolchains for Windows builds, install them explicitly:

./install_homebrew_dependencies.sh --optional

This adds zig and mingw-w64, which are only needed for Windows-targeted builds and are not required for the normal app runtime.

You can also install only the base bundle directly:

brew bundle --file ./Brewfile

3. Linux System Dependencies

On Linux (Debian / Ubuntu / Pop!_OS / Mint), ensure standard X11/GL development headers are present:

# The project dependency checker is cross-platform and will show Linux guidance:
v run install_dependencies.vsh --check

# Or install manually via apt:
sudo apt update
sudo apt install -y libx11-dev libxcursor-dev libxi-dev libgl1-mesa-dev libasound2-dev xclip

4. Naming & Import Convention

ElementNameDescription
Repository Namesimple_ggThe GitHub project name (SimpleGUI built on V's gg engine).
V Module NamesimpleguiUsed in all code across macOS, Linux, and Windows: import simplegui
Headless CLI ModulesimplecliZero-window terminal apps across all platforms: import simplecli

5. V Compiler Version & v up Maintenance

simple_gg is developed and validated against V 0.5.2 (commit 9e9f7f05 / V3 compiler backend). All 43 test suites, 30 GUI demos, 29 examples, 47 desktop workstations, and 49 CLI tools are tested and verified on this build.

⚠️ Caution with v up

Running v up directly pulls rolling changes from the V master branch, which can occasionally introduce compiler bootstrap issues or codegen regressions:

  • cheaders.v / EmbedFileData Panic: If v up pulls a commit where embedded C headers are restructured before the bootstrap pre-built vc sources are synchronized, running v will fail with:
    V panic: EmbedFileData error: files ... cheaders.v do not exist
    
  • Interface Dispatch Mismatches (json2, io.Reader): Upstream master changes can affect generic interface method dispatch parameter resolution (e.g., when streaming io.Reader in json2 encounters types with zero-parameter read methods).

🔄 How to Safely Rebuild / Recover V

If running v up leaves your V installation broken or unable to compile, restore it cleanly from bootstrap C code (vc):

cd /path/to/v

# 1. Fetch latest changes or pin to verified commit
git fetch origin
git checkout 9e9f7f05   # Verified working commit (or master)

# 2. Bootstrap from the official vc repository
git clone --depth 1 https://github.com/vlang/vc /tmp/vc
cc -std=gnu99 -w -o v /tmp/vc/v.c -lm -lpthread

# 3. Recompile V self-hosted
./v self

# 4. Clean out any obsolete fallback caches
rm -rf ~/.cache/v/v1-fallback

💡 Environment Flag (VFLAGS) Best Practice

On macOS with Homebrew, if you set library search paths via VFLAGS in ~/.zshrc or ~/.bashrc, specify -ldflags separately for each path to avoid argument-splitting failures during recursive sub-invocations (e.g. v test or v crun):

# ✅ Recommended (avoids nested quoting errors in subshells):
export VFLAGS="-ldflags -L/opt/homebrew/lib -ldflags -L/usr/local/lib"

# ❌ Avoid (inner quotes break argument tokenization in V child processes):
# export VFLAGS="-ldflags '-L/opt/homebrew/lib -L/usr/local/lib'"

Quick Start

module main

import simplegui

fn main() {
	mut win := simplegui.new_simple_window('My App', 520, 380)
	win.set_theme('Apple Dark')
	win.add_heading('SimpleGUI Starter')
	win.add_form_field('Name:', 'username', 'Ada Lovelace')
	win.add_checkbox('agree', 'I agree to the Terms', true)

	win.add_button('btn_save', 'Save')
	win.on_click('btn_save', fn (mut win simplegui.SimpleWindow) {
		println("User: ${win.get_text('username')}")
	})

	win.run()
}

Beginner-Friendly Examples & Snapshots

The repository includes beginner-friendly example programs in the examples/ directory:

ExampleDescriptionRun CommandSnapshot
01_quickstart.vFirst starter app with inputs and button callbacks.v run examples/01_quickstart.v Snapshot
02_theme_gallery.vComplete tabbed control gallery with an always-visible live switcher across 87 production palettes.v run examples/02_theme_gallery.v Snapshot
03_layout_containers.vHorizontal rows, multi-column grids, and group cards.v run examples/03_layout_containers.v Snapshot
04_widgets_and_forms.vForm inputs, sliders, steppers, ratings, dates, and metric cards.v run examples/04_widgets_and_forms.v Snapshot
05_nameless_shortcuts.vRapid prototyping using nameless shortcuts (win.input()).v run examples/05_nameless_shortcuts.v Snapshot
06_dashboard_app.vReal-world dashboard with KPI metrics, charts, and actions.v run examples/06_dashboard_app.v Snapshot
07_advanced_controls.vData tables, tab containers, tree views, search, breadcrumbs, avatars, and shortcuts.v run examples/07_advanced_controls.v Snapshot
08_rad_development.vRapid app builder with batch ops, JSON form export, clipboard, and OS dialogs.v run examples/08_rad_development.v Snapshot
09_control_customization.vCustom geometry, margins/padding, colors, borders, and fluent control chaining.v run examples/09_control_customization.v Snapshot
10_more_controls.vIcon buttons, toolbars, hyperlinks, checklists, chips, and password strength meter.v run examples/10_more_controls.v Snapshot
11_data_table_pro.vSortable data tables, wheel scrolling, row hover, and table manipulation.v run examples/11_data_table_pro.v Snapshot
12_system_and_stdlib_features.vDesktop notifications, hardware specs, clipboard, system paths, HTTP GET, RegEx, Crypto.v run examples/12_system_and_stdlib_features.v Snapshot
13_reactive_state_store.vReactive key-value state store, typed accessors, state change listeners, and JSON disk persistence.v run examples/13_reactive_state_store.v Snapshot
14_rad_controls_showcase.vRAD & Advanced Suite: ListBox, Multi-Select ListBox, ComboBox, Transfer List, Code Editor, Console Log, Color Palette, Step Slider, Status Bar, Tag Input, Range Slider, Drop Zone, Property Grid, Sparkline, Pagination, Split View, Toasts, Command Palette, Context Menu.v run examples/14_rad_controls_showcase.v Snapshot
15_modern_ui_features_showcase.vModern UI Showcase: Window controls, themes, layouts, forms, state store, system utilities.v run examples/15_modern_ui_features_showcase.v Snapshot
16_interval_timers.vInterval Timers & Timeouts: Recurring timers, timeouts, clock, auto progress bar.v run examples/16_interval_timers.v Snapshot
17_data_and_event_binding.vData & Event Binding: Two-way state binding (bind_state), click aliases, shortcut bindings.v run examples/17_data_and_event_binding.v Snapshot
18_custom_font_loading.vCustom Font & Typography: Platform font resolution, custom TTF/OTF setting, font discovery.v run examples/18_custom_font_loading.v Snapshot
19_cross_window_spy_and_automation.vCross-Window Spy++ & Automation: Global window registry, control inspection, event bus.v run examples/19_cross_window_spy_and_automation.v Snapshot
20_stdlib_data_structures_math_and_sockets.vCollections, Math & Sockets: Stack, Queue, Set, MinHeap, BigInt, string distance metrics.v run examples/20_stdlib_data_structures_math_and_sockets.v Snapshot
21_extended_os_system_calls.vExtended OS & Hardware: CPU/memory pressure, environment variables, audio beeps, zip.v run examples/21_extended_os_system_calls.v Snapshot
22_modern_super_controls_showcase.vSuper Controls Suite: Super Terminal, Code Studio, Smart Table, Kanban Board, Wizard Stepper, Floating Toolbar, Score Card, Sparklines, Donut Chart, Chip Input.v run examples/22_modern_super_controls_showcase.v Snapshot
23_modern_image_controls_showcase.vModern Image Controls: User Profile Cards, Product Cards, Multi-Image Showcase Gallery, 3D App Launcher Tiles, Media Player Card, Hero Banners, and Hardware Texture Caching.v run examples/23_modern_image_controls_showcase.v Snapshot
24_custom_image_dialogs_showcase.vRAD Custom 3D Image Dialogs: 3D glossy icons (Success, Error, Warning, Info, Confirm, Danger, Security, Database, Cloud, Tip), 3-button actions, Checkboxes & Inline Input Prompts.v run examples/24_custom_image_dialogs_showcase.v Snapshot
25_modern_ui_suite_and_ergonomics.vModern UI Suite & Ergonomic Enhancements: Slide-over Drawer, Collapsible Nav Rail, Spline Area Chart, Activity Heatmap, Dynamic Flow Chips, Tree Grid, Month Calendar, Masked Inputs & Markdown Viewer.v run examples/25_modern_ui_suite_and_ergonomics.v Snapshot
26_simplecli_system_monitor.vSimpleCLI Headless System Monitor: CPU/RAM/Disk metrics, load averages, battery status, ASCII tables & panels.v run examples/26_simplecli_system_monitor.vConsole CLI
27_simplecli_rad_interactive_tool.vSimpleCLI Interactive RAD Wizard: Banners, selects, multi-selects, prompts, progress bars & state persistence.v run examples/27_simplecli_rad_interactive_tool.vConsole CLI
28_simplecli_process_and_automation.vSimpleCLI Process & Task Automation: Command timeouts, retry loops, AES encryption, clipboard & desktop alerts.v run examples/28_simplecli_process_and_automation.vConsole CLI

simplecli - Headless Console & RAD Toolkit (Zero GUI Dependencies)

Need all the power of OS system calls, process management, hardware monitoring, desktop alerts, speech synthesis, standard paths, and stdlib crypto/HTTP without spinning up a graphical window? Use import simplecli!

module main

import simplecli

fn main() {
	mut app := simplecli.new_app('DeployCLI', '1.0.0')
	app.banner('DeployCLI Workspace', 'v1.0.0')

	// System metrics & paths
	cpu := app.get_cpu_info()
	ram := app.get_memory_info()
	app.print_kv({ 'CPU': cpu, 'RAM': ram })

	// Interactive RAD prompts & tables
	env := app.select('Target environment', ['dev', 'staging', 'prod'])
	app.success('Selected ${env}')

	// Desktop notification
	app.notify('Ready', 'DeployCLI initialized.')
}

See CLI_API.md for the complete SimpleCLI documentation and API reference.


💻 Production Console Applications Suite (cli_apps/ - 49 Utilities)

simple_gg includes 49 zero-window command-line applications and client versions of the GUI workstations in the cli_apps/ directory:

CategoryApplicationsKey Highlights
DevOps & CloudSentinel, Docker CLI, Launchd CLI, Task Manager, Disk CLI, Git Pilot, App BundlerContainer stats, process monitors, backup vaults & crontabs.
Security & NetworkNmap CLI, DNS & SSL CLI, Recon CLI, Subfinder, IFConfig CLI, Crypto Studio, VaultPort scanning, WHOIS, certificate transparency, AES-256 & hashes.
Data & DatabasesJQ CLI, Data Convert CLI, SQLite Studio CLI, API Stress Bench, API Studio CLIJSON queries, CSV/TSV/TOML conversion, SQLite REPL & REST client.
Media & AudioFFmpeg CLI, ImageMagick CLI, yt-dlp CLI, Audio Tag, ExifTool, OCR, Say TTSVideo transcoding, image resizing, stream downloader & speech.
Text & StreamGAWK CLI, Sed CLI, SD CLI, Cut CLI, TR CLI, Regex CLI, Ripgrep, FD, FindFast stream transformation, pattern matching & file traversal.
Math & ScienceNumbat Units, Kalker Math, Qalc Studio, Programmer Calc, Stats, Graph CLIPhysical dimensional analysis, arbitrary precision & ASCII charts.
Docs & ArchivesPandoc CLI, Ouch Archive CLI, Wget2 Downloader, Text Editor CLIDocument conversion, universal archives (ZIP/7z/zstd) & downloader.

See the cli_apps/README.md for the complete catalog of all 49 command-line applications.


Production Workstations & Studio Applications (47 Workstations)

simple_gg includes 47 desktop applications in the applications/ directory, covering devtools, media studios, network utilities, data converters, and security workstations:

OmniTool Studio Pro Watchexec Studio Pro

App Bundler Studio Pro Media & Data Studio Hub

Text Editor Pro Task Manager Pro

ApplicationCategoryDescriptionRun CommandSnapshot
omnitool_studio.vDevToolsAAA utility suite: fd, sd, watchexec, wget2, rg, rip, ouch, bat, eza.v run applications/omnitool_studio.vScreenshot
watchexec_studio.vDevToolsFilesystem watcher, auto-reload runner, debounce & glob filters.v run applications/watchexec_studio.vScreenshot
app_bundler_studio.vDevToolsmacOS .app bundler, Retina .icns generator & packager.v run applications/app_bundler_studio.vScreenshot
api_studio.vDevToolsModern API testing client & HTTP request builder.v run applications/api_studio.vScreenshot
media_studio_hub.vMediaMaster workstation with instant one-click media tools.v run applications/media_studio_hub.vScreenshot
ffmpeg_studio.vMediaVideo/audio encoding, trimming, and format transcoding.v run applications/ffmpeg_studio.vScreenshot
sqlite_studio.vDatabaseInteractive SQLite schema inspector & query executor.v run applications/sqlite_studio.vScreenshot
docker_studio.vDevOpsContainer inspector, logs viewer, and lifecycle manager.v run applications/docker_studio.vScreenshot
task_manager.vSystemReal-time process monitor with CPU/memory telemetry.v run applications/task_manager.vScreenshot
text_editor.vProductivityFull-featured code & markdown text editor.v run applications/text_editor.vScreenshot
regex_studio.vDevToolsReal-time regular expression tester with capture groups.v run applications/regex_studio.vScreenshot
imagemagick_studio.vMediaBatch image manipulation, resizing, and filters.v run applications/imagemagick_studio.vScreenshot
nmap_studio.vSecurityNetwork security scanner & port analyzer.v run applications/nmap_studio.vScreenshot
brew_studio.vPackage MgrHomebrew package browser, installer, and updater.v run applications/brew_studio.vScreenshot
... (33 more)VariousSee complete visual gallery & catalog in applications/README.md.All Snapshots

Security & Safe Execution Engine

simple_gg features a hardened system execution framework (simplegui/security.v) designed to prevent shell injection, command poisoning, and path traversal attacks across all platforms:

  • POSIX Single-Quote Escaping (simplegui.quote_arg, simplegui.quote_path): Wraps and escapes user input safely, neutralizing quotes, semicolons, backticks, dollar signs, and redirection operators.
  • Safe Subshell Execution (simplegui.exec_safe(tool, args)): Automatically quotes all arguments and executes binaries without vulnerability to command injection.
  • Safe Stdin Pipe Execution (simplegui.exec_safe_stdin(tool, args, input_data)): Safely pipes arbitrary data over standard input without shell exposure.
  • Filename Sanitization (simplegui.sanitize_filename(name)): Strips path separators (/, \), null bytes, and traversal tokens (..).

Documentation

  • Full API Guide (GUI): See API.md for complete details on window configuration, controls, layout engine, themes, event callbacks, reactive state management (state.v), system calls (sys.v), and standard library extensions (stdlib.v).
  • SimpleCLI Reference (Headless & Console): See CLI_API.md for complete details on the zero-window console utility framework, flag parsing, ANSI UI, interactive prompts, process management, hardware metrics, and stdlib utilities.
  • 30 Utility Modules Reference (vlang_utils): See UTILS_API.md for complete documentation, function signatures, and beginner-friendly examples for all 30 utility modules.
  • Workstations Catalog: See applications/README.md for the complete list & visual showcase of 47 desktop applications.
  • Examples Guide: See examples/README.md for detailed descriptions of all example scripts.

Related GUI & RAD Desktop Projects

Explore sister projects and complementary GUI frameworks, templates, and RAD visual design suites:

ProjectPrimary StackArchitecture & Description
Vlang Webview RAD StudioV (vlang) + Native OS WebviewCross-platform visual Rapid Application Development (RAD) IDE & enterprise desktop suite. Borland Delphi/VB-inspired form designer with 70+ controls, 42 desktop themes, 16 enterprise studio applications, 16 companion CLIs, and standalone .app/.exe/ELF packager.
Bun RAD StudioBun + TypeScript / Webview-BunHigh-performance visual RAD IDE for Bun and Webview-Bun, featuring instant hot-reload, drag-and-drop form canvas, full TypeScript type safety, and 76 desktop themes.
Vlang macOS Webview App TemplateV (vlang) + Cocoa WebviewStandalone native macOS .app desktop application template for V using ttytm.webview, Cocoa Objective-C window helper integration (window_helper.m), 9-point screen placement geometry, stay-on-top pinning, and two-way IPC.
vlang_simpleguiV (vlang) + Native GUIDeclarative macOS-native GUI starter framework written in V, featuring fluent builder syntax, reactive two-way value synchronization, KPI dashboards, sortable tables, and dynamic live theme switching across 42 themes.

Notable Open-Source Webview Frameworks

  • pywebview - Lightweight, cross-platform native GUI window wrapper around OS webviews for Python applications by Roman Sirokov (r0x0r) and community.
  • Neutralinojs - Portable, lightweight cross-platform desktop application development framework using web technologies and native webview by the Neutralinojs organization.
beginner-friendly
controls
easy
gg
rad
ui
vlang
windows

Languages

V

99.5%