summaryrefslogtreecommitdiff
path: root/ext/tk/lib/tkextlib/iwidgets/checkbox.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ext/tk/lib/tkextlib/iwidgets/checkbox.rb')
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/checkbox.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/ext/tk/lib/tkextlib/iwidgets/checkbox.rb b/ext/tk/lib/tkextlib/iwidgets/checkbox.rb
index 5e0fb5e7b6..05d0e1d813 100644
--- a/ext/tk/lib/tkextlib/iwidgets/checkbox.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/checkbox.rb
@@ -56,7 +56,9 @@ class Tk::Iwidgets::Checkbox
keys = tag
tag = nil
end
- unless tag
+ if tag
+ tag = Tk::Itk::Component.new(self, tagid(tag))
+ else
tag = Tk::Itk::Component.new(self)
end
tk_call(@path, 'add', tagid(tag), *hash_kv(keys))
@@ -93,7 +95,9 @@ class Tk::Iwidgets::Checkbox
keys = tag
tag = nil
end
- unless tag
+ if tag
+ tag = Tk::Itk::Component.new(self, tagid(tag))
+ else
tag = Tk::Itk::Component.new(self)
end
tk_call(@path, 'insert', index(idx), tagid(tag), *hash_kv(keys))