Gtk2::Expander "expanded" property


I'm experiencing a strange behavior from Gtk2::Expander's
?expanded? property.
If I connect to the ?activate? signal, I expect to get TRUE
when it is expanded, and FALSE when it is closed, but I get
the exact opposite.

Am I missing something?

I'm running mdv 2006

#! /usr/bin/perl -w

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

#standard window creation, placement, and signal connecting
my $window = Gtk2::Window->new('toplevel');
$window->signal_connect('delete_event' => sub {
Gtk2->main_quit; });

#this vbox will return the bulk of the gui
my $vbox = &ret_vbox();

#add and show the vbox

#our main event-loop

sub ret_vbox {

my $vbox = Gtk2::VBox->new(FALSE,5);

        my $expander = Gtk2::Expander->new_with_mnemonic('E_xpand
        print "Expanded: ".$expander->get('expanded')."\n";
        $expander->add(Gtk2::Label->new("THIS IS SHOWN AND
        $expander->signal_connect('activate' => sub {
                if($expander->get_expanded) {
                print("The expander is expanded\n");
                print("The expander is closed\n");
return $vbox;


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