Skip to content

GUI: add modules 2-4 (layout, signals and state, dynamic list) - #32

Merged
otzpt merged 1 commit into
mainfrom
feat/gui-modules
Nov 10, 2026
Merged

otzpt merged 1 commit into
mainfrom
feat/gui-modules

Conversation

@otzpt

@otzpt otzpt commented Nov 10, 2026

Copy link
Copy Markdown
Owner

The GTK course had one module. This adds three, enough to build a simple GTK4 window:

  • Module 2: GtkBox layout, margins, label/entry/check/button, hexpand vs homogeneous, and the GTK3 calls that are "implicit declaration" errors in GTK4.
  • Module 3: a state struct passed as user_data, the local-struct lifetime trap, GTK-owned vs caller-owned strings, one handler for two signals.
  • Module 4: a todo list that adds and removes widgets at run time, per-row data, counting by walking the widgets, removing while looping.

Verification:

  • Every example compiled with -std=c11 -Wall -Wextra (gcc 14.2.1, GTK 4.22.5) with no warnings, then driven by a test program against the real window (set text, tick check buttons, emit clicked/activate, assert on labels and row counts).
  • Pixel numbers quoted in the lessons were read back from the real widgets on one machine and are labelled as such.
  • python3 tools/check-teaching-order.py: 169 exercises pass.
  • Built and ran all four modules with scripted input in English and with CODELEARNER_LANG=pt-pt; each question accepts its correct answer.
  • Not run: the Windows build and the full launcher.

Undefined behaviour is explained, not run.

🤖 Generated with Claude Code

The GTK course had one module. Three more cover what a simple GTK4 window
needs: GtkBox layout and the common widgets, signals with a state struct
passed as user_data, and a todo list that adds and removes widgets at run
time.

Every example is a file compiled with -std=c11 -Wall -Wextra on gcc 14.2.1
and GTK 4.22.5, then driven by a test program against the real window.
The few pixel measurements quoted in the lessons were read back from the
real widgets. Undefined behaviour (a callback reading a dead stack struct,
reading a sibling after gtk_box_remove) is explained, not run.

Also: PT-PT titles and summaries for the new modules, the new constructs in
check-teaching-order.py (169 exercises pass), the Makefile and README.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Nov 10, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3eed14d7-3a48-4ad7-bde3-166ad4351954
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@otzpt
otzpt merged commit 44a797d into main Nov 10, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant