lib/ppcurses/form/radio_button_group.rb in ppcurses-0.1.1 vs lib/ppcurses/form/radio_button_group.rb in ppcurses-0.1.2

- old
+ new

@@ -6,11 +6,11 @@ RADIO_SELECTED = '◉' class RadioButtonGroup < View attr_accessor :selected - attr_reader :current_option + attr_accessor :current_option # # label : a label for the radio button group # options: an array of strings # @@ -25,13 +25,13 @@ screen.attron(Curses::A_REVERSE) if @selected screen.addstr(" #{@label}:") screen.attroff(Curses::A_REVERSE) if @selected @options.each_with_index do |option, index| if index == @current_option - screen.addstr(" #{option} #{RADIO_SELECTED}") + screen.addstr(" #{option} #{RADIO_SELECTED} ") else - screen.addstr(" #{option} #{RADIO_NOT_SELECTED}") + screen.addstr(" #{option} #{RADIO_NOT_SELECTED} ") end end end @@ -48,9 +48,14 @@ end def height 1 end + + def clear + @current_option = 0 + end + end end