Palette redraw problem

J. Landman Gay jacque at hyperactivesw.com
Fri May 21 11:44:43 EDT 2004


On 5/21/04 3:26 AM, Robert Brenstein wrote:

>> Before I bugzilla this, I wanted to check to see if anyone else has 
>> hit this snag and whether there is a work-around for it.
>>
>> I have stack that opens a tool palete. I want the palette to disappear 
>> when the stack is not frontmost, and reappear when it is. I scripted a 
>> suspendStack handler and a resumeStack handler to manage this:
>>
>> on suspendStack
>>  hide palette "myPalette"
>> end suspendStack
>>
>> on resumeStack
>>  show palette "myPalette"
>> end resumeStack
>>
>> This works exactly every other time the stack is suspended; that is, 
>> the first time it hides, the second time it doesn't. In addition, the 
>> times when the palette is reshown, it is not redrawn and appears on 
>> screen as a plain white rectangle with no contents. "Go this card of 
>> stack myPalette" from the message box will force a redraw and the 
>> contents appear.
> 
> 
> After reading that "palette" above was a miss in email, I have verified 
> that the same occurs under OS9. When the palette is hidden, it always 
> shows. However, when it is showing, it hides only on every other switch. 
> From watching messages, I see that the suspendStack is sent one time to 
> the palette stack and another time to the other stack. It seems that 
> when the palette shows first time, it remains the defaultstack so the 
> next suspend will go to it. This happens even if I just click the 
> palette to generate suspend/resume. Sounds like engine bug.

I spent all day on this yesterday, tried everything, and could not 
create a viable solution. (By the way, I notice in the Rev docs that the 
same "palette" misprint is in there, so I'm not the only one. It's a 
natural typo, but it does generate an error. The correct syntax, of 
course, is 'show/hide stack mypalette". But I digress...)

I did learn a few things while experimenting. The all-white empty 
palette I was seeing was probably caused by locking messages before 
showing or hiding the palette. I was trying this as a potential solution 
which didn't work. Apparently if you lock messages before changing the 
state of the palette, the palette contents do not draw.

I tried inserting various resumestack/suspendstack handlers in the 
palette itself, both as blocking handlers or as functional handlers with 
commands. Blocking both messages seemed to help a bit, but didn't 
completely solve the problem. I tried so many other things too that I 
can't list them all here.

I've reported it in Bugzilla, though I am not yet completely convinced 
it is a real bug. I did an awful lot of testing to see what messages 
were being generated from which stack, and what I was getting looked 
correct. I just can't find a way to use those messages to get the 
behavior I need.


-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com


More information about the use-livecode mailing list