> int handle (int e) { > // DRAW vertical lines > int ret = Fl_Widget::handle (e); > switch (e) { > case FL_PUSH: > lines++; > int x1 = x(); > int y1 = y(), y2 = y()+h()-1; > fl_line(x1 + 10 * lines, y1, x1 + 10 * lines, y2);
You can't do any drawing functions (like fl_line) inside an event handler. The only time you can draw anything is inside draw(). So to do what you want, you have to modify some variables and call redraw() which will flag FLTK to call draw(), and inside your draw() routine you can use the variables to figure out where to draw the line. _______________________________________________ fltk mailing list fltk@easysw.com http://lists.easysw.com/mailman/listinfo/fltk