[gtk/bin-removal: 49/50] testtooltips: Derive demo from GtkWidget
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/bin-removal: 49/50] testtooltips: Derive demo from GtkWidget
- Date: Mon, 4 May 2020 04:46:04 +0000 (UTC)
commit a7997c964fdea785a06c8e038025486b0308ac88
Author: Matthias Clasen <mclasen redhat com>
Date: Sun May 3 20:20:08 2020 -0400
testtooltips: Derive demo from GtkWidget
tests/testtooltips.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/tests/testtooltips.c b/tests/testtooltips.c
index 88bd6473c6..f4b384f6dc 100644
--- a/tests/testtooltips.c
+++ b/tests/testtooltips.c
@@ -29,23 +29,23 @@ typedef struct _MyTooltipClass MyTooltipClass;
struct _MyTooltip
{
- GtkBin parent_instance;
+ GtkWidget parent_instance;
};
struct _MyTooltipClass
{
- GtkBinClass parent_class;
+ GtkWidgetClass parent_class;
};
static GType my_tooltip_get_type (void);
-G_DEFINE_TYPE (MyTooltip, my_tooltip, GTK_TYPE_BIN)
+G_DEFINE_TYPE (MyTooltip, my_tooltip, GTK_TYPE_WIDGET)
static void
my_tooltip_init (MyTooltip *tt)
{
GtkWidget *label = gtk_label_new ("Some text in a tooltip");
- gtk_container_add (GTK_CONTAINER (tt), label);
+ gtk_widget_set_parent (label, GTK_WIDGET (tt));
gtk_widget_add_css_class (GTK_WIDGET (tt), "background");
}
@@ -53,6 +53,7 @@ my_tooltip_init (MyTooltip *tt)
static void
my_tooltip_class_init (MyTooltipClass *tt_class)
{
+ gtk_widget_class_set_layout_manager_type (GTK_WIDGET_CLASS (tt_class), GTK_TYPE_BIN_LAYOUT);
gtk_widget_class_set_css_name (GTK_WIDGET_CLASS (tt_class), "tooltip");
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]