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



Hi again,

On 03/02/2014 05:07 PM, Thomas Funk wrote:
Hi there!

I'm developing a module to simplify Gtk2 widgets for rapid GUI 
development in my project (Fvwm-Nightshade).

I do it with the Gtk2::Fixed container because of the xy positioning 
possibility. A widget call looks like this:
#$win->add_button(   Name => 'closeButton', 
#                    Position => [310, 350], 
#                    Size => [80, 40], 
#                    Title => 'Close', 
#                    Tooltip => 'Blafasel');

Now to my problem. Some of the widgets have a tooltip function but not 
all. For those I use Gtk2::tooltips but run into the problem, that the
tooltip won't show or only at the borders of a widget.

This happens on widget with a tooltip function, too (e.g. Gtk2::Button) ...

I've created the tooltip object outside of the class and that works:

#!/usr/bin/perl -w

use SimpleGtk2;
use Gtk2 -init;

my $tooltips = Gtk2::Tooltips->new();
$tooltips->enable;

# Toplevel window
my $win = SimpleGtk2->new_window(Type => 'toplevel', Name => 'mainWindow', Title => 'testem-all', Width => 
400, Height => 400);

$win->add_spin_button(Name => 'spin1', Position => [10, 60], Start => 5, Min => 0, Max => 10, Step => 1, 
Align => 'right');
$tooltips->set_tip($win->get_widget('spin1'), 'Testem All');

$win->show_all();
Gtk2->main;

As I commit the tooltip object to the window object it doesn't work:
my $win = SimpleGtk2->new_window(Type => 'toplevel', Name => 'mainWindow', Title => 'testem-all', Width => 
400, Height => 400, Tooltips => $tooltips);

How can I move the tooltip object into the package?

I have attached the package and the script. Would be great if anybody can help.

Best,
Thomas

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

Attachment: testem.pl
Description: Perl program

Attachment: SimpleGtk2.pm
Description: Perl program



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