[gtk+/gtk-2-90: 153/200] Remove deprecated GtkTooltips
- From: Javier Jardón <jjardon src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-2-90: 153/200] Remove deprecated GtkTooltips
- Date: Mon, 3 May 2010 00:09:28 +0000 (UTC)
commit e8f1a3ccf073e605f56a0e7c89acb4bda9b47b3d
Author: Christian Dywan <christian twotoasts de>
Date: Thu Dec 10 12:28:38 2009 +0100
Remove deprecated GtkTooltips
gtk/Makefile.am | 6 +-
gtk/gtkmenutoolbutton.c | 2 -
gtk/gtktoolbar.c | 3 +-
gtk/gtktoolbar.h | 7 -
gtk/gtktoolitem.c | 2 -
gtk/gtktoolitem.h | 1 -
gtk/gtktooltips.c | 338 -----------------------------------------------
gtk/gtktooltips.h | 109 ---------------
tests/testgtk.c | 66 +++-------
9 files changed, 20 insertions(+), 514 deletions(-)
---
diff --git a/gtk/Makefile.am b/gtk/Makefile.am
index 748dd65..5670626 100644
--- a/gtk/Makefile.am
+++ b/gtk/Makefile.am
@@ -634,11 +634,9 @@ gtk_base_c_sources = \
# Deprecated
gtk_public_h_sources += \
- gtkprogress.h \
- gtktooltips.h
+ gtkprogress.h
gtk_base_c_sources += \
- gtkprogress.c \
- gtktooltips.c
+ gtkprogress.c
gtk_c_sources = $(gtk_base_c_sources)
gtk_all_c_sources = $(gtk_base_c_sources)
diff --git a/gtk/gtkmenutoolbutton.c b/gtk/gtkmenutoolbutton.c
index 425f8d5..460423d 100644
--- a/gtk/gtkmenutoolbutton.c
+++ b/gtk/gtkmenutoolbutton.c
@@ -21,8 +21,6 @@
#include "config.h"
-#undef GTK_DISABLE_DEPRECATED /* GtkTooltips */
-
#include "gtkmenutoolbutton.h"
#include "gtktogglebutton.h"
#include "gtkarrow.h"
diff --git a/gtk/gtktoolbar.c b/gtk/gtktoolbar.c
index e06ceed..dcd0bc9 100644
--- a/gtk/gtktoolbar.c
+++ b/gtk/gtktoolbar.c
@@ -640,8 +640,7 @@ gtk_toolbar_init (GtkToolbar *toolbar)
toolbar->style = DEFAULT_TOOLBAR_STYLE;
toolbar->icon_size = DEFAULT_ICON_SIZE;
priv->animation = DEFAULT_ANIMATION_STATE;
- toolbar->tooltips = NULL; /* FIXME: Remove this */
-
+
priv->arrow_button = gtk_toggle_button_new ();
g_signal_connect (priv->arrow_button, "button-press-event",
G_CALLBACK (gtk_toolbar_arrow_button_press), toolbar);
diff --git a/gtk/gtktoolbar.h b/gtk/gtktoolbar.h
index fccfe4e..89af1d8 100644
--- a/gtk/gtktoolbar.h
+++ b/gtk/gtktoolbar.h
@@ -38,7 +38,6 @@
#include <gtk/gtkcontainer.h>
-#include <gtk/gtktooltips.h>
#include <gtk/gtktoolitem.h>
G_BEGIN_DECLS
@@ -94,12 +93,6 @@ struct _GtkToolbar
GtkToolbarStyle GSEAL (style);
GtkIconSize GSEAL (icon_size);
-#ifndef GTK_DISABLE_DEPRECATED
- GtkTooltips *GSEAL (tooltips);
-#else
- gpointer GSEAL (_tooltips);
-#endif
-
/*< private >*/
gint GSEAL (button_maxw); /* maximum width of homogeneous children */
gint GSEAL (button_maxh); /* maximum height of homogeneous children */
diff --git a/gtk/gtktoolitem.c b/gtk/gtktoolitem.c
index 17309e9..536392c 100644
--- a/gtk/gtktoolitem.c
+++ b/gtk/gtktoolitem.c
@@ -24,8 +24,6 @@
#include <string.h>
-#undef GTK_DISABLE_DEPRECATED /* GtkTooltips */
-
#include "gtktoolitem.h"
#include "gtkmarshalers.h"
#include "gtktoolshell.h"
diff --git a/gtk/gtktoolitem.h b/gtk/gtktoolitem.h
index a3db72a..1e1ecbf 100644
--- a/gtk/gtktoolitem.h
+++ b/gtk/gtktoolitem.h
@@ -28,7 +28,6 @@
#define __GTK_TOOL_ITEM_H__
#include <gtk/gtkbin.h>
-#include <gtk/gtktooltips.h>
#include <gtk/gtkmenuitem.h>
#include <gtk/gtksizegroup.h>
diff --git a/tests/testgtk.c b/tests/testgtk.c
index f3a9345..3e596d1 100644
--- a/tests/testgtk.c
+++ b/tests/testgtk.c
@@ -138,15 +138,6 @@ build_option_menu (gchar *items[],
return omenu;
}
-static void
-destroy_tooltips (GtkWidget *widget, GtkWindow **window)
-{
- GtkTooltips *tt = g_object_get_data (G_OBJECT (*window), "tooltips");
- g_object_unref (tt);
- *window = NULL;
-}
-
-
/*
* Windows with an alpha channel
*/
@@ -3922,7 +3913,6 @@ create_tooltips (GtkWidget *widget)
GtkWidget *frame;
GtkWidget *tips_query;
GtkWidget *separator;
- GtkTooltips *tooltips;
if (!window)
{
@@ -3942,11 +3932,6 @@ create_tooltips (GtkWidget *widget)
G_CALLBACK (destroy_tooltips),
&window);
- tooltips=gtk_tooltips_new();
- g_object_ref (tooltips);
- gtk_object_sink (GTK_OBJECT (tooltips));
- g_object_set_data (G_OBJECT (window), "tooltips", tooltips);
-
box1 = gtk_vbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (window), box1);
@@ -3957,26 +3942,20 @@ create_tooltips (GtkWidget *widget)
button = gtk_toggle_button_new_with_label ("button1");
gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0);
- gtk_tooltips_set_tip (tooltips,
- button,
- "This is button 1",
- "ContextHelp/buttons/1");
+ gtk_widget_set_tooltip_text (button, "This is button 1");
button = gtk_toggle_button_new_with_label ("button2");
gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0);
- gtk_tooltips_set_tip (tooltips,
- button,
- "This is button 2. This is also a really long tooltip which probably won't fit on a single line and will therefore need to be wrapped. Hopefully the wrapping will work correctly.",
- "ContextHelp/buttons/2_long");
+ gtk_widget_set_tooltip_text (button,
+ "This is button 2. This is also a really long tooltip which probably "
+ "won't fit on a single line and will therefore need to be wrapped. "
+ "Hopefully the wrapping will work correctly.");
toggle = gtk_toggle_button_new_with_label ("Override TipsQuery Label");
gtk_box_pack_start (GTK_BOX (box2), toggle, TRUE, TRUE, 0);
- gtk_tooltips_set_tip (tooltips,
- toggle,
- "Toggle TipsQuery view.",
- "Hi msw! ;)");
+ gtk_widget_set_tooltip_text (toggle, "Toggle TipsQuery view.");
box3 =
g_object_new (gtk_vbox_get_type (),
@@ -3998,11 +3977,7 @@ create_tooltips (GtkWidget *widget)
"swapped_signal::clicked", gtk_tips_query_start_query, tips_query,
NULL);
gtk_box_set_child_packing (GTK_BOX (box3), button, FALSE, FALSE, 0, GTK_PACK_START);
- gtk_tooltips_set_tip (tooltips,
- button,
- "Start the Tooltips Inspector",
- "ContextHelp/buttons/?");
-
+ gtk_widget_set_tooltip_text (button "Start the Tooltips Inspector");
g_object_set (g_object_connect (tips_query,
"signal::widget_entered", tips_query_widget_entered, toggle,
@@ -4038,7 +4013,7 @@ create_tooltips (GtkWidget *widget)
gtk_widget_set_can_default (button, TRUE);
gtk_widget_grab_default (button);
- gtk_tooltips_set_tip (tooltips, button, "Push this button to close window", "ContextHelp/buttons/Close");
+ gtk_widget_set_tooltip_text (button, "Push this button to close window");
}
if (!gtk_widget_get_visible (window))
@@ -4697,8 +4672,7 @@ create_item_factory (GtkWidget *widget)
GtkWidget *button;
GtkAccelGroup *accel_group;
GtkItemFactory *item_factory;
- GtkTooltips *tooltips;
-
+
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_screen (GTK_WINDOW (window),
@@ -4745,20 +4719,14 @@ create_item_factory (GtkWidget *widget)
/* Test how tooltips (ugh) work on menu items
*/
- tooltips = gtk_tooltips_new ();
- g_object_ref (tooltips);
- gtk_object_sink (GTK_OBJECT (tooltips));
- g_object_set_data_full (G_OBJECT (window), "testgtk-tooltips",
- tooltips, (GDestroyNotify)g_object_unref);
-
- gtk_tooltips_set_tip (tooltips, gtk_item_factory_get_item (item_factory, "/File/New"),
- "Create a new file", NULL);
- gtk_tooltips_set_tip (tooltips, gtk_item_factory_get_item (item_factory, "/File/Open"),
- "Open a file", NULL);
- gtk_tooltips_set_tip (tooltips, gtk_item_factory_get_item (item_factory, "/File/Save"),
- "Safe file", NULL);
- gtk_tooltips_set_tip (tooltips, gtk_item_factory_get_item (item_factory, "/Preferences/Color"),
- "Modify color", NULL);
+ gtk_widget_set_tooltip_text (gtk_item_factory_get_item (item_factory, "/File/New"),
+ "Create a new file");
+ gtk_widget_set_tooltip_text (gtk_item_factory_get_item (item_factory, "/File/Open"),
+ "Open a file");
+ gtk_widget_set_tooltip_text (gtk_item_factory_get_item (item_factory, "/File/Save"),
+ "Safe file");
+ gtk_widget_set_tooltip_text (gtk_item_factory_get_item (item_factory, "/Preferences/Color"),
+ "Modify color");
box1 = gtk_vbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (window), box1);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]