If it had only been that easy 
That's not the problem. The problem is that you have no control over the menu when it's displayed. It just returns when the user chooses something.
I've looked at the way it works natively on Win32 and haven't found a way to do it there either.
Alvin Morris wrote:
路路路
I'm not all to experienced with wxpython but I would think that it would be possible. maybe using a timer with an if statement?
just a thought.
On Jun 11, 2006, at 1:44 AM, Eli Golovinsky wrote:
I would like to hide a popup menu several seconds after it has been displayed if a user hasn't made a selection.
Is this at all possible?
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org
Hello Eli,
If it had only been that easy 
Well, I was expecting it to work. If you set up a timer (a one-shot
timer) and when the timer expires, you just call:
menu.Destroy()
Doesn't it do the job? I guess the answer is "yes" 
But I may miss something here...
Andrea.
"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.virgilio.it/infinity77/
路路路
On 6/11/06, Eli Golovinsky <gooli@tuzig.com> wrote:
I was missing something...
So there is no way to Destroy() the menu without user's intervention?
Mhm, it seems a bit strange to me... does Hide() work or will it
trigger the same problems as Destroy()? Well, hiding a menu is not
very useful if you can not actually Destroy() it...
Andrea.
"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.virgilio.it/infinity77/
路路路
On 6/11/06, Robin Dunn <robin@alldunn.com> wrote:
Andrea Gavana wrote:
> Hello Eli,
>
> On 6/11/06, Eli Golovinsky <gooli@tuzig.com> wrote:
>> If it had only been that easy 
>
> Well, I was expecting it to work. If you set up a timer (a one-shot
> timer) and when the timer expires, you just call:
>
> menu.Destroy()
>
> Doesn't it do the job? I guess the answer is "yes" 
> But I may miss something here...
No, destroying the menu while the system is running the menu's private
event loop will just cause things to go haywire, and probably a crash.
wxWidgets just calls a platform API to show the menu and doesn't get
control again until the API returns.
Isn't there a way to make it work? At this point I'm willing to work even with something that will work only for MSW.
I wouldn't want to write a full blown custom menu just for that small effect..
Robin Dunn wrote:
路路路
Andrea Gavana wrote:
Hello Eli,
On 6/11/06, Eli Golovinsky <gooli@tuzig.com> wrote:
If it had only been that easy 
Well, I was expecting it to work. If you set up a timer (a one-shot
timer) and when the timer expires, you just call:
menu.Destroy()
Doesn't it do the job? I guess the answer is "yes" 
But I may miss something here...
No, destroying the menu while the system is running the menu's private event loop will just cause things to go haywire, and probably a crash. wxWidgets just calls a platform API to show the menu and doesn't get control again until the API returns.
I was afraid you might
say that. That is what I learned from looking at the wxMSW code and on
MSDN.
Thanks anyway.
Robin Dunn wrote:
路路路
Eli
Golovinsky wrote:
Isn't there a way to make it work? At this
point I鈥檓 willing to work even with something that will work only for
MSW.
I鈥檇 love to be proved wrong on this but I don鈥檛 see any way to do it.
wxMSW uses the TrackPopupMenu API, maybe I鈥檓 missing something but I
don鈥檛 see anything to allow programatically closing an open menu.