Custom Compound Widget and child ressources

Hi

I work on QNX 6.3 SP1.

I want to create a custom Widget that inherited from PtCompound Widget (I’ve
got the same problem with PtContainer).

I want to allow to add and control child Widget on this Compound Widget.

So, I set Pt_SET_CHILD_XXXXXX_F ressources.

With Pt_SET_CHILD_REDIRECT_F, the function is called twice in Phab but only
one time in execution.
Other functions (Pt_SET_CHILD_CREATED_F, Pt_SET_CHILD_REALIZED_F) are never
called.


Code sample of Widget Create code function :
PtWidgetClass_t *CreatePaneCmdClass( void ){

// set up our class member values
static PtArg_t args[] = {{ Pt_SET_DESCRIPTION, (long)“PaneCmd”},
{ Pt_SET_VERSION, 110},
{ Pt_SET_STATE_LEN, sizeof( PaneCmd_t )},
{ Pt_SET_DFLTS_F, (long)PaneCmd_dflts},

{ Pt_SET_CHILD_REDIRECT_F, (long)PaneCmd_redirect },
{ Pt_SET_CHILD_CREATED_F, (long)PaneCmd_child_created }, // Never
call
{ Pt_SET_CHILD_REALIZED_F, (long)PaneCmd_child_realized }, // Never
call

};

// create the widget class
PaneCmd->wclass = PtCreateWidgetClass(PtCompound, 0,
sizeof( args )/sizeof( args[0] ), args ) ;
return(PaneCmd->wclass);
}

Anyone who can help me with this problem?

Thanks
KUBIT Stéphane

PAYRE serge wrote:

With Pt_SET_CHILD_REDIRECT_F, the function is called twice in Phab but only
one time in execution.

That’s because the redirector method is called by PtValidParent(), and
PhAB calls PtValidParent() before creating a widget.

Other functions (Pt_SET_CHILD_CREATED_F, Pt_SET_CHILD_REALIZED_F) are never
called.

They’re only called if Pt_IGNORE_CONSTRAINTS is unset and the
appropriate flag (Pt_CHILD_CREATED, Pt_CHILD_REALIZED, etc.) is set.
Are you making sure that those flags have the correct value?

Thanks for your response.
I test it but this solution doen’t work better.

In my widget, Pt_IGNORE_CONSTRAINTS flags is unset (default state).

I test other flags like Pt_CHILD_CREATED.
In the default function, this flag is unset. OK, we can create PROCREATED
child without call child create function. This state is documented.

But after default function, this flag must be set by Pt library.
In QNX 6.2.1, tis flag is set after default function, but not in QNX 6.3SP1.

Why ??? Another difference between QNX 6.2.1 and QNX 6.3 undocumented or a
Bug ???

KUBIT Stéphane

Wojtek Lerch a écrit dans le message …

PAYRE serge wrote:
With Pt_SET_CHILD_REDIRECT_F, the function is called twice in Phab but
only
one time in execution.

Ok, I undestand now

That’s because the redirector method is called by PtValidParent(), and
PhAB calls PtValidParent() before creating a widget.

Other functions (Pt_SET_CHILD_CREATED_F, Pt_SET_CHILD_REALIZED_F) are
never
called.

They’re only called if Pt_IGNORE_CONSTRAINTS is unset and the
appropriate flag (Pt_CHILD_CREATED, Pt_CHILD_REALIZED, etc.) is set.
Are you making sure that those flags have the correct value?

PAYRE serge wrote:

Thanks for your response.
I test it but this solution doen’t work better.

In my widget, Pt_IGNORE_CONSTRAINTS flags is unset (default state).

I test other flags like Pt_CHILD_CREATED.
In the default function, this flag is unset. OK, we can create PROCREATED
child without call child create function. This state is documented.

But after default function, this flag must be set by Pt library.
In QNX 6.2.1, tis flag is set after default function, but not in QNX 6.3SP1.

Are you sure? I just checked the source code to 6.2.1, and the only
places that sets the Pt_CHILD_CREATED flag are in the defaults functions
of several widgets. Actually, no: there’s another one in a PtPanelGroup
function. But it doesn’t seem to differ much from the 6.3 code.

Could you send me a copy of a complete application that I could build
and debug?