On 18 Mar 2007, at 14:09, Maximilian Matthé wrote:
> I'm drawing into the widget I want to be redrawn with redraw:
>
> while(i <= 1.0f)
> {
> sVector p = pos + dir * i;
> sLine l = BuildLine(p-orth, p+orth);
>
>
> fltk::push_matrix(); // flush must be enclosed to store the
> current matrix?
> redraw();
> fltk::flush();
> fltk::pop_matrix();
>
> fltk::setcolor(fltk::BLACK);
> fltk::drawline(l.Start.x, l.Start.y, l.End.x, l.End.y);
>
> fltk::setcolor(fltk::RED);
> for(int c = 0; c < hits.size(); c++)
> {
> const sPoint& p = m_Corns[hits[c]];
> if(PointLineCoords(p, l) > 0)
> DrawCorn(p);
> }
> i += step;
> }
Drawing into your widget outside the ::draw() method of the widget is
not supported.
I assume the code you have posted is working for you - but that is
more by luck than by design.
If you really, really, need to draw into the widget outside of
its ::draw() method then you probably want to investigate
the ::make_current() method - that may take you closer to where you
need to be.
But for now, I would suggest that what you are doing is unsupported,
and I'm surprised it works at all, really!
What are you trying to achieve with this? Maybe there is a better way
- if you tell us what you need to do, perhaps we can help you get there?
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk