Skip to content

Conversation

@MuhammadMuradG
Copy link
Contributor

@MuhammadMuradG MuhammadMuradG commented Jun 12, 2023

Describe your changes in detail

This PR migrates from Gtk3 to Gtk4, from3to4, and taking also into consideration Gtk5, from4to5.

Note the following:

  • This changes required GTK4 v4.10 at least (Primary, because we use Gtk.AlertDialog to implement Toga Dialog. Otherwise, we either rebuild it from scratch using Gtk.Window or using deprecated Gtk API).
  • Layout mechanism has been completely refactored.
  • Applying styles on widgets has been changed.
  • Tree widget needs a refactoring by one of the new Gtk4 widgets instead of removed Gtk3 widget (Gtk.TreeModel).
  • Menus and Commands will be addressed in HIG-compliant for GTK menus #1931
  • Fixes some bugs.

Audit checklist:

  • app
  • fonts
  • icons
  • images
  • keys
  • paths
  • window
  • activityindicator
  • base
  • box
  • button
  • canvas
  • dateinput
  • detailedlist
  • divider
  • imageview
  • label
  • multilinetextinput
  • numberinput
  • optioncontainer
  • paswordinput
  • progressbar
  • scrollcontainer
  • selection
  • slider
  • splitcontainer
  • switch
  • table
  • textinput
  • timeinput
  • tree
  • webview

What problem does this change solve?

This PR migrate from Gtk3 (have a lot of deprecated functions and old UI) to Gtk4 and does not violate what will be in Gtk5.

Related issues:

Refs #1931
Refs #1935

PR Checklist:

  • All new features have been tested
  • All new features have been documented
  • I have read the CONTRIBUTING.md file
  • I will abide by the code of conduct

@freakboy3742
Copy link
Member

Wow - this is a big chunk of work :-) Thanks for taking on this project.

As I indicated in #1935, we're in the middle of a widget audit right now, so there's a lot of churn happening with widget implementations - but we're also building GUI test cases for all widgets. Those tests (and the test probes in the gtk/tests_backends folder) will be a key part of acceptance testing for this PR.

At present, this PR is failing CI because of basic formatting (towncrier and pre-commit failures) - I'd strongly recommend setting up your development environment as described in the Toga docs to avoid these issues. Once those problems are resolved, you're going to hit a bunch of problems with the testbed app - this is the test harness we're using to validate GUI backends. That testbed will require modifications to run GTK4 code, as will the GTK probes (defined in the gtk/tests_backend folder) that allow the GTK backend to be tested. Procedurally, I'm unlikely to take a deep dive into this code until those tests pass.

@MuhammadMuradG MuhammadMuradG marked this pull request as draft June 12, 2023 08:45
@danyeaw
Copy link
Member

danyeaw commented Feb 3, 2025

Hi @MuhammadMuradG, with #3087 now merged based on some of the work you did here, it would be really great to have your help developing GTK3 to 4 translations on a widget by widget basis. I'll update #3069 to include a checklist of items that need to be ported. Should we keep your branch alive for reference and close this PR?

@freakboy3742
Copy link
Member

I'm going to close this PR. The work @danyeaw has been doing recently has allowed us to tackle this problem piecemeal, rather than waiting until we have all the widgets working. There's some good material in this PR that we might be able to use; but it's going to be easier to pull over that code on a per-widget basis rather than try to resurrect this PR.

johnzhou721 added a commit to johnzhou721/toga that referenced this pull request Sep 24, 2025
@johnzhou721 johnzhou721 mentioned this pull request Sep 24, 2025
4 tasks
mhsmith pushed a commit that referenced this pull request Sep 24, 2025
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.

4 participants