[wxruby-users] lose focus event?

David Morton
Sun, 20 Jan 2008 00:13:23 -0000

> I see that event firing, but it appears global, firing for everything
> that loses focus.  I''ve tried to identify what object was
responsible
> via #get_event_object, #get_id, and  #id, but no luck so far.  How do
> I associate it with the combo box?


I found and example in
HTTP://wxruby.rubyforge.org/svn/trunk/wxruby2/samples/controls/

but it doesn''t work.  Did you mean MS Windows when you said it was
related to windows, or WX windows?

class MyComboBox < ComboBox
   def initialize(*args)
     super(*args)#, style)

     evt_set_focus {|event| onFocusGot(event)}
   end


   def onFocusGot(event)
	log_message("MyComboBox::OnFocusGot")
     event.skip()
   end

end



David Morton
Maia Mailguard http://www.maiamailguard.com
mortonda at dgrmm.net



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)

iD8DBQFHkpIjUy30ODPkzl0RAj9MAKCRdrzr370rQyJ3TIkAzhe+WhLl8wCeK355
Xc40BF9/81vJO1zZ6m1NXFU=OGub