For Programmers: Free Programming Magazines  


Home > Archive > Tcl > June 2005 > winico and [tk_popup]









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author winico and [tk_popup]
Googie

2005-06-09, 8:58 pm

Hi there!

I've got problem with [menu] while posting it on winico event.
I dock my application in systray and the handle right-click on its tray
icon to popup tray menu.

Everything works, but menu doesn't disappear when I click anywhere else
than menu.
It does disappear when I popup menu from any other event/place (like
'bind <Button-1>' event on some Tk widget).

I've tried both of [tk_popup] and [.m post] (where .m is [menu] of
course).

Why? How to fix it?

It's Win2000 platform.

--
Pozdrawiam (Greetings)!
Googie
Pat Thoyts

2005-06-10, 4:02 pm

Googie <pawel@veranet.pl> writes:

>Hi there!
>
>I've got problem with [menu] while posting it on winico event.
>I dock my application in systray and the handle right-click on its tray
>icon to popup tray menu.
>
>Everything works, but menu doesn't disappear when I click anywhere else
>than menu.
>It does disappear when I popup menu from any other event/place (like
>'bind <Button-1>' event on some Tk widget).
>
>I've tried both of [tk_popup] and [.m post] (where .m is [menu] of
>course).
>
>Why? How to fix it?
>
>It's Win2000 platform.


I have seen this elsewhere I think. It's not exactly a winico
problem. You can demonstrate the effect on XP as well if you create a
menu and post it using after and quickly click on another app. Once
the menu is posted while you have focus on something other than Tk you
can click all over the place without unposting the popup. As soon as
the focus switches back to Tk it will unpost.

In the case of winico, of course the focus is actually on the windows
taskbar so this shows up immediately.

You might try forcing the focus.

--
Pat Thoyts http://www.patthoyts.tk/
To reply, rot13 the return address or read the X-Address header.
PGP fingerprint 2C 6E 98 07 2C 59 C8 97 10 CE 11 E6 04 E0 B9 DD
Googie

2005-06-10, 4:02 pm

"Pat Thoyts" wrote:
> I have seen this elsewhere I think. It's not exactly a winico
> problem. You can demonstrate the effect on XP as well if you create a
> menu and post it using after and quickly click on another app. Once
> the menu is posted while you have focus on something other than Tk you
> can click all over the place without unposting the popup. As soon as
> the focus switches back to Tk it will unpost.
>
> In the case of winico, of course the focus is actually on the windows
> taskbar so this shows up immediately.


Thanks for explanation. It might be useful while trying to fix it...

> You might try forcing the focus.


Tried befor. No effect. Also [raise] doesn't help, same as both of them
([raise] and [focus -force]) called together.


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com