I want to refresh the combobox when I choose a new files.

I used the ".clear" it will clear the combobox context, but I choose the
other file the combobox context just show nil (same as clear).

When I didn't use the .clear the combobox context will stack up by each
file.




cb2_s.clear
cb2_i.clear

fop2 = File.open(label2.text)
text2 = fop2.readlines
header_2 = ppoc.call(text2[0])

m = 0
while header_2[m]!=nil

   if header_2[m] =~Regexp.new(/game/)

  cb2_s.prepend_text "#{header_2[m]}"
   end

   if header_2[m] =~Regexp.new(/name/)

  cb2_i.prepend_text "#{header_2[m]}"
   end
   m+=1
end


cb2_s.signal_connect "changed" do |w, e|
  on_changed(w, e, label)
  label_2_s.text = label.tex
end

cb2_i.signal_connect "changed" do |w, e|
  on_changed(w, e, label)
  label_2_i.text = label.text
end




Thanks.

-- 
Posted via http://www.ruby-forum.com/.