ComboBox and Tooltips



Having successfully compiled Gtk2 1.144 against gtk+ 2.10.11 in a
sandbox, I have just switched all my OptionMenus to ComboBoxes.
However, the Tooltips don't seem to work. Here is a little demo - the
button tooltip works fine, but the combobox not.

What haven't I understood correctly?

Jeff

#! /usr/bin/perl

use strict;
use warnings;

use Glib qw/TRUE FALSE/;
use Gtk2 '-init';

my $window = Gtk2::Window->new('toplevel');
$window->signal_connect('delete_event' => sub { Gtk2->main_quit; });

my $hbox = Gtk2::HBox -> new;
$window -> add ( $hbox );

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

my $button = Gtk2::Button -> new('Button');
$hbox -> pack_start ($button, FALSE, FALSE, 0);
$tooltips -> set_tip ($button, 'Button');

my $cb = Gtk2::ComboBox->new_text;
$cb->append_text ('Combo Box');
$cb->set_active(0);
$hbox -> pack_end ($cb, FALSE, FALSE, 0);
$tooltips -> set_tip ($cb, 'Combo Box');

$window->show_all;

Gtk2->main();



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