From: Markus Liebelt Date: 2005-06-28T23:05:40+09:00 Subject: Problem in binding IWidget combobox to event Hello all together, I managed lately to include an iwidget combobox in a UI I have written. If normally used (by poking around with the mouse) everything works fine. What I cannot manage if the user is using the keyboard. Can anyone tell me how to bind the key events to the iwidget components especially to the combobox? My example goes like this (sorry for the lengthy boring example): ==================== require 'tk' require 'tkextlib/iwidgets' class Ex_Combo def open root = self.create_root self.build_form(root) Tk.mainloop end def build_form(root) frame = self.create_frame(:form, root) var = TkVariable.new cb1 = Tk::Iwidgets::Combobox.new(frame, #:labeltext=>'Example:', :selectioncommand=>proc{puts cb1.get_curselection; $stdout.flush}, :textvariable=>var, :editable=>false) cb1.insert_list('end', *['First entry','Second entry','Third entry']) cb1.grid('row'=>0, 'column'=>0, 'sticky'=>'news') frame.pack('side'=>'left', 'expand'=>'yes') end def create_frame(name, super_widget, *args) frame = TkFrame.new(super_widget, *args) return frame end def create_root(title='No window title') root = TkRoot.new('title'=>title) return root end end if __FILE__ == $0 Ex_Combo.new.open end ==================== If you open that application, and drop down with the mouse and select with the mouse, you see on $stdout your selection. If you open in any way, but select then by using TAB (focus goes to drop down list) and ENTER, your selection goes into the combo box, but is not reflected in the $stdout. What do I have to get a binding for the different possibilities to use the combo box? Or is there even an easier way, eg. by using a binding to the variable that lays behind the combo box? Thank you a lot for your help Markus -- Markus Liebelt; markus.liebelt@online.de