Re: [Fxruby-users] Re: FXRuby Bug
Status: Inactive
Brought to you by:
lyle
From: Lyle J. <jl...@cf...> - 2003-06-19 16:37:25
|
Joel VanderWerf wrote: > It might be confusing if > > btn.setTextColor(FXColor::Blue) > > returns btn, but > > btn.textColor = FXColor::Blue > > returns FXColor::Blue, which is the current behavior. True. > OTOH, the set* functions in the Fox C++ API consistently are declared to > return void, which is not an option in Ruby, so I guess Lyle is free to > return something that's more useful than nil. > > I kind of like the suggestion to return the receiver, so that you can > chain set* methods to operate on the same object. It gives the set* > methods a use that the corresponding attr_writers do not have, and makes > me feel better that they exist at all... For the time being I think I will leave it alone, but I have added a change request to the list at SourceForge. My gut reaction was that #setTextColor and #textColor= should have consistent return values, but I don't know that there's any precedent (e.g. in the standard Ruby library) that suggests this. So we may just get to make up our own rules for this one ;) |