menubutton: Warn about deprecated buildable features

<child> is deprecated for setting child properties
This commit is contained in:
Matthias Clasen 2025-01-04 11:05:21 -05:00
parent 458560505e
commit 98bed3561e

View File

@ -106,6 +106,7 @@
#include "gtkbuttonprivate.h"
#include "gtknative.h"
#include "gtkwindow.h"
#include "gtkbuilderprivate.h"
typedef struct _GtkMenuButtonClass GtkMenuButtonClass;
typedef struct _GtkMenuButtonPrivate GtkMenuButtonPrivate;
@ -700,9 +701,14 @@ gtk_menu_button_buildable_add_child (GtkBuildable *buildable,
const char *type)
{
if (GTK_IS_WIDGET (child))
gtk_menu_button_set_child (GTK_MENU_BUTTON (buildable), GTK_WIDGET (child));
{
gtk_buildable_child_deprecation_warning (buildable, builder, NULL, "child");
gtk_menu_button_set_child (GTK_MENU_BUTTON (buildable), GTK_WIDGET (child));
}
else
parent_buildable_iface->add_child (buildable, builder, child, type);
{
parent_buildable_iface->add_child (buildable, builder, child, type);
}
}
static void