something UnRealized (me?)

Hello (again),

Using PhAB to create a small app to:

  1. select an image file (PtFileSelect works fine)
  2. set a couple of options (toggles and numeric float action OK)
  3. open file, alter image data a little and display (all except the
    last)

For display purposes I created in PhAB a PtLabel of type Pt_IMAGE. I
arbitrarily sized it during PhAB use. Then, in a callback function to
my Display button, I can get initial Pt_ARG_DIM and set it to the size
required by the image at hand. I can also set the Pt_ARG_LABEL_IMAGE
with what I am pretty sure is a well-formed PhImage_t struct.
(Both these “set resources” have been confirmed by
following up with “get resources” to check final status using
the widget name ABW_widget_name).

BUT… PtRealizeWidget( ABW_widget_name) does cause the image
to appear. After cruising through the Photon Programmer’s manual, I
come up with nothing better than what I’ve done. Where else should I
look? What else should I do? What is the meaning of life? (I will
be grateful for 2 answers out of 3 questions.)

Thanks,



Bob Bottemiller
Stein.DSI/Redmond, WA USA

Bob Bottemiller <bob.bottemiller@deletefmcti.com> wrote:

Hello (again),

Using PhAB to create a small app to:

  1. select an image file (PtFileSelect works fine)
  2. set a couple of options (toggles and numeric float action OK)
  3. open file, alter image data a little and display (all except the
    last)

For display purposes I created in PhAB a PtLabel of type Pt_IMAGE. I
arbitrarily sized it during PhAB use. Then, in a callback function to
my Display button, I can get initial Pt_ARG_DIM and set it to the size
required by the image at hand. I can also set the Pt_ARG_LABEL_IMAGE
with what I am pretty sure is a well-formed PhImage_t struct.
(Both these “set resources” have been confirmed by
following up with “get resources” to check final status using
the widget name ABW_widget_name).

BUT… PtRealizeWidget( ABW_widget_name) does cause the image
to appear. […]

Good for you! Oh, wait a minute… You probably meant “doesn’t”… :frowning:

[…] After cruising through the Photon Programmer’s manual, I
come up with nothing better than what I’ve done. Where else should I
look? What else should I do? What is the meaning of life? (I will
be grateful for 2 answers out of 3 questions.)

There are several things I can think of that could be wrong here… I
would start by playing with the label in PhAB:

If you enable the borders or give the label a fill colour, can you
see them at runtime? (My guess is that you will. Unless you’re
doing something special, the label gets realized when its window is
realized, and your PtRealizeWidget() call does nothing.)

If you give the label an image in PhAB, does it get displayed? By
default, a label doesn’t display its image (check out
Pt_ARG_LABEL_TYPE in the docs).

If the above doesn’t help, perhaps you could post the code that sets
Pt_ARG_LABEL_IMAGE here. Maybe there’s something wrong with it
after all…

BTW Instead of setting the label’s size by hand, you could just set
its resize flags in PhAB.

\

Wojtek Lerch QNX Software Systems Ltd.

On 1 Mar 2002 15:25:53 GMT, Wojtek Lerch <wojtek_l@ottawa.com> wrote:

Bob Bottemiller <> bob.bottemiller@deletefmcti.com> > wrote:
Hello (again),

Using PhAB to create a small app to:

  1. select an image file (PtFileSelect works fine)
  2. set a couple of options (toggles and numeric float action OK)
  3. open file, alter image data a little and display (all except the
    last)

For display purposes I created in PhAB a PtLabel of type Pt_IMAGE. I
arbitrarily sized it during PhAB use. Then, in a callback function to
my Display button, I can get initial Pt_ARG_DIM and set it to the size
required by the image at hand. I can also set the Pt_ARG_LABEL_IMAGE
with what I am pretty sure is a well-formed PhImage_t struct.
(Both these “set resources” have been confirmed by
following up with “get resources” to check final status using
the widget name ABW_widget_name).

BUT… PtRealizeWidget( ABW_widget_name) does cause the image
to appear. […]

Good for you! Oh, wait a minute… You probably meant “doesn’t”… > :frowning:

Yes I did. (Argh! And I consider myself a proof reading maniac.)

[snip…]

There are several things I can think of that could be wrong here… I
would start by playing with the label in PhAB:

If you enable the borders or give the label a fill colour, can you
see them at runtime? (My guess is that you will. Unless you’re
doing something special, the label gets realized when its window is
realized, and your PtRealizeWidget() call does nothing.)

If you give the label an image in PhAB, does it get displayed? By
default, a label doesn’t display its image (check out
Pt_ARG_LABEL_TYPE in the docs).
Good idea. Indeed the fill color reveals the initial size of the

widget along with the image (a little bitmap created with the PhAB
tool). When I redefine the widget dimension resource in a callback
function, the PtLabel resizes itself. When I set a new image resource
(my hand-made PhImage_t struct) the initial little bitmap disappears
but the expected image does not appear.
This indicates to me that the trouble lies in my preparation of the
PhImage structure. I have tried to follow all directives revealed in
the Helpviewer. I will have more time to fiddle with this next week.
Thanks a lot for your comments.

If the above doesn’t help, perhaps you could post the code that sets
Pt_ARG_LABEL_IMAGE here. Maybe there’s something wrong with it
after all…

BTW Instead of setting the label’s size by hand, you could just set
its resize flags in PhAB.

\

Wojtek Lerch QNX Software Systems Ltd.

Bob Bottemiller
Stein.DSI/Redmond, WA USA

Hello again…

Instead of filling in the members of PhImage_t in my own function, I
called PhCreateImage() with the appropriate arguments including the
address of my declared PhImage_t structure.
After the return of PhCreateImage(), I set the char *image member to
the address of my target image and, voila, the application executed as
desired.

Thanks again Wojtech,

Bob Bottemiller
Stein.DSI/Redmond, WA USA