GTK 3.x to GTK 4 migration guide missing changes
I recently migrated a simple Python application from Gtk3 to Gkt4, and while the migration documentation was helpful in most cases, I found several things that were not mentioned (and I hopefully migrated correctly):
Gtk.Image()
now works pretty differently and Gtk.Picture()
is the more direct replacement (at least in my case).
Gtk.VBox
and Gtk.HBox
were removed. This I think was pretty well known (and there is a deprecation notice e.g. here: https://docs.gtk.org/gtk3/class.HBox.html) but it might still be mentioned for those that don't know Gtk?
In Gtk.Dialog
, vbox
and action_area
are no longer exposed; now there's a content_area
(accessed vith get_content_area()
) and the action area is no longer "directly" accessible.
Gtk.ScrolledWindow
replaced .add(...)
with .set_child(...)
.
Gtk.get_current_event_time()
was replaced with Gdk.CURRENT_TIME
.
Gtk.StyleContext.add_provider_for_screen()
was replaced with Gtk.StyleContext.add_provider_for_display()
.