Re: [Fxruby-users] FXSegment question
Status: Inactive
Brought to you by:
lyle
|
From: Lyle J. <jl...@cf...> - 2003-08-29 14:09:09
|
Fredrik Jagenheim wrote:
> Does anyone have a better solution to this?
>
> I thought of downloading the FXRuby source and patch FXSegment.new
> myself, but figured there probably was a better solution I couldn't
> see...
First things first, I will definitely add this kind of constructor for
both FXSegment and FXArc in the next release. But in the meantime,
here's a workaround you can use in your code (i.e. that doesn't require
you or your users to patch FXRuby itself). Add this somewhere at the top:
require 'fox'
module Fox
class FXSegment
alias old_initialize initialize
def initialize(a, b, c, d)
old_initialize
self.x1 = a; self.y1 = b; self.x2 = c; self.y2 = d
end
end
end
and it should do the trick.
Thanks for the suggestion, and hope this helps,
Lyle
|