From 8df58f953d3ac5830084ddcfc76e4fa51f3ac48d Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Tue, 26 Dec 2017 09:30:07 -0500 Subject: [PATCH] Some migration guide revisions Add a few things, reword some others. --- docs/reference/gtk/migrating-3to4.xml | 79 ++++++++++++++++++++------- 1 file changed, 59 insertions(+), 20 deletions(-) diff --git a/docs/reference/gtk/migrating-3to4.xml b/docs/reference/gtk/migrating-3to4.xml index db3e5927aa..ef6fa58e01 100644 --- a/docs/reference/gtk/migrating-3to4.xml +++ b/docs/reference/gtk/migrating-3to4.xml @@ -173,6 +173,14 @@ +
+ Stop using GdkVisual + + This object is not useful with current GTK+ drawing APIs and has been removed + without replacement. + +
+
Stop using GdkDeviceManager @@ -208,12 +216,19 @@
+
+ Stop using gdk_window_set_event_compression + + Event compression is now always enabled. If you need to see the uncoalesced + motion history, use gdk_event_get_motion_history(). + +
+
Adapt to GdkKeymap API changes - The way to get a keymap has changed slightly. gdk_keymap_get_default() has - been dropped, and gdk_keymap_get_for_display() has been renamed to - gdk_display_get_keymap(). + The way to get a keymap has changed slightly. gdk_keymap_get_for_display() has + been renamed to gdk_display_get_keymap().
@@ -221,7 +236,8 @@ Adapt to GtkHeaderBar API changes The gtk_header_bar_set_show_close_button() function has been renamed to - the more accurate name gtk_header_bar_set_show_title_buttons(). + the more accurate name gtk_header_bar_set_show_title_buttons(). The corresponding + getter and the property itself have also been renamed. @@ -297,7 +313,7 @@
Use gtk_widget_measure - gtk_widget_measure replaces the various gtk_widget_get_preferred_ functions + gtk_widget_measure() replaces the various gtk_widget_get_preferred_ functions for querying sizes.
@@ -318,8 +334,8 @@ If you are using a #GtkDrawingArea for custom drawing, you need to switch - to using gtk_drawing_area_set_draw_func() to set a draw function. This is - pretty much a direct replacement for a #GtkWidget::draw signal handler. + to using gtk_drawing_area_set_draw_func() to set a draw function instead + of connnecting a handler to the #GtkWidget::draw signal. @@ -333,6 +349,20 @@ +
+ Widgets are now visible by default + + The default value of #GtkWidget::visible in GTK+ 4 is %TRUE, so you no + longer need to explicitly show all your widgets. On the flip side, you + need to hide widgets that are not meant to be visible from the start. + + + A convenient way to remove unnecessary property assignments like this + from ui files it run the command gtk4-builder-tool simplify --replace + on them. + +
+
Adapt to changes in animated hiding and showing of widgets @@ -344,7 +374,7 @@
- Stop passing commandline arguments to gtk_init() + Stop passing commandline arguments to gtk_init The gtk_init() and gtk_init_check() functions no longer accept commandline arguments. Just call them without arguments. Other initialization functions @@ -358,28 +388,31 @@
GdkPixbuf is deemphasized - A number of GdkPixbuf-based APIs have been removed. The available replacements - are either using cairo_surface_t or the newly introduced GdkTexture class + A number of #GdkPixbuf-based APIs have been removed. The available replacements + are either using #GIcon, cairo_surface_t or the newly introduced #GdkTexture class instead. - If you are still dealing with pixbufs, you will likely want to use - gdk_texture_new_for_pixbuf() to convert them to texture objects where needed. + If you are dealing with pixbufs, you can use gdk_texture_new_for_pixbuf() + to convert them to texture objects where needed.
GtkWidget event signals are deemphasized - GtkGesture classes have already been introduced in GTK+ 3 to handle input for - many cases. In GTK+ 4, even more are available, such as GtkEventControllerScroll. + Event controllers and #GtkGestures have already been introduced in GTK+ 3 to handle + input for many cases. In GTK+ 4, even more are available, such as #GtkEventControllerScroll + and GtkEventControllerMotion, and the traditional widget signals for handling input, + such as #GtkWidget::motion-event or #GtkWidget::event have been deprecated.
- The gtk_window_fullscreen_on_monitor() API has changed + The gtk_window_fullscreen_on_monitor API has changed - Instead of a monitor number, it now takes a GdkMonitor argument. + Instead of a monitor number, gtk_window_fullscreen_on_monitor() now takes a + #GdkMonitor argument.
@@ -399,14 +432,20 @@
- Adapt to icon-size API changes + Adapt to icon size API changes Instead of the existing extensible set of symbolic icon sizes, GTK+ now only - supports normal and large icons. The actual sizes can be defined by themes via - the CSS property -gtk-icon-size. + supports normal and large icons with the #GtkIconSize enumeration. The actual sizes + can be defined by themes via the CSS property -gtk-icon-size. - The GtkCellRendererPixbuf::stock-size property has been renamed to ::icon-size. + GtkImage setters like gtk_image_set_from_icon_name() no longer take a #GtkIconSize + argument. You can use the separate gtk_image_set_icon_size() setter if you need + to override the icon size. + + + The ::stock-size property of GtkCellRendererPixbuf has been renamed to + #GtkCellRendererPixbuf:icon-size.