Closed jimfoltz closed 10 years ago
Took me a few minutes to find. I seem to remember having a similar issue when I first started out. I guess it's technically a bug, but it can be easily avoided.
You are creating groups and attaching controls to them before you've attached the group to the window. Moving line 42 to 33 will fix the first error. You'll then get a second error which is exactly the same issue but for group 2.
Enjoy! :)
On 9 March 2014 21:23, Jim Foltz notifications@github.com wrote:
Here's the code which causes the error..
https://github.com/jimfoltz/layer-behavior/blob/dev/src/jf_layer_behavior/main.rb#L75
I can get the properties of the RadioButton, but when I ask if it is checked?, I get the error.
Reply to this email directly or view it on GitHubhttps://github.com/thomthom/SKUI/issues/90 .
Control.name
was added to let you refer to control's by symbols. They are safer than holding on to references.
Ah! rdo_Visible
is never assigned the window because grp_Default
wasn't added to the window - meaning it never had a reference to pass on.
It was... Check out line 42. The problem is order.
On 9 March 2014 23:48, Thomas Thomassen notifications@github.com wrote:
Ah! rdo_Visible is never assigned the window because grp_Default wasn't added to the window - meaning it never had a reference to pass on.
Reply to this email directly or view it on GitHubhttps://github.com/thomthom/SKUI/issues/90#issuecomment-37142619 .
Control.name was added to let you refer to control's by symbols. They are safer than holding on to references.
So Control.name
... must turn multi-word strings into symbols? Does "Add Layer" become :add_layer
?
The problem is order.
Yes, I think so too. However, when I added an OPTIONS
hash the need to reference those controls in another block went away...
@jimfoltz a control by default has no name. Check example.rb
for how it's used: https://github.com/thomthom/SKUI/blob/master/examples/example.rb#L28
AH! It's like a "handle"! :thumbsup: No need to make variables for controls, then.
Here's the code which causes the error.. https://github.com/jimfoltz/layer-behavior/blob/dev/src/jf_layer_behavior/main.rb#L75
I can get the
properties
of the RadioButton, but when I ask if it ischecked?
, I get the error.I tagged the commit as iss90
Full Error: