Re: [gtk-list] Tooltips and GtkPreview




"Juergen A. Erhard" <jae@laden.ilk.de> writes:

> I posted this a couple of weeks ago. It either didn't get
> through or it was ignored [:-(].  So I'm gonna ask again...
> 
> While hacking away, I found something strange: add a tooltip to
> GtkPreview. Doesn't show up, right? At least it didn't here on my
> machine. Until 'unclutter' switched off the mouse cursor, that is. A
> second later (the defined wait period for tooltips) the tooltip pops
> up!!!!

The problem is that Tooltips needs to get events on the widget
that has the tooltips. Since the Preview widget is a NO_WINDOW widget,
this won't work. The solution is to put the preview into an EventBox.
(see EventBox's in the tutorial). You'll also need to set up
the events that the tooltips looks for - something like:

gtk_widget_set_events (event_box, GDK_ENTER_NOTIFY_MASK
                       | GDK_LEAVE_NOTIFY_MASK | GDK_MOTION_NOTIFY_MASK);

This isn't necessary with buttons or entries, since they already
get these events.
 
> Anybody know why that is? And how to get the tooltip to show up *with*
> a mouse cursor?  Ah, lest I forget: it's gtk+970925.  Will check
> 9710xx soon, and if it's gone... ignore this.
  ^^^^^^

Why not try 0.99.0 - you don't have to install all the intermediate
versions... ;-)

Regards,
                                        Owen



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