On 3/26/07, Dimitar Kenanov <[EMAIL PROTECTED]> wrote:
> i have a question about Gtk2::Expander.
> ...
> I do not know what is happening. What am i doin wrong? Is it really

Short answer: global variables used all over the place.
Slightly longer answer:

sub expand_create_data_form{
($expand_crd,$mess)[EMAIL PROTECTED];
        if($expand_crd->get_expanded){
                $expand_crd->set_label('Hide Create data');
                $dframe=(&create_data_form);       <===== global
                $dframe->show;
                $expand_crd->add($dframe);
                print "Added $mess\n";
                return $expand_crd;
        }else{
                $expand_crd->set_label('Show Create Data');
                $expand_crd->remove($dframe);
                print "Removed $mess\n";
                return $expand_crd;
        }
}

the global $dframe gets assigned the last data_form you created,
e.g. when you expand on tab #1. But then you try to remove the same $dframe
when un-expanding on tab #0 afterward, but it isn't a child of
$expand_crd there.
You somehow have to remember the "correct" $dframe per tab.

Cheers, Roderich
_______________________________________________
gtk-perl-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/gtk-perl-list

Reply via email to