From: Hidetoshi NAGAI Date: 2004-08-23T14:16:11+09:00 Subject: Re: Fake Tk events Hi, From: "Phlip" Subject: Re: Fake Tk events Date: Sun, 22 Aug 2004 05:15:47 +0900 Message-ID: > > Please try to add one line to your script such as the following. > > > > > def click(what, how = 'Button-1') > > > x1,y1,x2,y2 = what.bbox > > > cx = (x2 + x1) / 2 > > > cy = (y2 - y1) / 2 > > > Tk.update() > > > what.event_generate('Motion', :x => cx, :y => cy) > > > what.event_generate(how, :x => cx, :y => cy) > > > end > Noop. It no worky. Don't sweat this - nobody pushes libraries where I push > them. Thanks again for the help. Even if you change 'Motion' to 'Enter', do you get the same result? How about adding what.event_generate('Enter', :x => cx, :y => cy) before the 'Motion' line? It seems that the problem exists on Tcl/Tk side (on the opration of canvas widget), because wish has the same problem. The canvas widget accepts all of the generated event ( You can test it by setting a binding for the canvas. And it shows that the 'event_generate' works properly.), but sometimes fails to call the binding of the canvas item. I'm sorry but I couldn't find the conditions to succeed or not. I'm sorry I cannot help you. -- Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)