"What do you get when you run it in your debugger? What doe sit show
happening?"
Imacarthur


This is what I get from my debugger :

Program received signal SIGSEGV, Segmentation fault.
0x080498d3 in MainWindow::translate (this=0x0) at Poligono.cpp:75
75       mygl->translate(1.0,1.0,0.0);
(gdb) backtrace
#0  0x080498d3 in MainWindow::translate (this=0x0) at Poligono.cpp:75
#1  0x080498c7 in MainWindow::translate_cb (w=0x8063418, v=0x0) at
Poligono.cpp:70
#2  0x00470793 in Fl_Menu_::picked(Fl_Menu_Item const*) () from
/usr/lib/libfltk.so.1.1
#3  0x00470c8d in Fl_Menu_Bar::handle(int) () from /usr/lib/libfltk.so.1.1
#4  0x0045bc34 in ?? () from /usr/lib/libfltk.so.1.1
#5  0x0045bd4c in Fl_Group::handle(int) () from /usr/lib/libfltk.so.1.1
#6  0x0045bc34 in ?? () from /usr/lib/libfltk.so.1.1
#7  0x0045bd4c in Fl_Group::handle(int) () from /usr/lib/libfltk.so.1.1
#8  0x0044389d in Fl_Window::handle(int) () from /usr/lib/libfltk.so.1.1
#9  0x00442e24 in ?? () from /usr/lib/libfltk.so.1.1
#10 0x00443e6f in Fl::handle(int, Fl_Window*) () from
/usr/lib/libfltk.so.1.1
#11 0x00495112 in fl_handle(_XEvent const&) () from /usr/lib/libfltk.so.1.1
#12 0x0049644e in ?? () from /usr/lib/libfltk.so.1.1
#13 0x00496882 in fl_wait(double) () from /usr/lib/libfltk.so.1.1
#14 0x00444b1c in Fl::wait(double) () from /usr/lib/libfltk.so.1.1
#15 0x00444c94 in Fl::run() () from /usr/lib/libfltk.so.1.1
---Type <return> to continue, or q <return> to quit---

Seems to me that when I call the translate() method the object mygl is no
longer available. But is there a way of calling this method without making
this parse
((MainWindow*)v)->translate();  ? Or at least do it differently?

I guess that here is where the pointer is not available anymore or even
before.

This is my main function... I had forgotten..

#include "Poligono.h"
#include "T.h"

int main(int argc, char** argv){
    MainWindow win(50,100, 800, 600, "Poligono");

    return Fl::run();
}

 --
Att,

Pedro Henrique Linhares.
_______________________________________________
fltk mailing list
fltk@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to