Merge branch 'docs-old-boxes' into 'gtk-3-24'

docs: Clarify when to replace old boxes with Grid

See merge request GNOME/gtk!1170
This commit is contained in:
Timm Bäder 2019-11-11 07:39:05 +00:00
commit b25f193da3
2 changed files with 19 additions and 14 deletions

View File

@ -50,10 +50,11 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
* from #GtkBox. No further changes are needed, since the default
* value of the #GtkOrientable:orientation property is
* %GTK_ORIENTATION_HORIZONTAL.
* If you dont need first-child or last-child styling, and want your code
* to be future-proof, the recommendation is to switch to #GtkGrid instead
* of nested boxes. For more information about migrating to #GtkGrid,
* see [Migrating from other containers to GtkGrid][gtk-migrating-GtkGrid].
*
* If you have a grid-like layout composed of nested boxes, and you dont
* need first-child or last-child styling, the recommendation is to switch
* to #GtkGrid. For more information about migrating to #GtkGrid, see
* [Migrating from other containers to GtkGrid][gtk-migrating-GtkGrid].
*/

View File

@ -45,20 +45,24 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
*
* All children are allocated the same width.
*
* GtkVBox has been deprecated. You can use #GtkBox instead, which is a
* very quick and easy change. If you have derived your own classes from
* GtkVBox, you can simply change the inheritance to derive directly
* from #GtkBox, and set the #GtkOrientable:orientation property to
* %GTK_ORIENTATION_VERTICAL in your instance init function, with a
* call like:
* GtkVBox has been deprecated. You can use #GtkBox with a #GtkOrientable:orientation
* set to %GTK_ORIENTATION_VERTICAL instead when calling gtk_box_new(),
* which is a very quick and easy change.
*
* If you have derived your own classes from GtkVBox, you can change the
* inheritance to derive directly from #GtkBox, and set the #GtkOrientable:orientation
* property to %GTK_ORIENTATION_VERTICAL in your instance init function,
* with a call like:
*
* |[<!-- language="C" -->
* gtk_orientable_set_orientation (GTK_ORIENTABLE (object),
* GTK_ORIENTATION_VERTICAL);
* ]|
* If you dont need first-child or last-child styling and want your code
* to be future-proof, the recommendation is to switch to #GtkGrid instead
* of nested boxes. For more information about migrating to #GtkGrid,
* see [Migrating from other containers to GtkGrid][gtk-migrating-GtkGrid].
*
* If you have a grid-like layout composed of nested boxes, and you dont
* need first-child or last-child styling, the recommendation is to switch
* to #GtkGrid. For more information about migrating to #GtkGrid, see
* [Migrating from other containers to GtkGrid][gtk-migrating-GtkGrid].
*/
G_DEFINE_TYPE (GtkVBox, gtk_vbox, GTK_TYPE_BOX)