/***********************************************************************
Tooltips
***********************************************************************/
+
+#ifndef HAVE_PGTK
+
/* Gtk+ calls this callback when the parent of our tooltip dummy changes.
We use that to pop down the tooltip. This happens if Gtk+ for some
reason wants to change or hide the tooltip. */
return FALSE;
}
+#else
+
+void
+xg_show_tooltip (struct frame *f,
+ Lisp_Object string)
+{
+ Lisp_Object encoded_string = ENCODE_UTF_8 (string);
+ gtk_widget_set_tooltip_text (FRAME_GTK_OUTER_WIDGET (f), SSDATA (encoded_string));
+}
+
+bool
+xg_hide_tooltip (struct frame *f)
+{
+ if (gtk_widget_get_tooltip_text (FRAME_GTK_OUTER_WIDGET (f)) == NULL)
+ return FALSE;
+ gtk_widget_set_tooltip_text (FRAME_GTK_OUTER_WIDGET (f), NULL);
+ return TRUE;
+}
+
+#endif
+
\f
/***********************************************************************
General functions for creating widgets, resizing, events, e.t.c.
f->output_data.xp->ttip_widget = 0;
f->output_data.xp->ttip_lbl = 0;
f->output_data.xp->ttip_window = 0;
+#ifndef HAVE_PGTK
gtk_widget_set_tooltip_text (wtop, "Dummy text");
g_signal_connect (wtop, "query-tooltip", G_CALLBACK (qttip_cb), f);
+#endif
{
GdkScreen *screen = gtk_widget_get_screen (wtop);
f->output_data.xp->ttip_widget = 0;
f->output_data.xp->ttip_lbl = 0;
f->output_data.xp->ttip_window = 0;
+#ifndef HAVE_PGTK
gtk_widget_set_tooltip_text (wtop, "Dummy text");
g_signal_connect (wtop, "query-tooltip", G_CALLBACK (qttip_cb), f);
+#endif
{
GdkScreen *screen = gtk_widget_get_screen (wtop);
if (wtoadd) gtk_container_add (GTK_CONTAINER (w), wtoadd);
if (! item->enabled) gtk_widget_set_sensitive (w, FALSE);
+#ifdef HAVE_PGTK
+ if (!NILP (item->help))
+ gtk_widget_set_tooltip_text (w, SSDATA (item->help));
+#endif
+
return w;
}
Fx_hide_tip ();
block_input ();
- ok = xg_prepare_tooltip (f, string, &width, &height);
- if (ok)
- {
- compute_tip_xy (f, parms, dx, dy, width, height, &root_x, &root_y);
- xg_show_tooltip (f, root_x, root_y);
- tip_last_frame = frame;
- }
+
+ ok = true;
+ xg_show_tooltip (f, string);
+ tip_last_frame = frame;
unblock_input ();
if (ok) goto start_timer;