Kouhei Sutou
kous****@users*****
Wed May 10 14:18:43 JST 2006
Index: kazehakase/data/ext/ruby/kz/ruby-dialog.rb diff -u kazehakase/data/ext/ruby/kz/ruby-dialog.rb:1.3 kazehakase/data/ext/ruby/kz/ruby-dialog.rb:1.4 --- kazehakase/data/ext/ruby/kz/ruby-dialog.rb:1.3 Wed May 10 13:36:59 2006 +++ kazehakase/data/ext/ruby/kz/ruby-dialog.rb Wed May 10 14:18:43 2006 @@ -171,9 +171,7 @@ text =****@entry***** unless text.empty? eval_print(text) - @@history << text - update_history_spins_range - @history_spin.value = @@history.size + update_history(text) end @entry.text = "" when Gdk::Keyval::GDK_p @@ -190,6 +188,14 @@ handled end + def update_history(text) + if @@history.last != text + @@history << text + update_history_spins_range + end + @history_spin.value = @@history.size + end + def update_history_spins_range @@history_spins.each do |spin| spin.set_range(0, @@history.size)