Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - How to Hide the base window in a Photon application: (5 Items)
   
How to Hide the base window in a Photon application  
I am using QNX Momentics IDE version 6.3.2 and PhAB version 2.03. My problem is that on a button click on the base 
window, I need to hide it and display a new window. I am using PhAB for developing my application. I tried using 
PtContainerNullFocus but it didn't work. I also tried to set its resource, Pt_ARG_WINDOW_STATE as "Ph_WM_STATE_IS HIDDEN
" in a callback function attached to the button of base window but even that didn't work. Can someone please help me on 
this?
RE: How to Hide the base window in a Photon application  
Hi,

have you tried...
   PhWindowEvent_t  we;
   memset( &we, 0, sizeof we );
   we.event_f     = Ph_WM_HIDE;
   we.rid         = PtWidgetRid(  ****YOUR_WINDOW_WIDGET_HERE****   );
   we.event_state = Ph_WM_EVSTATE_HIDE;
   PtForwardWindowEvent( &we ); 
?

- Thomas

> -----Original Message-----
> From: chandrashekhar kulkarni [mailto:community-noreply@qnx.com] 
> Sent: 06 February 2009 13:16
> To: general-ide
> Subject: How to Hide the base window in a Photon application
> 
> I am using QNX Momentics IDE version 6.3.2 and PhAB version 
> 2.03. My problem is that on a button click on the base 
> window, I need to hide it and display a new window. I am 
> using PhAB for developing my application. I tried using 
> PtContainerNullFocus but it didn't work. I also tried to set 
> its resource, Pt_ARG_WINDOW_STATE as "Ph_WM_STATE_IS HIDDEN" 
> in a callback function attached to the button of base window 
> but even that didn't work. Can someone please help me on this?
> 
> _______________________________________________
> General
> http://community.qnx.com/sf/go/post21577
> 
> 
Re: How to Hide the base window in a Photon application  
Hi Thomas, 

Thanks for the help. I could hide my base window using the piece of code suggested by you but I am still not able to 
display a new window in the similar way, within the same callback function. I tried it in the following way-

  PhWindowEvent_t  nwe;
  memset( &nwe, 0, sizeof nwe );
   nwe.event_f     = Ph_WM_FOCUS;
   nwe.rid         = PtWidgetRid(ABW_newwin);
   nwe.event_state = Ph_WM_EVSTATE_FOCUS;
   PtForwardWindowEvent( &nwe );

Can you further help me in figuring what is wrong?
RE: How to Hide the base window in a Photon application  
Hi,

the code below will merely give focus to a specific window, i.e., 
make it "active" in that all input will be directed to it.

To answer your question, I'd need to know whether the window you 
want to show instead already exists (then we could just send it an
event), or need to be created first. 

Regards,
- Thomas

> -----Original Message-----
> From: chandrashekhar kulkarni [mailto:community-noreply@qnx.com] 
> Sent: 09 February 2009 08:48
> To: general-ide
> Subject: Re: How to Hide the base window in a Photon application
> 
> Hi Thomas, 
> 
> Thanks for the help. I could hide my base window using the 
> piece of code suggested by you but I am still not able to 
> display a new window in the similar way, within the same 
> callback function. I tried it in the following way-
> 
>   PhWindowEvent_t  nwe;
>   memset( &nwe, 0, sizeof nwe );
>    nwe.event_f     = Ph_WM_FOCUS;
>    nwe.rid         = PtWidgetRid(ABW_newwin);
>    nwe.event_state = Ph_WM_EVSTATE_FOCUS;
>    PtForwardWindowEvent( &nwe );
> 
> Can you further help me in figuring what is wrong?
> 
> _______________________________________________
> General
> http://community.qnx.com/sf/go/post21718
> 
> 
Re: RE: How to Hide the base window in a Photon application  
Hi,

  The window, 'newwin' is already created in PhAB which is linked to my base window within the same callback attached to
 a button on the 'base' window. I just need to display it hiding the later.