Opening PhAb dialogs in code

Hi,
This must seem really obvious, but how can I open a dialog/window which
I created in PhAB, in code? I know I can make a dialog callback in PhAb,
and this will open the dialog, but I need to be able to open the dialog
using code. I printf ABW_MyDialog but it’s NULL, my ABW_base prints a
normal pointer, so I guess I need to make an instance of ABW_MyDialog?

Thanks

Garry

Brenda Merpaw wrote:

Hi Garry,

Since you have ABW_MyDialog name I am assuming you have created the dialog
from PhAB and not within code. You need to create an Internal link for the
dialog ( I am assuming your using 6.2.1 since you don’t mention which
version your working with). You can create the Internal Link from the PhAB
menu - Application->Internal Link

After you create the internal link you can then use the following to create
an instance of the dialog
PtWidget_t *wp;

wp = ApCreateModule(ABM_MyDialog, NULL, NULL);

Hope this helps.
Regards
Brenda

Thanks Brenda, worked first time!

Garry

Hi Garry,

Since you have ABW_MyDialog name I am assuming you have created the dialog
from PhAB and not within code. You need to create an Internal link for the
dialog ( I am assuming your using 6.2.1 since you don’t mention which
version your working with). You can create the Internal Link from the PhAB
menu - Application->Internal Link

After you create the internal link you can then use the following to create
an instance of the dialog
PtWidget_t *wp;

wp = ApCreateModule(ABM_MyDialog, NULL, NULL);

Hope this helps.
Regards
Brenda

“Garry” <asdf34sdg@sdfasdf3.com> wrote in message
news:ccf4el$7m7$1@inn.qnx.com

Hi,
This must seem really obvious, but how can I open a dialog/window which
I created in PhAB, in code? I know I can make a dialog callback in PhAb,
and this will open the dialog, but I need to be able to open the dialog
using code. I printf ABW_MyDialog but it’s NULL, my ABW_base prints a
normal pointer, so I guess I need to make an instance of ABW_MyDialog?

Thanks

Garry

Follow-up question;

How can I detect IF a dialog is currently realized in code?

Bill Caroselli wrote:

How can I detect IF a dialog is currently realized in code?

Check its ABW variable – the library sets it to NULL when the dialog is
destroyed. (If you really mean the dialog exists but is unrealized,
you’ll have to check its Pt_REALIZED flag.)

Note that this only works with dialog modules (as opposed to window
modules or menu modules) and only with the dialog’s window (i.e.
ABW_the_dialog rather than ABW_some_button_in_the_dialog),

PtWidgetIsRealized() ?

Barry

Bill Caroselli wrote:

Follow-up question;

How can I detect IF a dialog is currently realized in code?

I was wondering about this same thing.

Could someone post a line of code that would allow you to check if a
dialog’s Pt_REALIZED flag is set?

dydx wrote:

I was wondering about this same thing.

Could someone post a line of code that would allow you to check if a
dialog’s Pt_REALIZED flag is set?

you could use

int PtWidgetIsRealized ( PtWidget_t *widget );