class TkComponent::Builder::TkRadioButton
Public Class Methods
new(parent_item, name, options = {}, grid = {}, event_handlers = [])
click to toggle source
We need to use the tk_variable created by the parent_item So we set it here and skip creation below
Calls superclass method
TkComponent::Builder::TkItemWithVariable::new
# File lib/tk_component/builder/tk_item.rb, line 164 def initialize(parent_item, name, options = {}, grid = {}, event_handlers = []) @tk_variable = parent_item.tk_variable super end
Public Instance Methods
apply_option(option, v, to_item = self.native_item)
click to toggle source
It is unfortunate that native TK radio buttons use 'value' to spedify the value for each of them, colliding with the 'value' methods for our items with variables. Thus, we need to override the setting of the 'value' option to revert it to the default functionality
Calls superclass method
TkComponent::Builder::ValueTyping#apply_option
# File lib/tk_component/builder/tk_item.rb, line 177 def apply_option(option, v, to_item = self.native_item) case option.to_sym when :value to_item.public_send(option, v) else super end end
create_variable()
click to toggle source
# File lib/tk_component/builder/tk_item.rb, line 169 def create_variable end