rendered paste bodyIndex: src/EmbedWindow.cpp
===================================================================
RCS file: /cvs/gnome/gnome-gecko-embed/src/EmbedWindow.cpp,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 EmbedWindow.cpp
--- src/EmbedWindow.cpp 13 Mar 2006 12:44:57 -0000 1.1.1.1
+++ src/EmbedWindow.cpp 13 Mar 2006 14:25:06 -0000
@@ -359,6 +359,19 @@
// nsITooltipListener
+static gboolean
+tooltips_paint_window (GtkWidget *window)
+{
+ // draw tooltip style border around the text
+ gtk_paint_flat_box (window->style, window->window,
+ GTK_STATE_NORMAL, GTK_SHADOW_OUT,
+ NULL, window, "tooltip",
+ 0, 0,
+ window->allocation.width, window->allocation.height);
+
+ return FALSE;
+}
+
NS_IMETHODIMP
EmbedWindow::OnShowTooltip(PRInt32 aXCoords, PRInt32 aYCoords,
const PRUnichar *aTipText)
@@ -404,12 +417,15 @@
// realize the widget
gtk_widget_realize(sTipWindow);
+ g_signal_connect (G_OBJECT(sTipWindow), "expose-event",
+ G_CALLBACK(tooltips_paint_window), NULL);
+
// set up the label for the tooltip
GtkWidget *label = gtk_label_new(tipText.get());
// wrap automatically
gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
gtk_container_add(GTK_CONTAINER(sTipWindow), label);
- gtk_container_set_border_width(GTK_CONTAINER(sTipWindow), 3);
+ gtk_container_set_border_width(GTK_CONTAINER(sTipWindow), 4);
// set the coords for the widget
gtk_widget_set_uposition(sTipWindow, aXCoords + root_x,
aYCoords + root_y);
@@ -417,13 +433,6 @@
// and show it.
gtk_widget_show_all(sTipWindow);
- // draw tooltip style border around the text
- gtk_paint_flat_box(sTipWindow->style, sTipWindow->window,
- GTK_STATE_NORMAL, GTK_SHADOW_OUT,
- NULL, GTK_WIDGET(sTipWindow), "tooltip",
- 0, 0,
- sTipWindow->allocation.width, sTipWindow->allocation.height);
-
return NS_OK;
}