Custom widgets

I have designed a some custom widgets that are just slight variations on
PtText, PtComboBox, etc. They seem to work fine, however having now bound
them into PhAB, when I place them on a module I get no visible indication of
where they are going to be ( except when they are selected ) . These
widgets are not containers so I cant set b=container in the widget
description file, is there something else I can set this to so that I can at
least get an out line at design time ?

Also, is ther any way from within PhAB of setting resources at design time
that are simple pointers or pointers to widgets?

Lindsey Joyce <lindsey@grapevinetelecom.co.uk> wrote:

I have designed a some custom widgets that are just slight variations on
PtText, PtComboBox, etc. They seem to work fine, however having now bound
them into PhAB, when I place them on a module I get no visible indication of
where they are going to be ( except when they are selected ) . These
widgets are not containers so I cant set b=container in the widget
description file, is there something else I can set this to so that I can at
least get an out line at design time ?

– I think when you
customize a widget, there’s the ability to provide a “standin”
for use within PhAB – so you can choose whatever canned widget
is a rough match. Somebody who’s had more experience with
customizing widgets may correct me on this, though.

Also, is ther any way from within PhAB of setting resources at design time
that are simple pointers or pointers to widgets?

Pointer resources associated with widgets are just another class
of resource – PtSetArg() PtSetResources() and PtGetResources()
are your friends. :slight_smile: Or are you trying to get at something
different here?

Pointers to widgets – use them the same way you’d use
ABW_ for widgets you’ve created within PhAB.

Hope this helps.


Norbert Black
QSSL Training Services

On Thu, 7 Dec 2000 09:32:36 -0000, Lindsey Joyce <lindsey@grapevinetelecom.co.uk> wrote:

I have designed a some custom widgets that are just slight variations on
PtText, PtComboBox, etc. They seem to work fine, however having now bound
them into PhAB, when I place them on a module I get no visible indication of
where they are going to be ( except when they are selected ) . These
widgets are not containers so I cant set b=container in the widget
description file, is there something else I can set this to so that I can at
least get an out line at design time ?

I use the following kluge as a work-around:

Add a default for Pt_ARG_FILL_COLOR to the “d=” section of the palette file
to set the fill colour to something not likely to be used by the application.

In the widget class initialization function, check if
(PtBasicWidget_t *)widget)->fill_color = this standin colour and if so replace
it with Pg_TRANSPARENT.

Of course, this assumes that you can choose a colour for this purpose which
is never going to be used by the applications using your custom widgets (true
for me, may not be for you).

If anyone has a better solution, I’d like to know it.

Also, is ther any way from within PhAB of setting resources at design time
that are simple pointers or pointers to widgets?

Thanks,
I can set the resources in code but I wanted to know if there was some way
to set up the PhAb resource editors so that i wouldn’t have to do it from
code?

As for the “standin” doesn’t look like anybody knows how to do it so I’ll
try Will Parsons kludge approach.

Lindsey
“Norbert Black” <nblack@qnx.com> wrote in message
news:90odrn$9re$1@nntp.qnx.com

Lindsey Joyce <> lindsey@grapevinetelecom.co.uk> > wrote:
I have designed a some custom widgets that are just slight variations
on
PtText, PtComboBox, etc. They seem to work fine, however having now
bound
them into PhAB, when I place them on a module I get no visible
indication of
where they are going to be ( except when they are selected ) . These
widgets are not containers so I cant set b=container in the widget
description file, is there something else I can set this to so that I
can at
least get an out line at design time ?

reaching into the depths of memory here> – I think when you
customize a widget, there’s the ability to provide a “standin”
for use within PhAB – so you can choose whatever canned widget
is a rough match. Somebody who’s had more experience with
customizing widgets may correct me on this, though.

Also, is ther any way from within PhAB of setting resources at design
time
that are simple pointers or pointers to widgets?

Pointer resources associated with widgets are just another class
of resource – PtSetArg() PtSetResources() and PtGetResources()
are your friends. > :slight_smile: > Or are you trying to get at something
different here?

Pointers to widgets – use them the same way you’d use
ABW_ for widgets you’ve created within PhAB.

Hope this helps.


Norbert Black
QSSL Training Services

Thanks Will,
That does the job, as you say It would be nice to Know if there is a
proper/better solution.

Lindsey

“Will Parsons” <wbp@alfa.eng.sun.com> wrote in message
news:90qv35$fdl$1@inn.qnx.com

On Thu, 7 Dec 2000 09:32:36 -0000, Lindsey Joyce
lindsey@grapevinetelecom.co.uk> > wrote:
I have designed a some custom widgets that are just slight variations on
PtText, PtComboBox, etc. They seem to work fine, however having now bound
them into PhAB, when I place them on a module I get no visible indication
of
where they are going to be ( except when they are selected ) . These
widgets are not containers so I cant set b=container in the widget
description file, is there something else I can set this to so that I can
at
least get an out line at design time ?


I use the following kluge as a work-around:

Add a default for Pt_ARG_FILL_COLOR to the “d=” section of the palette
file
to set the fill colour to something not likely to be used by the
application.

In the widget class initialization function, check if
(PtBasicWidget_t *)widget)->fill_color = this standin colour and if so
replace
it with Pg_TRANSPARENT.

Of course, this assumes that you can choose a colour for this purpose
which
is never going to be used by the applications using your custom widgets
(true
for me, may not be for you).

If anyone has a better solution, I’d like to know it.

Also, is ther any way from within PhAB of setting resources at design
time
that are simple pointers or pointers to widgets?

Norbert Black <nblack@qnx.com> wrote:

Lindsey Joyce <> lindsey@grapevinetelecom.co.uk> > wrote:
I have designed a some custom widgets that are just slight variations on
PtText, PtComboBox, etc. They seem to work fine, however having now bound
them into PhAB, when I place them on a module I get no visible indication of
where they are going to be ( except when they are selected ) . These
widgets are not containers so I cant set b=container in the widget
description file, is there something else I can set this to so that I can at
least get an out line at design time ?

reaching into the depths of memory here> – I think when you
customize a widget, there’s the ability to provide a “standin”
for use within PhAB – so you can choose whatever canned widget
is a rough match. Somebody who’s had more experience with
customizing widgets may correct me on this, though.

In Photon 1.14, the “standin” can only be a PtBasic or a PtPane.

Photon 2 improves this significantly. PhAB can actually create your
custom widget – you just need to put the widget in a shared library and
tell PhAB where it is. Unfortunately, the widget building docs for
Photon 2 are not ready yet…


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