Non-persistent object, persistent headache [message #79219] |
Sun, 12 February 2012 18:46  |
wlandsman
Messages: 743 Registered: June 2000
|
Senior Member |
|
|
This is a question that I don't expect anyone to be able to answer (since the relevant code is too long and complicated, and I give only a much simplified snippet here) but after 3 days of trying to determine the problem, I am hopeful that writing the question might give me some insight.
I am setting a value in an object widget. Right before exiting the method I verify that I have the correct value:
pro myobject::method1, event=event
print,*self.x
2
....
*self.x = 3
print,*self.x
3
end
However, when the next widget event occurs, I immediately check the value of *self and find that it no longer has the value that I have just given it.
pro myobject::method2, event=event
print,*self.x
2
I use this technique several times in the code and there only one case where it is failing. Any suggestions on possible causes of the problem? Is there anyway I can determine where *self is changing its value? Thanks, --Wayne
|
|
|
Re: Non-persistent object, persistent headache [message #79292 is a reply to message #79219] |
Tue, 14 February 2012 04:45  |
wlandsman
Messages: 743 Registered: June 2000
|
Senior Member |
|
|
Thanks for those who E-mailed or posted a reply. I still don't have a solution, but I do have an important clue. My widget is modal -- actually the child of a modal widget. If I instead set modal=0 the problem goes away. (Unfortunately, the widget needs to be modal to prevent timing problems.) Maybe when the modal widget is destroyed, the value being pointed to is also destroyed? I will try to work on a simple example. --Wayne
|
|
|