[wxruby-users] copy & paste event

Alex Fenton alex at pressure.to
Fri Mar 7 09:26:26 EST 2008


Pat Kiatchaipipat wrote:
> to check where @textbox was selected but when I want to paste it can't 
> use this I try to think but I don't know how can I fix it please help me 
>   
http://wxruby.rubyforge.org/doc/textctrl.html#TextCtrl_paste

As for which TextCtrl to paste into, I have no idea because you haven't 
given us any idea of what your app is meant to do.

If you wanted to track the last-focussed TextCtrl, it might be something 
like (untested):

evt_child_focus do | event |
  if [ @textbox1, @textbox2, @textbox3 ].any?(event.window)
    @focussed_textbox = event.window
  end
end

When posting, it helps a lot if you write clearly what you want to do, 
what you've tried, and what you expected to happen. Don't expect other 
people to guess or do your work for you.

alex


More information about the wxruby-users mailing list