Forums > Dev

How to override jbox_set_rect()?

Jul 05 2012 | 9:17 am

I need to override jbox_set_rect() but am not finding how to do this in the SDK documents.

The issue is that my object needs to precalculate several state variables used in the paint routine (and in other mouse and keystroke handling routines) dependent on its size. The obvious place to do these calculations is when the box rect is set.

Obviously I would need to call the default routine from my custom routine, probably at the start.

I may also need to override the jbox_set_rect_for_view() and jbox_set_rect_for_sym() variants. Is one of these a bottle-neck function? In that case I would only need to override the bottleneck guy.

I apologize if there is some SOP for overriding default attribute setters I should know about, but I’ve gone a bit rusty with the attribute API. Not had to use it for about two years.

Jul 05 2012 | 9:31 am

You can’t override it as far as I know, but if you might be able to do that with the oksize method:

Jul 05 2012 | 11:10 am

Thanks. From my initial test it should work. Not an obvious use of semantics, but it should get me through the night.

I do need to rely on the oksize method being called at instantiation time. This is currently happening. I just hope that doesn’t change in some future release.

Jul 05 2012 | 2:03 pm

Some of our objects do that so it’s likely to stay this way ;-)

Viewing 4 posts - 1 through 4 (of 4 total)

Forums > Dev