From: Hidetoshi NAGAI Date: 2003-09-05T16:39:16+09:00 Subject: Re: Newbie having trouble with SpecTcl, TkListbox and TkScrollbar Hi, From: ejb@theworld.com (Ed Baker) Subject: Newbie having trouble with SpecTcl, TkListbox and TkScrollbar Date: Fri, 5 Sep 2003 15:49:00 +0900 Message-ID: > Everything works 'visually'. But, I can't seem to figure out the index > value returned from the list box. Although I don't know what you want, could the following patch help you? --- aaa-orig.rb 2003-09-05 16:24:50.000000000 +0900 +++ aaa.rb 2003-09-05 16:23:39.000000000 +0900 @@ -48,11 +48,10 @@ TkGrid.columnconfigure(root, 1, 'weight' => 0, 'minsize' => 268) TkGrid.columnconfigure(root, 2, 'weight' => 0, 'minsize' => 14) # Additional interface code. - print "listbox_1 selection " , listbox_1.curselection, "xx \n" - print "listbox_1 selection " , listbox_1.curselection[0], "xx \n" - print "listbox_1 selection class " , listbox_1.curselection.class, -"\n" - listbox_1.curselection.each { |x| puts x } + listbox_1.bind('ButtonRelease-1', proc{ + listbox_1.curselection.collect {|x| p [x, listbox_1.get(x)] } + @zzentry.value = listbox_1.get(listbox_1.curselection[0]) + }) # End additional interface code. end # list_scrl_entry1_ui list_scrl_entry1_ui top -- Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)