(13/02/02) Erwann Chenede - <erwann.chenede@sun.com>
* moved the default tooltips settings initialization to gtk_tooltips_set_tip.
This commit is contained in:
@@ -49,8 +49,6 @@
|
||||
static void gtk_tooltips_class_init (GtkTooltipsClass *klass);
|
||||
static void gtk_tooltips_init (GtkTooltips *tooltips);
|
||||
static void gtk_tooltips_destroy (GtkObject *object);
|
||||
static void gtk_tooltips_realize (GtkWidget *widget);
|
||||
|
||||
|
||||
static gint gtk_tooltips_event_handler (GtkWidget *widget,
|
||||
GdkEvent *event);
|
||||
@@ -97,13 +95,9 @@ static void
|
||||
gtk_tooltips_class_init (GtkTooltipsClass *class)
|
||||
{
|
||||
GtkObjectClass *object_class;
|
||||
GtkWidgetClass *widget_class;
|
||||
|
||||
object_class = (GtkObjectClass*) class;
|
||||
parent_class = gtk_type_class (GTK_TYPE_OBJECT);
|
||||
widget_class = (GtkWidgetClass*) class;
|
||||
|
||||
widget_class->realize = gtk_tooltips_realize;
|
||||
|
||||
object_class->destroy = gtk_tooltips_destroy;
|
||||
}
|
||||
@@ -123,28 +117,6 @@ gtk_tooltips_init (GtkTooltips *tooltips)
|
||||
tooltips->last_popdown.tv_usec = -1;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_tooltips_realize (GtkWidget *widget)
|
||||
{
|
||||
GdkScreen *screen = gtk_widget_get_screen (widget);
|
||||
|
||||
if (!g_object_get_data (G_OBJECT (screen),"gtk-tooltips-have-rc"))
|
||||
{
|
||||
gtk_rc_parse_string_for_screen (screen,
|
||||
"style \"gtk-default-tooltips-style\" {\n"
|
||||
" bg[NORMAL] = \"#ffffc0\"\n"
|
||||
" fg[NORMAL] = \"#000000\"\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"widget \"gtk-tooltips*\" style : gtk \"gtk-default-tooltips-style\"\n");
|
||||
g_object_set_data (G_OBJECT (screen), "gtk-tooltips-have-rc",
|
||||
widget);
|
||||
}
|
||||
|
||||
if (GTK_WIDGET_CLASS (parent_class)->realize)
|
||||
(*GTK_WIDGET_CLASS (parent_class)->realize) (widget);
|
||||
}
|
||||
|
||||
GtkTooltips *
|
||||
gtk_tooltips_new (void)
|
||||
{
|
||||
@@ -269,12 +241,28 @@ gtk_tooltips_set_tip (GtkTooltips *tooltips,
|
||||
const gchar *tip_private)
|
||||
{
|
||||
GtkTooltipsData *tooltipsdata;
|
||||
GdkScreen *screen;
|
||||
|
||||
g_return_if_fail (GTK_IS_TOOLTIPS (tooltips));
|
||||
g_return_if_fail (widget != NULL);
|
||||
|
||||
tooltipsdata = gtk_tooltips_data_get (widget);
|
||||
|
||||
screen = gtk_widget_get_screen (widget);
|
||||
|
||||
if (!g_object_get_data (G_OBJECT (screen),"gtk-tooltips-have-rc"))
|
||||
{
|
||||
gtk_rc_parse_string_for_screen (screen,
|
||||
"style \"gtk-default-tooltips-style\" {\n"
|
||||
" bg[NORMAL] = \"#ffffc0\"\n"
|
||||
" fg[NORMAL] = \"#000000\"\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"widget \"gtk-tooltips*\" style : gtk \"gtk-default-tooltips-style\"\n");
|
||||
g_object_set_data (G_OBJECT (screen), "gtk-tooltips-have-rc",
|
||||
widget);
|
||||
}
|
||||
|
||||
if (!tip_text)
|
||||
{
|
||||
if (tooltipsdata)
|
||||
|
||||
Reference in New Issue
Block a user