Hide/Restore Window

Hi

In the realise callback for my base window I realise a number of other
windows, standard Phab stuff. I do not want these windows to be visible
initially so their window state is set to Ph_WM_STATE_ISHIDDEN. That works
ok.

The challenge is how to subsequently show the window, assume its called
RequiredWindow. PtWindowToFront(ABW_RequiredWindow) does not do it.
I have tried PtForwardWindowEvent() but my possibly incorrect efforts have
been in vain. Needless to say I have set all managed and notify flags for
“RequiredWindow”. I can solve the problem by realising the window then
sending it to the back but it flashes on the screen for an instance so its
not the best approach.

My effort (i do not fully understand what I am doing here !!) with
PtFowardWindowEvent is

PhWindowEvent_t event;
memset(&event, 0, sizeof(event));
event.event_f - Ph_WM_RESTORE;
event.event_state = Ph_WM_EVSTATE_PERFORM; // dont know about
this line ?
event.red = PtWidgetRid(ABW_RequiredWindow); // ? compiles
PtForwardWindowEvent( &event);

I have tried following this with WindowToFront but no luck. Any help would
be appreciated.

TIA
Steve

Stephen F Terrell wrote:

Hi

In the realise callback for my base window I realise a number of other
windows, standard Phab stuff. I do not want these windows to be visible
initially so their window state is set to Ph_WM_STATE_ISHIDDEN. That works
ok.

I think you should reset this state when you want to have the window
visible.

Another way I learned about recently is to use the Pt_DELAY_REALIZE
flag. This is unfortunately not accessible via PhAB, but since you are
realizing the windows yourself this is not a problem.

The challenge is how to subsequently show the window, assume its called
RequiredWindow. PtWindowToFront(ABW_RequiredWindow) does not do it.
I have tried PtForwardWindowEvent() but my possibly incorrect efforts have
been in vain. Needless to say I have set all managed and notify flags for
“RequiredWindow”. I can solve the problem by realising the window then
sending it to the back but it flashes on the screen for an instance so its
not the best approach.