From: Alastair D. <ala...@si...> - 2005-11-29 17:57:43
|
Completely by coincidence, I was looking at the file tkMacOSXMouseEvent.c today and it appears to me, on the basis of the comments therein, that the "activate click" is deliberately not reported to scripts. I'd love to say something more helpful, but I've no idea what. :-( Kind regards, Alastair Bryan Oakley wrote: > If I have a window that is not active and I click on it, is there any > way I can get a binding to fire for that first click? > > A concrete example: create a file named "foo.tcl" with this as it's > only contents: > > bind . <1> {puts click} > > Run it from the command line like "wish foo.tcl". If you click on the > window a few times it should print "click" to stdout, obviously. > > Make any other app active, such as the window where you just launched > wish, then click on the empty toplevel that was created. Nothing will > be printed but it will become active. At least, nothing on my wish > 8.5a4 / osx 10.4.3 system will be printed. > > What I want is to capture the event that caused the window to become > active. I don't just want to capture that the window became active, > but the event that caused it. For example, if the user clicks left I > want to do one thing, if they click right something else, and if they > make it active by clicking the icon on the doc I want to do nothing at > all. > > Is this possible? In general it must be so, because I see this > behavior in non-tk apps on the mac. For instance, as I type this in > thunderbird I can click right over a firefox window and it will become > active and post the right-click menu. I want to be able to do that > with a tk window. |