Re: tooltip for gtkdrawingarea



Riswick, J.G.A. van wrote:

HI

I tried to bind a tooltip to a gtkdrawingarea, like so:

$win = new Gtk::Window;
$win->set_usize(300,200);
$win->show_all;

$but = new Gtk::DrawingArea;
$but->show;
$win->add($but);


$but->add_events ( 'enter-notify-mask' );
$but->add_events ( 'leave-notify-mask' );

my $tooltip = new Gtk::Tooltips();
$tooltip->set_tip
  ( $but, "test", "test" );
$tooltip->enable;
$tooltip->set_delay(0);

(and of course, Gtk->main; )


now it works.



basically, the Gtk::DrawingArea starts off with a very minimal set of events, so you need to add the ones you want. i guessed at 'enter-notify', and the tooltip won't go away unless you also have 'leave-notify'.



-- ttocs




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