gtk3: convert single-hit files as a trial for the GTK2→GTK3 migration - #27
Merged
Merged
Conversation
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
approved these changes
Sep 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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— eachgtk_vbox_new()/gtk_hbox_new()call gets aGTK_CHECK_VERSION(3,0,0)branch togtk_box_new()with explicit orientation, so the same source builds under both GTK2 and GTK3.rig-gui-func.calso needed a second fix the original deprecated-API grep missed:GTK_DIALOG(dialog)->vboxis direct struct access, removed in GTK3. Replaced withgtk_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
gtk+-3.0locally, not committed — the rest of the codebase isn't converted yet, so a full GTK3 build isn't expected to succeed until later phases)🤖 Generated with Claude Code