lib/shoes/swt/radio.rb in shoes-swt-4.0.0.pre12 vs lib/shoes/swt/radio.rb in shoes-swt-4.0.0.rc1

- old
+ new

@@ -1,13 +1,14 @@ # frozen_string_literal: true + class Shoes module Swt # In Swt a radio button is actually just a # button, so a lot of these methods are # borrowed from button.rb class Radio < CheckButton - attr_accessor :group + attr_reader :group # Create a radio button # # @param [Shoes::Radio] dsl The Shoes DSL radio this represents # @param [::Swt::Widgets::Composite] app The app element of this button @@ -17,12 +18,12 @@ self.group = dsl.group end def group=(value) group_lookup = RadioGroup.group_lookup - group_lookup[@group].remove(self) unless @group.nil? + group_lookup[group].remove(self) unless group.nil? @group = value || RadioGroup::DEFAULT_RADIO_GROUP - group_lookup[@group].add self + group_lookup[group].add self end end end end