MacArthur, Ian (SELEX GALILEO, UK) wrote:
>> Sorry for another long post... Here's a "better" version of
>> the image plotter demo...
>>
>
> Forgot to mention - this version tested on OSX and WinXP - hope this
> reassures the OP who had queries about portability. Didn't have a Linux
> box to hand for tests, but can't see why it would not Just Work.
Two small changes, one because of case sensitivity, and one because you
forgot the fl_push_clip() call (the Linux version outputs "fl_pop_clip:
clip stack underflow!"). Other than that, it works on Ubuntu 9.04, no
differences to the windows version visible.
Here's the patch:
$ diff -ub laser-plot.cxx.ori laser-plot.cxx
--- laser-plot.cxx.ori 2009-08-31 13:24:08.618164100 +0200
+++ laser-plot.cxx 2009-08-31 13:26:37.899414100 +0200
@@ -11,7 +11,7 @@
#include <FL/Fl_Box.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Button.H>
-#include <Fl/fl_draw.H>
+#include <FL/fl_draw.H>
static Fl_Double_Window *main_win;
@@ -50,6 +50,7 @@
void vw_box::draw(void) {
if (!data) return;
/* Redraw the whole image */
+ fl_push_clip(x(), y(), iw, ih);
fl_draw_image(data, x(), y(), iw, ih, id);
fl_pop_clip();
}
... unless you wanted to remove fl_pop_clip() as well ;-)
And, needless to say, this should be changed for Windows and Mac, too.
Albrecht
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk