Re: Tooltips progress



On Wed, 2006-05-31 at 22:08 +0200, Kristian Rietveld wrote:

> Currently, we are using the following query-tooltips signal:
> 
>   gboolean (*query_tooltip)     (GtkWidget           *widget,
>                                  gint                 x,
>                                  gint                 y,
>                                  GtkTooltip          *tooltip);
> 
> But if a user sets a custom using gtk_widget_set_custom_window(), we don't
> have to pass a GtkTooltip around.  So currently I just set the tooltip
> field to NULL, so the user knows he has to use his own custom tooltip
> window (and we assume he has a reference to that).  Is this okay or do
> we want to change this?  We could also move the _set_custom_window()
> functions into GtkTooltip for example.

I would very much appreciate if the GtkTooltip object also kept track
of the custom window. IMHO it makes no sense to handle this differently.

gtk_tooltip_set_markup() vs. gtk_tooltip_set_window()

simply feels much better than the asymmetry in

gtk_tooltip_set_markup() vs. gtk_widget_set_tooltip_window()

The current approach even limits the new tooltip system's use cases,
since you have to set the custom window *outside* the callback. There
is no way to decide *in* the callback if a standard tooltip is
sufficient, or if a custom window is needed.

Another problem is the assymetry in getting the relevant data to the
callback. With markup, the GtkTooltip can be queried for the markup,
if it's a custom window, you have to get it to the callback somehow.
In your example code it's passed as user_data, but user_data is
often not available since it's needed for other things, so you
have to add a "GtkWidget *tooltip_window" to the "other thing".
If "other thing" is e.g. the application toplevel window, which
of the sub-widget's tooltips should it keep? All of them? People
will in many cases end up attaching the tooltip window to the
widget.

I also fail to see why the "has-tooltip" property has to be
set to TRUE, even tho a tooltip window was set on the widget.

ciao,
--mitch




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]