Floating Window Focus

Hey gang,

When a Floating Window opens, it gets the focus (close, minimize, etc buttons highlighted, etc) and is activated. However, if any other window opens up from the Floating Window, the floating window loses focus (the close, minimize, etc buttons greyed out) and is deactivated. You can click inside the floating window all you want but it never regains the focus (reactivates) until you click in the title bar.

How can you programmatically activate the window?

I don’t think this happens in Windows - only OS X.

You may want to use activateIgnoringOtherApps in the floating window MouseEnter. See https://forum.xojo.com/14202-drag-border-vs-focusring-visual-cues-and-drop-file-selected where Axel Schneider has posted the declare.

No. I think that’s a completely different issue related to dragging and dropping items.

Is there a way to force the activate event of a window to fire?

Right, activeIgnoringOtherApps should activate your window programatically. That is just a different example of its use.

So maybe call that declare in a method. I’ll try it…

No. It does NOT work. I am not a Mac declares expert but this is ignoring other applications.

I am never leaving my application. But when you open a window (be it modal or otherwise) from a floating window, the floating window is never activated again until you hit the title bar. You can click controls in it and use those all day long. But no window events will happen. The active window in my case becomes my main window.

[quote=178499:@Jon Ogden]No. I think that’s a completely different issue related to dragging and dropping items.

Is there a way to force the activate event of a window to fire?[/quote]

That method can be very useful if you ever need to reactivate your app window without clicking it. But you never know if you don’t try :confused:

To reactivate your window within the app, simply put

self.show

in the MouseEnter event of the floating window.

[quote=178505:@Michel Bujardet]That method can be very useful if you ever need to reactivate your app window without clicking it. But you never know if you don’t try :confused:
[/quote]

Well, I’m not sure where it works but it definitely did not do anything when I didn’t leave my app. Maybe if you drag something from another app it works. But I’m staying within mine…

[quote]
To reactivate your window within the app, simply put

self.show

in the MouseEnter event of the floating window.[/quote]

Bingo! That did it! Thank you!

That method is precious to reactivate an app without clicking in the window after switching to another, or going to the finder. Just put it in MouseEnter as well. It does not work for flating windows, since on Mac they become invisible when the app gets in the background. But it does wonder for regular windows.

I’ll try it for other windows…

Now back to my annual ritual of working on taxes… :frowning: