wxMac - Bring application to front

View: New views
5 Messages — Rating Filter:   Alert me  

wxMac - Bring application to front

by Bob McCown :: Rate this Message:

| View Threaded | Show Only this Message


Hi
 I have a tray application, that brings up various modeless dialog boxes
from the context menu.  If there are other applications open on the
desktop, and one of them has focus, and I right click, then bring up a
dialog box, the dialog is behind everything.  If I left click on the
tray icon, to bring the application to focus, then right click and bring
up the dialog, the dialog is on top of everything.

  I need a way to bring the app to the front, so the dialogs show.  I've
tried using Raise(), but all that seems to do is bring the dialog to the
top of the stack within the program, not the desktop.

Help!

-=Bob


---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe@...
For additional commands, e-mail: wx-users-help@...


Parent Message unknown RE: wxMac - Bring application to front

by Ryan Norton :: Rate this Message:

| View Threaded | Show Only this Message

Hi Bob - Maybe this is a mac thing - I.E. as far as I know the only  
thing capable of going on top of other apps are system modals and I'm  
not sure if apps have access to those on mac. If it were me I'd do a  
slight rethink of the application design - I.E. bounce the dock icon  
up and down when you have a message (I think mac does this  
automatically when you display a modal dialog, but I'm not sure. If  
it doesn't perhaps something to consider for wxMac)

---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe@...
For additional commands, e-mail: wx-users-help@...


Re: wxMac - Bring application to front

by Andrew Trevorrow :: Rate this Message:

| View Threaded | Show Only this Message

Bob McCown wrote:

>  I need a way to bring the app to the front, so the dialogs show.  I've tried using Raise(), but all that seems to do is bring the dialog to the top of the stack within the program, not the desktop.

Here's some code I use to bring our app to the front:

   #ifdef __WXMAC__
      ProcessSerialNumber process;
      if ( GetCurrentProcess(&process) == noErr )
         SetFrontProcess(&process);
   #endif
   #ifdef __WXMSW__
      SetForegroundWindow( (HWND)mainptr->GetHandle() );
   #endif

Maybe there is a high-level wx call like wxBringAppToFront, but I haven't
been able to find it.

Andrew

---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe@...
For additional commands, e-mail: wx-users-help@...


Re[2]: wxMac - Bring application to front

by Vadim Zeitlin-3 :: Rate this Message:

| View Threaded | Show Only this Message

On Tue, 11 Apr 2006 18:03:06 +1000 Andrew Trevorrow <andrew@...> wrote:

AT> Bob McCown wrote:
AT>
AT> >  I need a way to bring the app to the front, so the dialogs show.  I've tried using Raise(), but all that seems to do is bring the dialog to the top of the stack within the program, not the desktop.
AT>
AT> Here's some code I use to bring our app to the front:
AT>
AT>    #ifdef __WXMAC__
AT>       ProcessSerialNumber process;
AT>       if ( GetCurrentProcess(&process) == noErr )
AT>          SetFrontProcess(&process);
AT>    #endif
AT>    #ifdef __WXMSW__
AT>       SetForegroundWindow( (HWND)mainptr->GetHandle() );
AT>    #endif
AT>
AT> Maybe there is a high-level wx call like wxBringAppToFront, but I haven't
AT> been able to find it.

 I certainly can see that a wxApp::BringToFront() could be useful. And it
could just be implemented as GetTopWindow()->Raise() by default, too. If
anyone feels like making a patch implementing it, it would be great.

 Regards,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
               http://www.tt-solutions.com/


---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe@...
For additional commands, e-mail: wx-users-help@...


Re: wxMac - Bring application to front

by Bob McCown :: Rate this Message:

| View Threaded | Show Only this Message


Thanks Andrew, works like a charm.

-=Bob


Andrew Trevorrow wrote:

>Bob McCown wrote:
>
>  
>
>> I need a way to bring the app to the front, so the dialogs show.  I've tried using Raise(), but all that seems to do is bring the dialog to the top of the stack within the program, not the desktop.
>>    
>>
>
>Here's some code I use to bring our app to the front:
>
>   #ifdef __WXMAC__
>      ProcessSerialNumber process;
>      if ( GetCurrentProcess(&process) == noErr )
>         SetFrontProcess(&process);
>   #endif
>   #ifdef __WXMSW__
>      SetForegroundWindow( (HWND)mainptr->GetHandle() );
>   #endif
>
>Maybe there is a high-level wx call like wxBringAppToFront, but I haven't
>been able to find it.
>
>Andrew
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: wx-users-unsubscribe@...
>For additional commands, e-mail: wx-users-help@...
>
>
>
>  
>



---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe@...
For additional commands, e-mail: wx-users-help@...