thomthom / SKUI

Ruby wrapper of classes that maps to GUI controls in SketchUp's UI::WebDialogs
MIT License
26 stars 14 forks source link

Checkbox not checking #61

Closed noelwarr closed 10 years ago

noelwarr commented 10 years ago

The check! and uncheck! methods of the Checkbox class don't seem to work. Looking at the source code it seems obvious they wouldn't:

prop_reader_bool( :checked, &TypeCheck::BOOLEAN )

def check!
  checked = true
end

I'd have a go at changing this myself but I don't quite get the properties module yet :)

thomthom commented 10 years ago

checked = true here is not some local variable. It's a method call to checked=. check! is syntax sugar.

Got reproducible code?

noelwarr commented 10 years ago

I thought checked was declared at the top as a prop_reader, not a attr_accessor and that's why it didn't work Here is the code: https://gist.github.com/noelwarr/b0b4f75e05002bc9b151

2013/9/27 Thomas Thomassen notifications@github.com

checked = true here is not some local variable. It's a method call to checked=. check! is syntax sugar.

Got reproducible code?

— Reply to this email directly or view it on GitHubhttps://github.com/thomthom/SKUI/issues/61#issuecomment-25255853 .

thomthom commented 10 years ago

Oh... Well that is embarrassing...

This is why I need to implement unit tests.

noelwarr commented 10 years ago

:)

SKUI is much better than what I had going. Was it Linus torvalds that said "all bugs are tiny with 100 eyes"? Something like that. SKUI might still be a bit buggy but it's on a solid foundation. I have to buy you a drink in Lisbon!

2013/9/27 Thomas Thomassen notifications@github.com

Oh... Well that is embarrassing...

This is why I need to implement unit tests.

— Reply to this email directly or view it on GitHubhttps://github.com/thomthom/SKUI/issues/61#issuecomment-25258149 .