Skip to content

gtk3: convert single-hit files as a trial for the GTK2→GTK3 migration - #27

Merged
fillods merged 1 commit into
fillods:masterfrom
chrisdebian:gtk3/trial-single-hit-files
Sep 20, 2026
Merged

fillods merged 1 commit into
fillods:masterfrom
chrisdebian:gtk3/trial-single-hit-files

Conversation

@chrisdebian

Copy link
Copy Markdown
Contributor

Summary

Per the migration scoping on #13 and your go-ahead there ("Please go ahead since nobody showed up lately. Your plan sounds good."), this is the trial PR: the three lowest-risk "single hit" files, proving the conversion pattern and the dummy-rig testing rhythm before touching anything larger or drawing-related.

  • rig-gui-buttons.c, rig-gui-ctrl2.c, rig-gui-func.c — each gtk_vbox_new()/gtk_hbox_new() call gets a GTK_CHECK_VERSION(3,0,0) branch to gtk_box_new() with explicit orientation, so the same source builds under both GTK2 and GTK3.
  • rig-gui-func.c also needed a second fix the original deprecated-API grep missed: GTK_DIALOG(dialog)->vbox is direct struct access, removed in GTK3. Replaced with gtk_dialog_get_content_area(), available since GTK 2.14 — below this project's existing 2.24.0 floor, so no version branch is needed for that part.

configure.ac's GTK3 pin is deliberately not part of this PR — once this pattern's proven, that's the next step.

Test plan

  • Full build succeeds clean under the current GTK2 config (only pre-existing, unrelated deprecation warnings — nothing new)
  • All three files individually compile clean against real GTK 3.24 headers (checked by temporarily pointing the build at gtk+-3.0 locally, not committed — the rest of the codebase isn't converted yet, so a full GTK3 build isn't expected to succeed until later phases)
  • Ran against Hamlib's dummy rig backend — main window, RX Levels, TX Levels, and the Special Functions dialog (the one with the content-area fix) all open and render correctly, controls laid out the same as before

🤖 Generated with Claude Code

Converts the three lowest-risk deprecated-API "single hit" files
identified in the migration scoping (issue fillods#13): rig-gui-buttons.c,
rig-gui-ctrl2.c, and rig-gui-func.c. Each gtk_vbox_new()/gtk_hbox_new()
call gets a GTK_CHECK_VERSION(3,0,0) branch to gtk_box_new() with
explicit orientation, so the same source builds under both GTK2 and
GTK3 - proving the conversion pattern before touching anything larger
or drawing-related.

rig-gui-func.c also needed a second fix the original deprecated-API
grep missed: GTK_DIALOG(dialog)->vbox is direct struct access, removed
in GTK3. Replaced with gtk_dialog_get_content_area(), available since
GTK 2.14 (below this project's existing 2.24.0 floor), so no version
branch is needed for that part.

Verified both ways:
- Full build succeeds clean under the current GTK2 config (only
  pre-existing, unrelated deprecation warnings).
- All three files individually compile clean against real GTK 3.24
  headers (the rest of the codebase isn't converted yet, so a full
  GTK3 build isn't expected to succeed until later phases).
- Ran against Hamlib's dummy rig backend: main window, RX Levels,
  TX Levels, and the Special Functions dialog (the one with the
  content-area fix) all open and render correctly, controls laid
  out as before.

configure.ac's GTK3 pin is deliberately not part of this PR - per the
scoping doc's own sequencing, that comes once this pattern is proven.
@fillods
fillods merged commit 4fd3ccd into fillods:master Sep 20, 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.

2 participants