PtGroup without PhAB

Can someone give me an example of how to use the PtGroup widget without
PhAB?
Mostly, I’d like to know how to “add” widgets to a group. Thanks.

-Eddie Sanchez

Previously, Edward Sánchez wrote in qdn.public.qnxrtp.photon:

Can someone give me an example of how to use the PtGroup widget without
PhAB?
Mostly, I’d like to know how to “add” widgets to a group. Thanks.

Honestly, I’ve never done this exactly, however I think you
would first do an ApCreateWidget() for the PtGroup, then do
a PtSetParentWidget() on the PtGroup() and then use
ApCreateWidget() on the widget you want created in
the group.

Mitchell Schoenbrun --------- maschoen@pobox.com

Mitchell Schoenbrun <maschoen@pobox.com> wrote:
: Previously, Edward S?nchez wrote in qdn.public.qnxrtp.photon:
:> Can someone give me an example of how to use the PtGroup widget without
:> PhAB?
:> Mostly, I’d like to know how to “add” widgets to a group. Thanks.

: Honestly, I’ve never done this exactly, however I think you
: would first do an ApCreateWidget() for the PtGroup, then do
: a PtSetParentWidget() on the PtGroup() and then use
: ApCreateWidget() on the widget you want created in
: the group.

Close. Use PtCreateWidget() to create a PtGroup. Because it’s a container,
it becomes the default parent; any widgets that you create afterward become
children of the group if you pass Pt_DEFAULT_PARENT as the parent argument
to PtCreateWidget().

(The Ap* functions are for PhAB applications only.)


Steve Reid stever@qnx.com
TechPubs (Technical Publications)
QNX Software Systems

Steve Reid <stever@qnx.com> wrote:

Close. Use PtCreateWidget() to create a PtGroup. Because it’s a container,
it becomes the default parent; any widgets that you create afterward become
children of the group if you pass Pt_DEFAULT_PARENT as the parent argument
to PtCreateWidget().

… or instead of relying on Pt_DEFAULT_PARENT, just pass the PtGroup’s
widget pointer. This will not only make your code more explicit and
easier to understand – it will also make it safer: if one of the
children of the PtGroup happens to be a container, it will become the
default parent, and Pt_DEFAULT_PARENT will put the next child in the
wrong place…


Wojtek Lerch (wojtek@qnx.com) QNX Software Systems Ltd.