RFC: Tooltips redesign (needed e.g. for row dependent tips in treeview)


After having commented on bug #80980 and #50619 without an answer in a week I'm asking here for further comments.

Up to now the tooltip design is based on a static tip per widget. To support per row (or column or cell) tooltips in treeview the tooltip API has to get redesigned.

Two possible implementations come to my mind:

1) Adding the option of using a function pointer as an argument to gtk_tooltips_set_tip. Storing that in GtkTooltipsData and using it (if !=NULL) to query the tip according to the relative mouse position. [perhaps using a boolean argument to distinguish between normal and private tip].

E.g. void gtk_tooltips_set_tip_function(GtkTooltips *tooltips, GtkWidget *widget, const gchar *(fun)(GtkWidget*,gint x,gint y,gboolean private_tip));

This option keeps the current logic of an (widget-)external tip object.

2) Adding a signal to each widget to query for the matching tip. (three arguments: x,y,private) call this signal if there is no tip registered for this widget. This could gradually eliminate the need to store the tips outside of the widget structure.

This option delegates figuring out the tip text back to the widget.

Which way to go? (I'd prefer 2 since I do not know the reason for starting with 1 in the past).

Any ideas, comments, criticism, unfinished patches?

Attachment: signature.asc
Description: OpenPGP digital signature

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