Hi,
I am trying to manage, or realize, a simple dialog. I am using PhAB and the
stuff seems to be hidden.
I can “realize” the PtWindow with the use of Menus and using “Dialog Module
type” callbacks. But I can’t seem to manage the window with source code.
What I’m trying to do is bring up a main window. When the user does this,
they have to chose the file menu->New. When they do this, they must select
a particular configuration. Depending on that configuration, a different
dialog will occur.
When they hit the “OK” button on the configuration window, the configuration
window should go away and the particular dialog should REALIZE.
I can get the Configuration window to disappear, but I cannot figure out how
to realize the particular dialog.
I make the configuration window go away by doing getting the parent of the
OK button and then Unrealizing it:
PtWidget_t *parent;
parent = PtWidgetParent(widget);
PtUnrealizeWidget(parent);
But then I need to do the following switch:
switch (currentScenario.weaponIndex)
{
case AGM_65:
/* MANAGE AGM_65 dialog */
break;
case AGM_130:
/* MANAGE AGM_130 dialog */
break;
case AIM_120:
break;
default:
printf(“UNKNOWN WEAPON!\n”);
}
I have tried to get the parent of widgets on the AGM_65 window
(ABW_AGM65WeaponPowerToggleButton is a widget on the AGM65 dialog)
parent = PtWidgetParent(ABW_AGM65WeaponPowerToggleButton);
but when I “Unrealize” this parent, it returns a -1.
I have tried to get the parent type of this toggle button.
parent = PtGetParent(ABW_AGM65WeaponPowerToggleButton, PtWindow);
but this returns a NULL value.
I have also just tried to unrealize the widget that I thought was the
window. The instance name I gave the AGM65 window is:
AGM65
So there is a widget created by PhAB called ABW_AGM65, but that doesn’t work
either. It returns a -1.
So…I don’t know what to do. I’m almost ready to send a phake event to the
menu button. But…that seems extreme. In my experience, this should be
easy. Can someone please tell me what little piece I am missing?
Thansk so much…