GUI - problems with Connect

Hi

As usually people here I have a problem too.

I am building GUI for my program.
As it is proposed in tutorial I have made a class MyMainFrame, there I have an TGMainFrame object and all that stuff. And I have there an instance of my class ABC. Moreover I have in MyMainFrame button ‘plot’ and a line:

plot->Connect(“Clicked()”,“ABC”, this->SomeABC,“Details()”);

( I have first initialized SomeABC of course)

Details is a function in class ABC and it use some other functions and values from ABC. And after pushing ‘plot’ I have *** Break *** segmentation violation.

When I put instead of Details some other function which NOT USE any other functions or values from ABC then everything works properly.

How do you think, what is wrong?

Hi,

At first glance I would say there is a bug (e.g. uninitialized variable) in your ABC::Details() method, or in any other method called from there.
You should try to debug (put a breakpoint in) your ABC::Details() method to see what’s wrong and where it crashes.
And if you need more help, I’m scared you will have to give more details (e.g. a stack trace or even better: a working piece of code reproducing the problem…)

Cheers, Bertrand.

I have to say, that I have solved this problem, but in some complicated way…

I have written a function in class ABC which contains execution of function Details and it works!