Cross-platform option to bring Window to front?

For my old projects, I used the CarbonLib function “SelectWindow()” to bring the current window to the top of the display. I’m working to de-carbonize a number of projects and I haven’t been able to locate a Cocoa replacement for this.

Also,is the a cross-platform way to do this that anyone has put together?

Within the app, window.show does the trick.

If you want your app to become front over other apps, Axel Schneider posted a cocoa way in
https://forum.xojo.com/14202-drag-border-vs-focusring-visual-cues-and-drop-file-selected/0

Windows requires SetWindowPos :
https://forum.xojo.com/4603-make-a-window-topmost/0

No idea for Linux.

Tim - An additional link for bringing an app to the front in OS X:

https://forum.xojo.com/3929-solved-set-app-to-frontmost-app-for-app-in-mas

I am such a forgetful dolt sometimes. Christian has a great solution in the MBS kit.

Window.WinTopMostWindowMBS = True

Is that what you want?
This property is for Windows and makes window a top layer window like a global floating palette.

RemoteControlMBS.WinBringWindowToTop

This will bring a regular window to front on Windows.

No - just want the current window to go to the top globally.

So I didn’t pick the right one, huh?

Well, for Windows you have the right one.

I am using MBS plugins for a while now, but was not aware of this one. Nice.
But, be careful using it: for example when you use it for a splash-login-screen, and want to present a messagbox to tell the user that is password was incorrect, you have to take care of this otherwise the messagebox will be behind your window.

[quote=230732:@Joost Rongen]I am using MBS plugins for a while now, but was not aware of this one. Nice.
But, be careful using it: for example when you use it for a splash-login-screen, and want to present a messagbox to tell the user that is password was incorrect, you have to take care of this otherwise the messagebox will be behind your window.[/quote]

i probably add an additional label in red to show the error message rather than showing a message box in the splash-login-screen. this label is only shown when you have a error.

yes, it’s nicer than a messagbox.