multiple screens in single window

Hi All,

I’ve recently started workinq with QNX (6.10A) and have been beating my
head against the wall. I’m hoping someone can point me in the right
direction.

I’m trying to write an application which runs several screens ( one at a
time ) in a window. Eventually this will run full screen.

I put a couple of panes in the base window. Then I put some picture
modules in them using ApCreateNModule. This works fine. Some buttons in
one of the picture modules are attached to a dialog. When I press the
button, the dialog comes up. The only problem is that I can’t tell which
button invoked the dialog. If I specify the a button in the original
window it works fine, like
PtSetResource(ABW_screen1_button1,Pt_ARG_FILL_COLOR,Pt_GREEN,0);

Several attempts ago it seemed I was able to find the invoking button by
testing against all known button associated with that dialog. Is there a
better way of getting this information, or a better way of doing what
I’m doing in general?

Thanks for any pointers.

Steve

Steve Morris <morris@buinea.com> wrote:
[…]

Some buttons in
one of the picture modules are attached to a dialog. When I press the
button, the dialog comes up. The only problem is that I can’t tell which
button invoked the dialog. […]

Several attempts ago it seemed I was able to find the invoking button by
testing against all known button associated with that dialog. Is there a
better way of getting this information, or a better way of doing what
I’m doing in general?

Yep! In your dialog’s setup function, there are three
paramaters: link_instance, apinfo and cbinfo. apinfo is a
pointer to an ApInfo_t structure, which includes the member
“widget”, a PtWidget_t. That member is set to point to the
widget that caused the link callback to be invoked.

There should be more on this in the Photon Programmer’s guide.

Hope this helps.


Norbert Black
QSSL Training Services

On Wed, 31 Oct 2001 17:40:56 GMT, Alex Cellarius
<acellarius@systems104-don’t-you-spam-me!.co.za> wrote:

On 31 Oct 2001 15:17:45 GMT, Norbert Black <> nblack@qnx.com> > wrote:

Yep! In your dialog’s setup function, there are three paramaters:
link_instance, apinfo and cbinfo. apinfo is a pointer to an ApInfo_t
structure, which includes the member “widget”, a PtWidget_t. That
member is set to point to the widget that caused the link callback to
be invoked.


And then there is the user data area as well, where you can put in
e.g. a string to identify the guilty widget. Also useful if you
assign the same callback to a number of widgets.


Thanks for the responses. I must be doing somethine else wrong. I’ve

looked at apinfo->widget but that apparently is giving me a pointer to
the dialog. I don’t have my stuff in front of me but I’ve also tried
something like (from memory) ApWidget(cbinfo) which returns 0.

I’ve got this working in a simple case where I put a couple of buttons
in the base window and then attach them to a dialog. In the dialog setup
I’ve ben able to determine which widget invoked the dialog and use it
accordingly.

I’m using the user data field but I can’t get the info until I find out
whih button to get it from.

Have to wait till after work to look at is some more.

Steve

On 31 Oct 2001 15:17:45 GMT, Norbert Black <nblack@qnx.com> wrote:

Steve Morris <> morris@buinea.com> > wrote:
[…]
Some buttons in
one of the picture modules are attached to a dialog. When I press the
button, the dialog comes up. The only problem is that I can’t tell which
button invoked the dialog. […]

Several attempts ago it seemed I was able to find the invoking button by
testing against all known button associated with that dialog. Is there a
better way of getting this information, or a better way of doing what
I’m doing in general?

Yep! In your dialog’s setup function, there are three
paramaters: link_instance, apinfo and cbinfo. apinfo is a
pointer to an ApInfo_t structure, which includes the member
“widget”, a PtWidget_t. That member is set to point to the
widget that caused the link callback to be invoked.

And then there is the user data area as well, where you can put in
e.g. a string to identify the guilty widget.
Also useful if you assign the same callback to a number of widgets.