Difference between revisions of "Tooltips"

From GnuCash
Jump to: navigation, search
(gtk2 / SVN-HEAD)
(Tooltips / Statusbar tips in menus)
Line 18: Line 18:
 
== Tooltips / Statusbar tips in menus ==
 
== Tooltips / Statusbar tips in menus ==
 
=== 1.8-branch ===
 
=== 1.8-branch ===
In 1.8-gnucash almost all menu entries were also showing a statusbar tip. The menu entries/items did not show a tooltip, but the statusbar tip was basically the equivalent to a tooltip. FIXME: How was this done? If the menus were created as GtkMenu then again the real GtkWidget for each item was available, and a tooltip could be set on this widget. FIXME: How was a statusbar text set?
+
In 1.8-gnucash almost all menu entries were also showing a statusbar tip. The menu entries/items did not show a tooltip, but the statusbar tip was basically the equivalent to a tooltip. How was this done? There wasn't any related code in GnuCash, so I suppose this behaviour was implemented in gtk by default.
  
 
=== gtk2 / SVN-HEAD ===
 
=== gtk2 / SVN-HEAD ===
For all menu items that are created as a [http://developer.gnome.org/doc/API/2.0/gtk/GtkAction.html GtkAction] the tooltip is usually set. This is visible by the fact that the buttons in the toolbar will also show a tooltip. HOWEVER, for the menu items in the menus no explanation is displayed anymore. FIXME: How can a statusbar text be set? [http://bugzilla.gnome.org/show_bug.cgi?id=127956 has a RFE] for this which suggests to use the code from [http://cvs.gnome.org/viewcvs/gtk%2B/tests/testmerge.c?view=markup tests/testmerge.c] with the "connect-proxy" signal as an example.
+
For all menu items that are created as a [http://developer.gnome.org/doc/API/2.0/gtk/GtkAction.html GtkAction] the tooltip is usually set. This is visible by the fact that the buttons in the toolbar will also show a tooltip. HOWEVER, for the menu items in the menus no explanation is displayed anymore. How can a statusbar text be set? [http://bugzilla.gnome.org/show_bug.cgi?id=127956 has a RFE] for this which suggests to use the code from [http://cvs.gnome.org/viewcvs/gtk%2B/tests/testmerge.c?view=markup tests/testmerge.c] with the "connect-proxy" signal as an example. This is now implemented in r12295. This section can be removed soon. --[[User:Cstim|Cstim]] 09:01, 8 January 2006 (EST)

Revision as of 14:01, 8 January 2006

Tooltips in GnuCash

In the 1.8-branch of gnucash, all menu items and all multichoice-option values were having a corresponding tooltip that was displayed when the mouse hovers of the items. In the gnome2 version SVN-HEAD, these are no longer there due to missing features in gtk2. This page collects the information about feasible re-implementations of that feature.

Tooltips in Multichoice/Combobox widgets

Old implementation in 1.8

The 1.8-Widget for the multichoice-options was a GtkOptionMenu widget. It contains a GtkMenu where GtkMenuItems are inserted, which are created by gtk_menu_item_new_with_label. This was all used in gnc_build_option_menu() in src/gnome-utils/dialog-utils.c. The tooltip was directly set on any new GtkMenuItem by calling gtk_tooltips_set_tip() on the GtkMenuItem.

New GtkComboBox in gtk2

The old GtkOptionMenu is now deprecated since gtk2.4. Instead, the GtkComboBox has to be used. However, this widget either requires using a Model-View programming, or alternatively it will only allow to set entries by gtk_combo_box_append_text() which is what we currently do in src/gnome-utils/dialog-options.c. The function gtk_combo_box_append_text() will only allow to add one text entry per item, but it does not give access to the actual item widget, so it is impossible to set gtk_tooltips_set_tip() on the item widget.

The implementation of that in gtk_combo_box_new_text() of gtk/gtkcombobox.c confirms that the new GtkComboBox doesn't create widgets for the items anymore. Instead, the items are rendered by a GtkCellRendererText. If they were able to view a tooltip, it would basically mean that any ListView would be able to display a tooltip on any listview cell. HOWEVER, that kind of gtk feature request is in bugzilla since 2001 and NOTHING has been done in that direction. Aaarg. A different application has coded its own workaround here -- maybe we can copy from there.

Tooltips / Statusbar tips in menus

1.8-branch

In 1.8-gnucash almost all menu entries were also showing a statusbar tip. The menu entries/items did not show a tooltip, but the statusbar tip was basically the equivalent to a tooltip. How was this done? There wasn't any related code in GnuCash, so I suppose this behaviour was implemented in gtk by default.

gtk2 / SVN-HEAD

For all menu items that are created as a GtkAction the tooltip is usually set. This is visible by the fact that the buttons in the toolbar will also show a tooltip. HOWEVER, for the menu items in the menus no explanation is displayed anymore. How can a statusbar text be set? has a RFE for this which suggests to use the code from tests/testmerge.c with the "connect-proxy" signal as an example. This is now implemented in r12295. This section can be removed soon. --Cstim 09:01, 8 January 2006 (EST)