How to prevent unlocking the screen

Jacques Hausser jacques.hausser at unil.ch
Tue Dec 15 08:31:56 EST 2009


Mark,

Sorry, I was not crystal clear. When I was talking of copying a picture, I was actually transferring the imageData (As an alternative, I also tried to use "import snapshot", what works fine  and perhaps a bit quicker). You are quite right with the screen unlocking between the two handler in my second solution - it was my reason to try the first one first ;-)
And you are perfectly right in suspecting the geometry manager: it is certainly the culprit: in my first solution it does its work AFTER the handler resizing the image is completed. And the size of images was set in reference to a "geometrized" rectangle graphic. So of course the image size corresponds to the previous size of this graphic...
I foresee a nice moment to write scripts to control the size of a good amount of objects.

Still many thanks, and all the best

Jacques

Le 15 déc. 2009 à 12:58, Mark Schonewille a écrit :

> Hi Jacques,
> 
> When you copy a resized picture, Revolution may restore the original dimensions. Copy the picture first, then resize the new picture, or use the imagedata of the old picture to set the imagedata of the new picture. If you do the latter, set the dimensions of the new picture to formattedHeight and formattedWidth.
> 
> I strongly recommend not to use the geometry manager. Instead, write your own scripts in a resizeStack handler. This is more reliable and gives you more control in situations like these.
> 
> Your incomplete scripts don't give me a good impression of what is going on, hence I can't tell you why the screen unlocks prematurely. Do you have an answer or ask dialogue somewhere? Are you repeating or waiting with messages perhaps?
> 
> Note that locking the screen doesn't really lock the entire screen and not even the entire Revolution interface. It only locks windows, while they are redrawn in memory.
> 
> In the case of your particular stack, when the resizeStack handler runs, all other handlers have finished already, because I don't see an explicit call to the resizeStack handler. If a handler containing the lock screen command finishes, the screen unlocks. This means that screen will unlock before the resizeStack handler runs.
> 
> Just a few thoughts. I hope this helps.
> 
> --
> Best regards,
> 
> Mark Schonewille
> 
> Economy-x-Talk Consulting and Software Engineering
> Homepage: http://economy-x-talk.com
> Twitter: http://twitter.com/xtalkprogrammer
> 
> Full PayPal integration and automation in web site or (Revolution/SuperCard/other) software. Contact me for a quote
> http://economy-x-talk.com/contact.html
> 
> Op 15 dec 2009, om 12:45 heeft Jacques Hausser het volgende geschreven:
> 
>> Thanks, Mark. Works for almost everything, except for a copy of a picture (I have the original picture hidden and resized in the background, and a visible copy of it to work on). I tried two solutions
>> 
>> 1) resize the original picture and recopy it in my changeStackSize command:
>> 
>> command changeStackSize
>>  lock screen
>>  -- (computes and sets the new size)
>>  resetpicture -- (resizes the original picture and recopy it)
>> end changeStackSize
>> 
>> The picture is not resized... why ?
>> 
>> 2) catch the resizeStack message and resize the picture from there
>> 
>> command changeStackSize
>>  lock screen
>>  -- (computes and sets the new size)
>> end changeStackSize
>> 
>> on resizeStack
>>  lock screen
>>  revupdateGeometry
>>  resetpicture - (resizes the original picture and recopy it)
>> end resizeStack
>> 
>> the picture is resized OK, but you see the two successive steps on the screen...
>> Needless to say that resetpicture is the same in both cases...
>> 
>> Jacques
> 
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution

******************************************
Prof. Jacques Hausser
Department of Ecology and Evolution
Biophore / Sorge
University of Lausanne
CH 1015 Lausanne
please use my private address:
6 route de Burtigny
CH-1269 Bassins
tel/fax: 	++ 41 22 366 19 40
mobile:	++ 41 79 757 05 24
E-Mail:	jacques.hausser at unil.ch
*******************************************




More information about the use-livecode mailing list