From: Phlip Date: 2004-08-18T00:10:58+09:00 Subject: Re: Fake Tk events Mike Hall wrote: > Two Tcl-ish thoughts come to mind: > - some Tk widgets have an 'invoke' method (not text, I guess) Neither TkCanvas nor TkcText have them. > - use the 'event' command to create your own virtual events > that can trigger the binding They only work if the window displays. I think. If I relent and let the window display, a little bit, I get this: require 'tk' top = TkRoot.new() canvas = TkCanvas.new(top) {width(400);height(300) } canvas.grid() tx = TkcText.new(canvas, 100, 200) { text 'hello world' } tx.bind('Button-1') { |e| puts 'event generated' p e.x p e.y } tx.after_idle { puts 'generating event' tx.event_generate('Button-1') } Tk.mainloop() Its major problem is it does not work. The event_generate does not trigger an event. So, what's the most accurate way to trigger a bound callback? -- Phlip http://industrialxp.org/community/bin/view/Main/TestFirstUserInterfaces