> So how come you can't just write a stand alone function, providing the
> headers are there:
> 
> void draw() {
> 
>         fl_color(FL_BLACK);
>         fl_rectf(20,20,20,20);
> }


You mean as a "stand alone" function, not a member of any class?
You can, but then how will it be called?

If you create a standalone function like that, then call it from within
the draw() method of your class, it will duly draw your rectangle.

However, if you just try to call it randomly at some point in your code,
you have no way of knowing what rendering context might be valid at that
time, so where will the drawing go?

The only valid place to do *any* drawing in fltk is within the draw()
method of a widget class, but if you want to create a function that does
all the drawing, then call that from the draw() method, that'll be just
fine.






SELEX Galileo Ltd
Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14 
3EL
A company registered in England & Wales.  Company no. 02426132
********************************************************************
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