GNOME Bugzilla – Bug 531527
Advanced tooltip editor for glade
Last modified: 2018-03-26 15:05:15 UTC
The new gtk has brought support for styled tooltips, and I believe the entire Gnome could be made easier to use by letting developers use this from glade.
Created attachment 110400 [details] Custom tooltip editor mockup This is an example of a custom tooltip editor, which seams to be used some places on windows. The tooltip produced is in the office 2007 style and contains detailed info on _how to use_ the hovered widget, not just _what it is_.
Great I agree, even I wanted to use some advanced tooltips in Glade to better express why widgets/properties/signals may be deprecated or unsupported by the target toolkit. I havent looked into the new tooltip api very deeply, as I understand you can draw a GdkWindow in a custom way for your tooltips correct ? On the builder side, how do you propose to get this working ? What code in the gtk+ runtime will handle actually drawing the tooltip ?
Well, gtk 2.12 contains the following class (using pygtk, as that's what I know) class gtk.Tooltip(gobject.GObject): def set_custom(widget) def set_icon(pixbuf) def set_icon_from_stock(stock_id, size) def set_markup(markup) def set_text(text) So there are two ways: * Creating a hbox with labels and stuff * Simply setting an icon and a text. If we want the footers and headers from the mockup (and I personally like them a lot :)) we need the first way. I don't know if this is the right place to post the request, or it should rather be somewhere like the HIG, but as it has a mockup I thought glade would be it.
Oh, and the way the tooltips are set on the widget: http://www.pygtk.org/docs/pygtk/class-gtktooltip.html#id3587486 When you need a tooltip with a little more fancy contents, like adding an image, or you want the tooltip to have different contents per gtk.TreeView row or cell, you will have to do a little more work: * Set the GtkWidget:has-tooltip property to True, this will make GTK+ monitor the widget for motion and related events which are needed to determine when and where to show a tooltip. * Connect to the GtkWidget::query-tooltip signal. This signal will be emitted when a tooltip is supposed to be shown. One of the arguments passed to the signal handler is a gtk.Tooltip object. This is the object that we are about to display as a tooltip, and can be manipulated in your callback using functions like set_icon. There are functions for setting the tooltip's markup, setting an image from a stock icon, or even putting in a custom widget. * Return True from your query-tooltip handler. This causes the tooltip to be show. If you return False, it will not be shown.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/glade/issues/27.