On 03.05.2012 23:04, Bill Spitzak wrote:
> You described it correctly (except I would pass the rectangle as a
> reference rather than as 4 numbers),

Yup, and I think FLKT 2 uses a rect structure, and it's in FLTK 3 too
(or maybe not yet?). But maybe we could also use distinct arguments
for convenience in another overridden method.

> and I think you are right that this
> would break any existing code that tries to call a base class draw(), as
> that would call the virtual draw(rect) function.
>
> Calling Base::draw() is not useful to implement a draw(rect) function
> (as it does not pass the rect) so this is not a problem for new code.

That's true, but that doesn't help (fix) the "old code". :-(

Having a draw(rect) method would be useful for other cases anyway, so
we should probably investigate a solution that is compatible with old
code...

> Any chance some more kludges could be put into the fltk1 emulation so
> that this works for that? One way is that draw(void) only exists in the
> fltk1 wrapper and some trick is done so that all the implementatios call
> the actual function (ie Subclass::draw(rect) rather than just
> this->draw(rect)). There would have to be something in the fltk1 wrapper
> anyway so that draw() can be overridden by old code.

Something like that, maybe.

Albrecht
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to