> Turns out it was a stupid question.

There are no stupid questions...

(Well, not the first time anyway: Ask the same thing 6 times, I might change my 
opinion...!  ;-)  )

> I wasn't aware that could override
> the resize method although now I that I think about it, nothing had
> said otherwise.


Yup, override is probably the way (indeed, at certain levels in the hierarchy, 
the resize method is explicitly virtual, to encourage override, but that maybe 
is not obvious if you are looking at the Fl_Gl_Window docs, of course...)

I think Edzard's example in his post is useful here, in that it makes the point 
about calling the base class resize(); as well as doing whatever actions you 
add - this is an important point that often gets missed, and failing to call 
the base class methods does often lead to "unexpected" behaviours that can be 
hard to debug, so...

Also, he shows how you can use that to trigger a callback - though in your case 
you may be able to do what you need directly in the resize() method itself?

Another tricky little wrinkle to this can be what happens if the resize() 
method itself causes the view to be resized (e.g. by removing some feature, 
such as, say, a scrollbar...) Does that then trigger a recursion...? Somethimes 
you need to watch out for that too, though I'd guess you'll be fine in this 
case.

Cheers, hope that helps...




********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************

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

Reply via email to