Re: [Fxruby-users] Re: a color object
Status: Inactive
Brought to you by:
lyle
From: Martin H. <ma...@zs...> - 2004-02-04 10:42:24
|
On Wednesday 04 February 2004 04:04, Lyle Johnson wrote: > .... One concern, however, is how to handle return values > for methods that currently return colors as Integers. That is, I think > to preserve back-compatibility those methods would need to continue to > return color values as integers. Any thoughts? > Two that I can think of - one is to provide an alternative method=20 (xxx_as_color) that returns a colour object rather than an integer, or th= e=20 other is to add to_color to the Integer class which returns an instance o= f=20 itself as a colour object? I don't find either very attractive but they would offer both integer and= =20 colour retrieval. Another is maybe to allow a class/global setter -=20 Fox.returnColorsAsObject=3D(boolean) and maybe use that to determine what= to=20 return from each FXRuby function?=20 Although probably more work from a development point of view, I actually=20 prefer this approach because it does not clutter the rest of the API, nor= =20 interfere with the Integer class... Cheers, Martin |