Toolbar tooltip setter and getter question



Hi all,

While working through the GTK2-Perl Tutorial [ALPHA],  I was trying to
get the toolbar example to work and came across some confusing
behaviour in the toolbar. The toolbar tooltips don't seem to turn off.
Or at least the  The Gtk2::Toolbar->set_tooltips don't seem be able to
turn it off. This behaviour exists in both my own translation into
Gtk2-perl and the original C version of the script.

Any idea if this is a misunderstanding on my part on how this feature
is supposed to work, a known bug,  or something that has been fixed
somewhere else?

Here is a cut down version of what I've been testing on.

#!/usr/bin/perl
# toolbar_tooltip.pl
use strict;
use warnings;
use 5.010;
use Gtk2 '-init';
use Glib ':constants';

my $dialog_window = Gtk2::Dialog->new();
$dialog_window->set_title( "Tooltip test" );
$dialog_window->signal_connect( destroy => sub { Gtk2->main_quit(); } ) ;
$dialog_window->set_size_request( 300 , 300 ) ;

my $toolbar = Gtk2::Toolbar->new();
say "Toolbar id is ", $toolbar;
$dialog_window->vbox->add( $toolbar );

my $tooltips_button = $toolbar->append_element( 'togglebutton',
                                                undef,
                                                "ToolTip Toggle",
                                                "Toolbar tool tip toggle",
                                                "Private",
                                                undef,
                                                \&toggle_event,
                                                $toolbar );

$toolbar->show();
$dialog_window->show();
Gtk2->main();

sub toggle_event{
  say "toolbar id check", $toolbar;
  say "tooltips are ",($toolbar->get_tooltips ) ? "on" : "off" ;
  say "booleans are ",( TRUE ) ? "on" : "off" ;
  say "terniary operator is ",( FALSE ) ? "off" : "on" ;
  say "tooltip getter check is ",($toolbar->get_tooltips ) ? "on" : "off";
  say "getter negation check is ",(!$toolbar->get_tooltips ) ? "off" : "on";
  $toolbar->set_tooltips( !$toolbar->get_tooltips );
  say "now tooltips are ",( $toolbar->get_tooltips ) ? "on" : "off" ;
  $toolbar->set_tooltips( FALSE );
  say "and now tooltips are ",($toolbar->get_tooltips ) ? "on" : "off" ;
}


Cheers.
--
"that which does not kill us will give us six  more weeks of winter",
Nietzschean Groundhog Theory



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