cnmcdee 3792410bfe Docs: mark all 8 debugger bugs fixed Dec 2, 2026 (guide)
Troubleshooting entries rewritten as FIXED with the fixing commits:
backend e6678e1 (Step Out in main, Stop/async, Run target switch,
temp main bp) and UI a3df7cd (narrow pane incl. the wrapping hint
root cause, sticky selection/checkbox, search popup). Run table row
updated (Target/Args read every time), stale-breakpoints note
updated (kept staged), First-run quirk callout removed, Known bugs
section rewritten as all fixed.
2026-12-02 10:47:59 +00:00
2026-11-25 20:19:22 +13:00

LightGUI — a visual GUI designer in C++/GTK

LightGUI is a visual designer for building GTK 3 applications in C++. Place widgets on a canvas at absolute positions, edit their properties, then generate runnable C++/GTK source code — a .ui layout file plus a C++ class with stub signal handlers, ready to fill in and build.

It is a C++ rebuild of the author's lightgui (Tkinter Rapid Designer), a ~7,000-line Python/Tkinter app. The C++ version generates C++/GTK code, not Tkinter Python, and its own UI is GTK as well, defined in Glade .ui files. No Qt anywhere.

Designer

Features

  • Visual canvas — place widgets at absolute positions and sizes, the GTK equivalent of Tk's .place(). Drag, resize, align, and multi-select.
  • Object Inspector — its own top-level window: edit every widget property, with bulk parameter operations across a selection. It is a separate window from the layout window, so each can be moved, resized, and closed independently.
  • Code generation — for each designed window, emits:
    • <name>.ui — a Glade/GtkBuilder layout file (GtkWindow + GtkFixed, widgets at their designed x/y with width/height requests).
    • <name>.h / <name>.cpp — a C++ class that loads the .ui with GtkBuilder, fetches each widget by id, and declares one stub signal handler per connected signal (// Code block here), ready to fill in.
    • A Makefile and a CMakeLists.txt, so a generated project builds with either tool.
  • CMake support — build a generated project with CMake from inside the designer, rebuild the last generated project, or open any directory holding a CMakeLists.txt and build it.
  • Stepping debugger — a real GDB session over the MI protocol (gdb -q -i=mi2): Run, Continue, Step Over/Into/Out, Stop, Restart, breakpoints (file.cpp:123 or a function name, saved between runs), locals, a watch list, stack frames, and target stdout/stderr. Works on any program compiled with -g.
  • Code view — inspect the generated code without leaving the designer.
  • Themes and fonts — color themes and global font settings for the designer itself.
  • Widget palette — the full Tk palette mapped to GTK 3 (Window, Frame, Button, Label, Entry, CheckButton, RadioButton, ComboBox, ListBox, Menu, Notebook, TreeView, and more), each with its own 16×16 icon.
  • 547 XFrame widgets — a second widget library of hand-drawn X11 widgets in 11 sections (Gtk*, T*, Ind*, Stock*, Inst*, plus XGraph and XSpreadsheet), each with its own demo, all merged into the same IDE.
  • XFrame-only palette — 547 entries (all XFrame widgets) with 16×16 icons; the embedded canvas places the real widget class for any of them. A seam converter (layout_to_lightgui.py) turns an XFrame layout file into a LightGUI project (.fdj, XFrame-only).
  • Project files — JSON (.fdj), replacing the original's Python pickle format.

Code view Debugger

Requirements

LightGUI builds and runs on Linux with GTK 3. This section assumes a bare system — a fresh ParrotOS (or Debian/Ubuntu) install with nothing yet installed. One command installs the compiler and everything else; you do not need anything beforehand, not even make or a C++ compiler.

Install (Debian / Ubuntu / ParrotOS)

sudo apt update && sudo apt install build-essential pkg-config libgtk-3-dev glade cmake gdb xvfb python3

That single command is the complete toolchain from scratch: the compiler, the build tools, GTK 3, and every feature dependency. Nothing else is required to build and run LightGUI.

What each package is for:

Package Needed for
build-essential The build tools themselves — provides make (which runs the Makefile) and g++ (the C++17 compiler), plus the C library headers. Without it, make is not even installed.
pkg-config Finding the GTK 3 compiler and linker flags (gtk+-3.0)
libgtk-3-dev GTK 3 itself — the development package for GTK 3. Installing it also pulls in the GTK 3 runtime libraries (libgtk-3-0), so there is no separate gtk3 package to install. It also pulls in Cairo and GDK, which the source uses.
glade Editing the designer's own .ui files (optional for building and running)
cmake The CMake build path for generated projects, and File → Open CMake Project
gdb The integrated stepping debugger (GDB/MI)
xvfb Running the GUI tests headless
python3 The palette-icon generator tool (tools/gen_palette_icons.py)

Optional, for the full GUI test suite:

sudo apt install xdotool

Without xdotool the GUI end-to-end tests print SKIP and the rest of the suite still runs.

GTK 3.24 is the target toolkit — GTK 4 has no Glade, so this project stays on GTK 3. It runs on X11 (GTK 3's X11 backend).

Troubleshooting: libgtk-3-dev won't install (dependency conflict)

On some systems sudo apt install libgtk-3-dev fails with Unsatisfied dependencies / Unable to correct problems, you have held broken packages. The usual cause is a version mismatch: the system already has newer runtime libraries (for example ATK libraries at 2.62.1 from Debian backports, ~bpo13+1), while libgtk-3-dev pulls the older stable dev packages (2.56.2), which demand the older runtimes at exactly that version — and apt will not downgrade the runtimes on its own.

Try these in order:

1. Prefer backports for this install, so the dev packages match the backports runtimes already installed:

sudo apt install -t trixie-backports libgtk-3-dev

(Use the backports suite name for your release if it differs — on Debian 13 it is trixie-backports, on ParrotOS it is echo-backports, not trixie-backports. So on ParrotOS the command is sudo apt install -t echo-backports libgtk-3-dev.)

2. Let aptitude resolve it:

sudo apt install aptitude
sudo aptitude install libgtk-3-dev

Accept the solution that uses the newer dev packages matching your installed runtimes, instead of downgrading anything.

3. Last resort — headers only: download the -dev .debs and install them with dpkg --force-depends. That installs just the headers without touching the runtime libraries. Only do this if options 1 and 2 fail.

Per-distro install scripts (tested 2026-11-28)

Each distro below was verified end to end in its own LXC container (images from images.linuxcontainers.org, 4 CPU cores, 15 GB RAM, 30 GB disk, SSH verified from the host): update/upgrade, install the toolchain with the distro's own package manager, git clone this repo, make — and the lightgui binary was produced. Run the script for your distro as root, or with sudo (sudo bash install-ubuntu.sh).

Distro Version tested Script gtk+-3.0 Notes
Ubuntu 24.04.5 LTS (noble) install-ubuntu.sh 3.24.41 The plain README command works as-is; no extra step.
Debian 13 (trixie) install-debian.sh 3.24.49 The plain README command works as-is; no backports needed on a fresh minimal install (no backports runtimes preinstalled, so no conflict).
Fedora 43 install-fedora.sh 3.24.52 dnf update, then dnf install -y git gcc gcc-c++ make pkg-config gtk3-devel glade cmake gdb xorg-x11-server-Xvfb python3 — Fedora has no build-essential / -dev split; gtk3-devel is the GTK dev package.
Arch Linux rolling (current) install-arch.sh 3.24.52 pacman-key --init + pacman-key --populate archlinux is required first — the LXC Arch image ships with an empty keyring, so every install fails with signature ... is unknown trust until the keyring is populated. Then pacman -S --noconfirm --needed git base-devel pkgconf gtk3 glade cmake gdb xorg-server-xvfb python (pkgconf provides pkg-config; gtk3 already includes the headers).
Linux Mint 22.3 (Zena, Ubuntu noble based) install-mint.sh 3.24.33 Same apt command as Ubuntu; Mint's repos ship an older GTK (3.24.33 vs Ubuntu's 3.24.41). A native Mint LXC image exists (mint zena).
ParrotOS — (see note) install-parrot.sh 3.24.49 on stand-in No native Parrot LXC image exists, so this was tested on Parrot's parent, Debian 13 (trixie). The same apt commands apply on real ParrotOS — but if libgtk-3-dev conflicts, the backports suite on Parrot is echo-backports, not trixie-backports (see Troubleshooting above).

Test-environment note: on the LXC host used for these tests, the containers initially could not reach GitHub at all (IPv4 only — GitHub has no IPv6 address) because the host's iptables FORWARD chain was DROP with rules only for Docker's bridges, so LXC's IPv4 masquerade never saw a packet. Restoring the standard lxcbr0 FORWARD accepts fixed it. That is specific to that host, not to these scripts — on a normal desktop install git clone just works.

Build and run

make

There are two launch points, and they are not the same thing:

Command What it is What you get
./ide A launcher script (a small shell script, not a binary) The designer (single process): designer window with the embedded XFrame canvas, the XFrame-only palette window (547 widgets), Object Inspector, Code view. This is the one to run for normal use.
./lightgui The compiled designer binary The designer alone, run directly (same windows; ./ide just builds first if asked).

./ide is a single-process launcher now (step 6): it builds first only with --build, then execs ./lightgui. The standalone XFrame palette/layout processes are gone — the canvas is embedded in the designer and the palette is its own window inside the same process.

make builds the lightgui designer and all 547 XFrame widget demos (make lightgui builds just the designer, make widgets just the demos). The designer is built from per-file .o compiles plus a link step, driven by a plain Makefile that parallelises by default (it uses all available cores), using pkg-config --cflags --libs gtk+-3.0. No configure step, no external build system for LightGUI itself. make clean removes the binary and the demos.

To open an existing design, pass its .fdj file:

./lightgui mywindow.fdj

(./ide does not take a .fdj argument — open a design from File → Open once it is running, or launch the designer directly with ./lightgui mywindow.fdj.)

Using the designer

  1. Pick a widget from the palette and place it on the canvas.
  2. Edit its properties in the Object Inspector window (position, size, label, signal handlers, and so on).
  3. File → Generate C++/GTK… writes the .ui, .h, .cpp, Makefile, and CMakeLists.txt for the window into a folder.
  4. Build the generated project with either tool:
# Makefile path
g++ -o app *.cpp $(pkg-config --cflags --libs gtk+-3.0)

# CMake path
cmake -S . -B build && cmake --build build
  1. Fill in the stub signal handlers in the generated .cpp and run ./app.

Debugger: Debug → Open Debugger… runs any program compiled with -g. Add a breakpoint as file.cpp:123 or a function name, press Run, and step through it. Breakpoints and debugger settings live under ~/.config/lightgui/.

Tests

# Full test suite (needs xvfb for the GUI tests; xdotool optional)
./tests/run_matrix.sh

# Seam test: XFrame layout -> LightGUI project -> builds (make test)
make test

# Individual suites
./tests/widget_tests.sh
./tests/debugger_tests.sh
./tests/cmake_tests.sh
./tests/theme_tests.sh
./tests/palette_window_tests.sh
./tests/palette_icons_tests.sh
./tests/code_window_tests.sh

The palette self-test covers all 547 XFrame entries; the debugger suite is 46 checks; the seam test maps all 547 widgets and verifies the generated project builds.

Layout of the repo

.
├── Makefile            # the build (g++ + pkg-config gtk+-3.0)
├── install-*.sh        # per-distro install scripts (see "Per-distro install scripts" above)
├── DESIGN.md           # full design notes: widget mapping, model, phases
├── src/                # designer source (C++17, GTK C API, GtkBuilder)
│   ├── main.cpp        # entry point, main window
│   ├── generator.cpp   # C++/GTK code generation
│   ├── cmake_build.cpp # CMake build integration
│   ├── debugger.cpp    # GDB/MI session backend
│   ├── debugger_ui.cpp # debugger window
│   ├── preferences.cpp # settings, themes, fonts
│   ├── codeview.cpp    # generated-code viewer
│   ├── project_io.cpp  # .fdj (JSON) project files
│   └── theme.cpp       # color themes
├── ui/
│   └── designer.ui     # main window layout (Glade)
├── ide                 # launcher script (not a binary): starts the
│                       # full IDE — designer + XFrame palette + XFrame
│                       # layout window. See "Build and run" above.
├── lightgui            # the compiled designer binary (built by `make`);
│                       # the designer alone, without the XFrame windows
├── widgets/            # the 547 XFrame widgets: components, core,
│                       # common, palette, layout, tests, tools, icons
├── docs/               # IDE guide, widget reference, stock-market and
│                       # instrumentation notes
├── tools/              # embed scripts, palette-icon generator
├── tests/              # unit + GUI test suites
├── icons/              # 16×16 palette icons, one per designer widget
└── screenshots/        # designer screenshots

See also the project site: lightgui.com.

License

MIT — see LICENSE. Copyright (c) 2026 cnmcdee.

S
Description
No description provided
Readme MIT
19 MiB
0 Stars 1 Watchers 0 Forks
Languages
C++ 94.2%
Python 4.7%
CMake 0.7%
Shell 0.3%
C 0.1%