We have developed a cross-platform application on Linux and Windows.
To display status notifications, the application pops-up a tooltip with some information text.
If the user clicks on the tooltip, a window is opened that allows him to handle the event.
The tooltip has been implemented using a wxMiniFrame, with style :
wxSTAY_ON_TOP | wxFRAME_TOOL_WINDOW | wxFRAME_NO_TASKBAR
This works fine, the only problem is that under Windows, the tooltip steals the focus from the current application while it is displayed. And we would *really* like not to interfere at all with the user's current task until he decides to take an action.
How can we implement a tooltip (draw on the screen, and catch mouse clicks), without creating a window, so that the focus is left untouched?
I thank you in advance and I wish you a good day!
Thierry
We have developed a cross-platform application on Linux and Windows.
To display status notifications, the application pops-up a tooltip with some information text.
If the user clicks on the tooltip, a window is opened that allows him to handle the event.
The tooltip has been implemented using a wxMiniFrame, with style :
wxSTAY_ON_TOP | wxFRAME_TOOL_WINDOW | wxFRAME_NO_TASKBAR
This works fine, the only problem is that under Windows, the tooltip steals the focus from the current application while it is displayed. And we would *really* like not to interfere at all with the user's current task until he decides to take an action.
How can we implement a tooltip (draw on the screen, and catch mouse clicks), without creating a window, so that the focus is left untouched?
You could always set the focus back after you show the window. Something like this:
Thanks for your answer. I tried it, but it seems not to be applicable in my situation.
The focus that I'm trying not to bother is the one of *another* application.
Say Word for example. The user is typing a text. When the wxWindow tooltip
(wxMiniFrame) appears, it steals the focus from Word - thus the user input is
interrupted.
In that case, wxWindow_FindFocus returns None, because this is another
application which has the focus.
What I would like to achieve is to display a tooltip *without* ever taking the focus.
However I still have to be able to get mouse clicks on it.
Do you see any other alternative?
I thank you in advance, and I wish you a good day!
Thierry
Robin Dunn wrote:
···
Thierry Thévoz wrote:
Hello !
We have developed a cross-platform application on Linux and Windows.
To display status notifications, the application pops-up a tooltip with some information text.
If the user clicks on the tooltip, a window is opened that allows him to handle the event.
The tooltip has been implemented using a wxMiniFrame, with style :
wxSTAY_ON_TOP | wxFRAME_TOOL_WINDOW | wxFRAME_NO_TASKBAR
This works fine, the only problem is that under Windows, the tooltip steals the focus from the current application while it is displayed. And we would *really* like not to interfere at all with the user's current task until he decides to take an action.
How can we implement a tooltip (draw on the screen, and catch mouse clicks), without creating a window, so that the focus is left untouched?
You could always set the focus back after you show the window. Something like this:
Thanks for your answer. I tried it, but it seems not to be applicable in my situation.
The focus that I'm trying not to bother is the one of *another* application.
Say Word for example. The user is typing a text. When the wxWindow tooltip
(wxMiniFrame) appears, it steals the focus from Word - thus the user input is
interrupted.
In that case, wxWindow_FindFocus returns None, because this is another
application which has the focus.
What I would like to achieve is to display a tooltip *without* ever taking the focus.
However I still have to be able to get mouse clicks on it.
Okay, try this. When you Show the frame call it's Lower method. Then which ever window was at the top of the stack should become the top again and I think focus will go to it. (maybe...)
Another possibility is to show the window to begin with before they ever start their other app, but position it so it is off screen. Then when you want it to "popup" just move it to a position that is visible on screen...
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
I've positionned the window off screen, and now it works perfectly!
Many thanks for the idea!
Thierry
Robin Dunn wrote:
Thierry Thévoz wrote:
Hello,
Thanks for your answer. I tried it, but it seems not to be applicable in my situation.
The focus that I'm trying not to bother is the one of *another* application.
Say Word for example. The user is typing a text. When the wxWindow tooltip
(wxMiniFrame) appears, it steals the focus from Word - thus the user input is
interrupted.
In that case, wxWindow_FindFocus returns None, because this is another
application which has the focus.
What I would like to achieve is to display a tooltip *without* ever taking the focus.
However I still have to be able to get mouse clicks on it.
Okay, try this. When you Show the frame call it's Lower method. Then which ever window was at the top of the stack should become the top again and I think focus will go to it. (maybe...)
Unfortunately not...
Another possibility is to show the window to begin with before they ever start their other app, but position it so it is off screen. Then when you want it to "popup" just move it to a position that is visible on screen...