Aw: Re: Tooltips don't appear every time while hoovering over a widget



Hi,

I've solved the issue! :-) :-) :-)

Below I'm telling you what's going wrong.

"Thomas Funk" <t funk web de> wrote:
An: gtk-perl-list gnome org
Betreff: Re: Tooltips don't appear every time while hoovering over a widget

On 03/05/2014 08:14 PM, zentara wrote:> On Wed, 5 Mar 2014 14:08:51 +0100
"Thomas Funk" <t funk web de> wrote:

"Emmanuele Bassi" <ebassi gmail com> wrote:

don't. GtkTooltips has long since been deprecated, and should never be
used in newly written code:

    https://developer.gnome.org/gtk2/stable/GtkTooltips.html

you should simply set the tooltip through the
Gtk2::Widget::set_tooltip_text() method (or set_tooltip_markup()
method, if you want to use Pango markup in the tooltips).

[..snip..]

Hi, I don't want to contradict Emmanuelle Bassi, about
it being deprecated, but here is a script that works
with Tooltips.

The glitch as far as I remember, was that tooltip needed 
an eventbox on non-windowed widgets, like Labels. I hope this
example helps.

[..snip..]

Gtk2::Tooltips doesn't work inside the module (SimpleGtk2.pm)
=> if you hoover the mouse cursor over a widget the tooltip only 
appears at the border of the widget.

This happened because a frame laid BEHIND the widgets. After put the
widgets IN the frame (or better in a fixed container in the frame)
the tooltips working as expected.

It was very interesting to put the frame above the widgets - no widgets
are shown but the tooltips appearing fine without a targeted search
which gives me the hint that now the events for showing a tooltip are
generated in the areas not at the borders like before.

This brought me to the idea to put the widgets in a fixed container in
a frame <= works perfect. ;-)

Outside, in the top level script (testem.pl) it works fine - you
can hoover inside the widget area around without the tooltip
disppears. But for the usage it would be better the module can
handle it.

This behaviour resulted in the fact that I created gtk main in the
script and not in the class.

For Gtk2::Tooltip I've found an example (in gmusicbrowser) for
set_tooltip_area and how that works ^^

And this implementation I am using now.

But the same behavior as with Tooltips - with the default
set_tooltip_text tooltips only around the widget border

With the query_tooltip signal, too :-(

This issue was fixed with the two changes above ^^

Probably I must use a window tooltip described here:
https://wiki.gnome.org/Attic/GTK2-Perl/Recipes#How_can_I_programmatically_popup_a_tooltip_.3F

This worked but I run in the issue that I can't get from all widgets
the real size information. Ok, now I know it but I'm using Gtk2::Tooltip
and this solution is outdated now :-P

I will make some other tests if this issue with the tooltips
showing only around the border depending on the fixed container
I put the widget in.

With a modified fixed example from the old Gtk1 tutorial I was able to 
confirm that Gtk2::Tooltip works fine in a fixed container.

So, story finished. ^^

Best,
Thomas

--
"Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe."   --   
Albert Einstein


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