I have in my program a textentry, where you can put the name of the file to analyse, then when you push enter the program makes a plot.
But as I can see pushing enter is not intuitive for user, so I would like to put just by the TextEntry a TextButton like “Make a plot” with the same function as pressing enter. But then I get segmentation fault. What is wrong?
This is the code:
mframe->AddFrame(map1, new TGLayoutHints(kLHintsCenterX,BL,1,BU,BD));
TGTextButton *lm1 = new TGTextButton(mframe,"&load new \n map 1");
mframe->AddFrame(lm1, new TGLayoutHints(kLHintsCenterX,BL,BR,BU,BD));[/code]
What I can add is that SetMap1 takes text from ‘map1’ TextEntry.
It is hard to guess what’s going wrong with your code with so little information… Could you post a more complete part of your code (especially the slot method SetMap1()) or a working macro showing the problem?
Here is it:
charbuff=new char ;
if(targc) delete SomeMap1;
char pre="scp usr1@ps1111:2009/";
where TextEntry map1 is a component of a class MyMainFrame
when I do not use button,only TextEntry, everything works
You must not call destructor of the signal emitter in the slot.
Destroys the text entry and the button (and all other GUI elements)… It may work in some cases (e.g. the text entry), but will lead to a crash most of the time…