Vladimir Konrad
2008-Feb-09 14:27 UTC
[fxruby-users] FXRuby, blocks and hash (? should this work}
Example code (:opts omitted)
It is done in initialize of Win < FXMainWinow:
@cg = {}
FXMatrix.new {|m|
FXLabel.new(m, "Log-in name: ")
@cg[:login] = {:name => FXTextField.new(m, 25)}
@cg[:login][:name].setFocus
p @cg[:login][:name].class
FXLabel.new(m, "Password: ")
@cg[:login] = {:password => FXTextField.new(m, 25)}
}
p @cg[:login][:name].class
output is:
Fox::FXTextField
NilClass
The question is, why id disappears?
Vlad
Please access the attached hyperlink for an important electronic communications
disclaimer: http://www.lse.ac.uk/collections/secretariat/legal/disclaimer.htm
Vladimir Konrad
2008-Feb-09 14:40 UTC
[fxruby-users] FXRuby, blocks and hash (? should this work}
> The question is, why id disappears?Should be "... why _it_ dissapears?" (i.e. becomes NilClass) Vlad Please access the attached hyperlink for an important electronic communications disclaimer: http://www.lse.ac.uk/collections/secretariat/legal/disclaimer.htm
Melton, Ryan
2008-Feb-09 17:57 UTC
[fxruby-users] FXRuby, blocks and hash (? should this work}
You overwrote the @cg[:login] hash with a new hash that only contains
:password.
The following change should fix it.
Was:
@cg[:login] = {:password => FXTextField.new(m, 25)}
Is:
@cg[:login][:password] = FXTextField.new(m, 25)
Hope this helps,
Ryan
-----Original Message-----
From: fxruby-users-bounces at rubyforge.org
[mailto:fxruby-users-bounces at rubyforge.org] On Behalf Of Vladimir Konrad
Sent: Saturday, February 09, 2008 7:27 AM
To: fxruby-users at rubyforge.org
Subject: [fxruby-users] FXRuby, blocks and hash (? should this work}
Example code (:opts omitted)
It is done in initialize of Win < FXMainWinow:
@cg = {}
FXMatrix.new {|m|
FXLabel.new(m, "Log-in name: ")
@cg[:login] = {:name => FXTextField.new(m, 25)}
@cg[:login][:name].setFocus
p @cg[:login][:name].class
FXLabel.new(m, "Password: ")
@cg[:login] = {:password => FXTextField.new(m, 25)}
}
p @cg[:login][:name].class
output is:
Fox::FXTextField
NilClass
The question is, why id disappears?
Vlad
Please access the attached hyperlink for an important electronic
communications disclaimer:
http://www.lse.ac.uk/collections/secretariat/legal/disclaimer.htm
_______________________________________________
fxruby-users mailing list
fxruby-users at rubyforge.org
http://rubyforge.org/mailman/listinfo/fxruby-users
This message and any enclosures are intended only for the addressee. Please
notify the sender by email if you are not the intended recipient. If you are
not the intended recipient, you may not use, copy, disclose, or distribute this
message or its contents or enclosures to any other person and any such actions
may be unlawful. Ball reserves the right to monitor and review all messages
and enclosures sent to or from this email address.
Vladimir Konrad
2008-Feb-09 18:25 UTC
[fxruby-users] [solved] FXRuby, blocks and hash (? should this work}
> You overwrote the @cg[:login] hash with a new hash that only contains > :password. > Hope this helps, > RyanThank you, I did not see what was there but only what was in my head... Vlad Please access the attached hyperlink for an important electronic communications disclaimer: http://www.lse.ac.uk/collections/secretariat/legal/disclaimer.htm