From: Max Williams <toastkid.williams / gmail.com> Subject: tk question - how do i bind to multiple events? Date: Thu, 18 Oct 2007 21:15:10 +0900 Message-ID: <501dadb1bff32cadf7cdadca70dc0c9b / ruby-forum.com> > name_field.bind("Key-Return") { name_field_value = name_var.value } > name_field.bind("FocusOut") { name_field_value = name_var.value } > > It seems like there should be a way to combine these, like > > name_field.bind("Key-Return" || "FocusOut") #doesn't work > name_field.bind("Key-Return", "FocusOut") #doesn't work either > > But these doesn't work. Can anyone tell me how to do this please? Please use TkVirtualEvent object. ------------------------------------------------------------------------- virt_ev = TkVirtualEvent.new("Key-Return", "FocusOut") # or use TkVirtualEvent#add(seq, ...) / TkVirtualEvent#delete(seq, ...) name_field.bind(virt_ev) { name_field_value = name_var.value } ------------------------------------------------------------------------- -- Hidetoshi NAGAI (nagai / ai.kyutech.ac.jp)