Peculiar behavior of group objects with hide-lock. show-unlock

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Peculiar behavior of group objects with hide-lock. show-unlock

Richmond Mathewson via use-livecode
I have this routine where I am "typsetting" a field which updates with lessons/text… use can forward one lesson at a time.
local sLesson is incremented, the script fetch text on disk

but I am unable to get  nice transition effect… sometimes it's even as if the "image" of the field is cached, even though I set it to empty and the screen updates only if I touch the field or try to scroll I get this on desktop and mobile, both behave the same

controls are a background image which is updated
and onto of that a semi-translucent back grc group with a text field on top

the grc and the text field "daily-lesson-text" are grouped into "lessonTextControl"

Given this scenario:

command buildLesson pLessonNumber

hide grp "lessonTextControl" with visual effect dissolve very fast
lock screen
put empty into fld "daily-lesson-text"

# FETCH FILES here
# insert into field, all the while setting type styles to the last line
# as the only way I could figure out how to dynamically set type from plain text
# then this:

# finish with the last bit of text:
put cr & (line 6 to -1 of tTodaysMWS) after fld "daily-lesson-text"


show grp "lessonTextControl"
unlock screen with visual effect Dissolve very fast
end buildLesson

What happens:   is this sequence of visual events

1) goes empty… as if line 3 of the above came first
2) Now the grp (with only the grc) fades
3) there is a brief pause while my typesetting finishes in the background
4) now the bkg grc of grp "lessonTextControl"  shows
5) but text does not appear, until I touch the field.. the "pop" it is rendered.

I suspect this is a) buggy but b) work--aroundable  but I can't find the way.

swapping the hide and lock doesn't help

# finish with the rest of text
put cr & (line 6 to -1 of tTodaysMWS) after fld "daily-lesson-text"
unlock screen
show grp "lessonTextControl" with visual effect dissolve very fast
end buildLesson

the text appear briefly but then disappears until I touch it.

this doesn't work either

# don't us lock:

on buildlesson
hide grp "lessonTextControl" with visual effect dissolve very slowly
put empty into fld "daily-lesson-text"  # this happens before the above
# then only does the background graphic fade

# set type here
# then simply
show grp "lessonTextControl" with visual effect dissolve very fast.

the text field is never updated on screen until I touch the field.

?? what am I missing?






The first dissolve of the grc never happens as the lock screen occurs almost immediately. but the text filed is empty… but the lock field trumps the visual effect.


then later the field never updates, the show should





Svasti Astu, Be Well
Brahmanathaswami
www.himalayanacademy.com

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Peculiar behavior of group objects with hide-lock. show-unlock

Richmond Mathewson via use-livecode
I've hit a similar, but not identical, issue and have been planning to
submit a bug report but it's been tricky to extract example code from my
full project so I haven't got to it yet.

There seems to be an issue with nested lockscreens if one of the locks
uses a visual effect. My guess is that the one with a visual effect
seems to corrupt or override the lock count.

The workaround in my current project is to make sure there is only one
set of lock/unlock commands, the one with the visual effect. Apparently
that didn't work for you.

My stack doesn't use "show/hide with visual effect" though. Instead I
"lock screen for visual effect" and then later "unlock screen with
visual effect." Maybe separating out the command that way would work better.


On 7/5/17 11:05 PM, Sannyasin Brahmanathaswami via use-livecode wrote:

> Given this scenario:
>
> command buildLesson pLessonNumber
>
> hide grp "lessonTextControl" with visual effect dissolve very fast
> lock screen
> put empty into fld "daily-lesson-text"
>
> # FETCH FILES here
> # insert into field, all the while setting type styles to the last line
> # as the only way I could figure out how to dynamically set type from plain text
> # then this:
>
> # finish with the last bit of text:
> put cr & (line 6 to -1 of tTodaysMWS) after fld "daily-lesson-text"
>
>
> show grp "lessonTextControl"
> unlock screen with visual effect Dissolve very fast
> end buildLesson
>
> What happens:   is this sequence of visual events
>
> 1) goes empty… as if line 3 of the above came first
> 2) Now the grp (with only the grc) fades
> 3) there is a brief pause while my typesetting finishes in the background
> 4) now the bkg grc of grp "lessonTextControl"  shows
> 5) but text does not appear, until I touch the field.. the "pop" it is rendered.


--
Jacqueline Landman Gay         |     [hidden email]
HyperActive Software           |     http://www.hyperactivesw.com


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Peculiar behavior of group objects with hide-lock. show-unlock

Richmond Mathewson via use-livecode
Jacque, you can pull nightly and check out the daily lesson card script.

I don't have multiple lock unlock anywhere… I read that in the docs.

I made sure

1) Pair only lock/unlock
2) one pair only hide/show

in the whole script.. but "no way, no how" could I get them play together. There are clearly rendering issues where (I suspect) the VRam  update for the visual effect is almost like running on a separate thread and  is running actually slower than the engine, and to make matters mor interesting, some old version of the field is cached and that cached version is still "alive" even after the script issues

put empty into fld "daily-lesson-text"
# cached version of the field is still floating round in the pretaloka. (world of disembodies souls attached to the earth plane… "ghosts")

I stripped out *all* hide and show handlers and trimmed back to

1) lock screen
2) then: put empty into the field; then build the whole text/typesetting with the next lesson
3) unlock screen with visual effect dissolve very fast.

OK this works. Except that I *did* want a pause in between where the users see the full background photo to have a brief "oh lovely!" moment, before showing the updated lesson text.

As it is now, the lock and unlock serves well. What seems like a lot of code to build/typeset the field happens "instantly" in the background with the screen locked and then the text dissolved and shows the new text. its like the text of the previous lesson magically "melts" into the next new text. Not my intended visual effect, but still pretty cool.

But it would be good to figure out how to do this.

Going the other route, using no lock

but

hide the field with visual effect dissolve very fast
 wait 500 millisecond with messages

# user see background graphic
# we put empty into the field
# run the new data in and typeset it.

show the field with visual effect dissolve very fast

shows the data from the previous incarnation of the field, before it was emptied. Almost as if it were cached;  until you "touch" it. Then "blink" the text updates.

I don't have time to build a sample test stack at the moment, but looks like a bug to me.

BR


 

On 7/6/17, 8:39 AM, "use-livecode on behalf of J. Landman Gay via use-livecode" <[hidden email] on behalf of [hidden email]> wrote:

    I've hit a similar, but not identical, issue and have been planning to
    submit a bug report but it's been tricky to extract example code from my
    full project so I haven't got to it yet.
   
    There seems to be an issue with nested lockscreens if one of the locks
    uses a visual effect. My guess is that the one with a visual effect
    seems to corrupt or override the lock count.
   
    The workaround in my current project is to make sure there is only one
    set of lock/unlock commands, the one with the visual effect. Apparently
    that didn't work for you.
   
    My stack doesn't use "show/hide with visual effect" though. Instead I
    "lock screen for visual effect" and then later "unlock screen with
    visual effect." Maybe separating out the command that way would work better.

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Loading...