Re: Dont understand ->owner behaviour for TabbedNotebook

From: Andrew Bramble <andrewb_at_omnilab.com.au>
Date: 02 Dec 2003 14:17:07 +1100
To: prima_at_prima.eu.org

I am also seeing a problem attaching ANY object to the tabbed_notebook
at page 0.

EG: in child onSetup {

my $self = $_[0];

my $tabbed = $self->owner->owner;

$tabbed->attach_to_page( 0 , $self );

}

some-other-child onSetup {

 my $self = $_[0];
 my $tabbed = $self->owner->owner;
 $tabbed->attach_to_page( 1 , $self )

}

When executed, the tabbednotebook appears, with tab zero displayed,
selecting any other tab and returning to tab zero - viola the widget has
vanished.

On Tue, 2003-12-02 at 13:01, Andrew Bramble wrote:
> Hello,
>
> a strange thing I discovered using the visual builder and Prima version
> 1.12. If setting a child's owner to be a TabbedNotebook object, when
> calling ->owner from the child I get.
>
> in SomeChild
>
> print ref $self->owner;
> print ref $self->owner->owner;
>
> "Prima::NoteBook"
> "Prima::TabbedNoteBook"
>
>
> I believed the tabbed notebook inherited the various methods and props,
> at the moment I'm trying to encourage widgets to register themselves
> into the notebook.
>
> onCreate {
> my $self= $shift;
> my $notebook = $self->owner;
> my $tabset = $notebook->owner;
>
> $notebook->insert_page;
> $notebook->attach_to_page( 0 , $self );
>
> $tabset->set_tabs( @{ $tabset->tabs } , 'This Pagename' );
>
> }
>
> Feature , bug or has my brain turned to jelly?
>
> Thanks
>
> AB
>
>
Received on Tue 02 Dec 2003 - 04:17:36 CET

This archive was generated by hypermail 2.2.0 : Sat 19 Mar 2011 - 18:35:05 CET