Hi all, wxRuby 1.9.1 introduced great Rubish style accessors (x.label as a synonym for x.get_label). I just found that get_id has no corresponding Rubish style id accessor. For a CheckListBox or a StaticText (I haven''t checked for other kind of controls), id just returns the Ruby object_id. This is very confusing and not consistent with other accessors. Chauk-Mean. _______________________________________________ wxruby-users mailing list wxruby-users@rubyforge.org http://rubyforge.org/mailman/listinfo/wxruby-users
Alex Fenton
2007-Sep-16 17:13 UTC
[wxruby-users] wxRuby 1.9.1 and id accessor consistency problem
Chauk-Mean P wrote:> wxRuby 1.9.1 introduced great Rubish style accessors (x.label as a > synonym for x.get_label). > I just found that get_id has no corresponding Rubish style id accessor. > > For a CheckListBox or a StaticText (I haven''t checked for other kind > of controls), id just returns the Ruby object_id. > This is very confusing and not consistent with other accessors.It''s because Ruby defines the deprecated method Object#id that we didn''t make it a nice accessor for wxRuby. But instead of Wx::Window#get_id you can use the method wx_id. Probably need to update the documentation on this point; sorry for the confusion. alex
Chauk-Mean P
2007-Sep-16 20:52 UTC
[wxruby-users] wxRuby 1.9.1 and id accessor consistency problem
*Alex Fenton* wrote :>It''s because Ruby defines the deprecated method Object#id that we didn''t >make it a nice accessor for wxRuby. But instead of Wx::Window#get_id you >can use the method wx_id.wx_id is almost as long typing as get_id :-) I thought that Object#id has been made obsolete in favor of Object#object_id because id is generally used by as an "application id". This is exactly the case for wxRuby, id means wxRuby id not the object_id. Consequently, I don''t think there is a problem to define an id accessor may be at Wx::Window level.> >Probably need to update the documentation on this point; >In any case, this would be a good idea. Chauk-Mean. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070916/354cd07e/attachment.html