On 02/25/12 15:19, Ian MacArthur wrote:
> [..] seems to depend on drawing into the window from within the handle() 
> method rather than from within the draw() method.

        Yes: don't do drawing outside the draw() method,
        it's bad form and not supported.

        Do not do it even if it seems to work.
        The docs are very clear on this, the behavior is undefined.

        From "Drawing things in FLTK":

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
There are only certain places you can execute drawing code in FLTK.
Calling these functions at other places will result in undefined behavior!

    > The most common place is inside the virtual Fl_Widget::draw() method.
      To write code here, you must subclass one of the existing Fl_Widget
      classes and implement your own version of draw().

    > You can also create custom boxtypes and labeltypes. These involve writing
      small procedures that can be called by existing Fl_Widget::draw() methods.
      These "types" are identified by an 8-bit index that is stored in the
      widget's box(), labeltype(), and possibly other properties.

    > You can call Fl_Window::make_current() to do incremental update of a 
widget.
      Use Fl_Widget::window() to find the window.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

        I usually avoid that last item to keep drawing code in draw()
        methods only.
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to