|
|
> Before I post this in the bugs forum, I would like to check
> that I'm not doing anything painfully stupid - although I've
> programmed for a while I am very new to FLTK..
You are creating your Pictar widget on the stack, and there is
insufficient stack space in your runtime environment to support that.
Either increase you stack space (bad) or create the widget on the heap
by "new"ing it (good)...
See attached:
//----------------------------------------------------------------------
#include <fltk/run.h>
#include <fltk/Window.h>
#include <fltk/Widget.h>
#include <fltk/math.h>
#include <fltk/draw.h>
using namespace fltk;
class Pictar : public Widget
{
public:
Pictar(int x,int y,int w,int h,const char *l=0) :
Widget(x,y,w,h,l) {};
private:
double img[600][600];
};
int main(int argc, char **argv)
{
Window *win;
Pictar *pic;
// create a window
win = new Window (600, 600);
win->begin();
// add a pictar widget that draws stuff
pic = new Pictar(0, 0, 600, 600);
// display the window
win->end();
win->show();
/*
* do some calculations to make an image..
*/
// tadaa!
return run();
}
//----------------------------------------------------------------------
SELEX Sensors and Airborne Systems Limited
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.
********************************************************************
[ Direct Link to Message ] | |
|
| |