IDE slow to complete following update of controls
Posted: Fri Sep 24, 2021 7:42 am
Hi,
I have a stack that has five cards and each card holds sixty groups each comprises two buttons and a field. I have a helper routine that deletes all these groups and replaces them with copies of a master group held on a sixth card. I call the helper routine from the message box and the update routine runs without error. However, Livecode takes a very long time to hand back control to the IDE and my computer's fans start running during this time. Apple's activity monitor show that Livecode is using 90% cpu during this period.
My guess is that Livecode is taking time to process the deletion and addition of three hundred groups which are some twelve hundred items. Any thoughts ? My handler is below.
Simon
I have a stack that has five cards and each card holds sixty groups each comprises two buttons and a field. I have a helper routine that deletes all these groups and replaces them with copies of a master group held on a sixth card. I call the helper routine from the message box and the update routine runs without error. However, Livecode takes a very long time to hand back control to the IDE and my computer's fans start running during this time. Apple's activity monitor show that Livecode is using 90% cpu during this period.
My guess is that Livecode is taking time to process the deletion and addition of three hundred groups which are some twelve hundred items. Any thoughts ? My handler is below.
Simon
Code: Select all
On IDEUpdateControlsOnTagCards
# Called from the message box when adding new cards
# Used to update the card with an updated control where
# the updated control is DZ-1 held on the ref card
# Used when designing the application not when running
lock screen
Repeat with tcardNo = 1 to 5
put "TagList" & tcardNo into tCardName
put 0 into tCounter
put the the number of groups in card tCardName of me into tTotalGroupCount
repeat with i = tTotalGroupCount down to 1
Delete group i of card tCardName of me
end repeat
put 0 onto tRowNo
put 0 into tColumn
repeat with n = 1 to 60
if n = 1 then
put 1 into tColumn
put 30 onto tLeft
put 0 into tRowNo
else
Switch n
Case 16
add 300 to tLeft
put 0 into tRowNo
break
Case 31
add 300 to tLeft
put 0 into tRowNo
break
Case 46
add 300 to tLeft
put 0 into tRowNo
break
Case 61
add 300 to tLeft
put 0 into tRowNo
break
end Switch
end if
add 1 to tRowNo
put 5 + (tRowNo*46) into tTop -- tRow is the remainder
copy group "DZ-1" of card RefData of me to card tCardName of me
set the name of it to "DZ-" & n
set the left of it to tLeft
set the top of it to tTop
end repeat
Put "1star" into field "tags" of group "DZ-1" of card tCardName of me
Put "2star" into field "tags" of group "DZ-2" of card tCardName of me
Put "3star" into field "tags" of group "DZ-3" of card tCardName of me
Put "4star" into field "tags" of group "DZ-4" of card tCardName of me
Put "5star" into field "tags" of group "DZ-5" of card tCardName of me
Put "Selected" into field "tags" of group "DZ-6" of card tCardName of me
Put "Rejected" into field "tags" of group "DZ-7" of card tCardName of me
Put "Portrait" into field "tags" of group "DZ-8" of card tCardName of me
Put "Model" into field "tags" of group "DZ-9" of card tCardName of me
Put "Landscape" into field "tags" of group "DZ-10" of card tCardName of me
Put "Street" into field "tags" of group "DZ-11" of card tCardName of me
Put "Natural-History" into field "tags" of group "DZ-12" of card tCardName of me
Put "Macro" into field "tags" of group "DZ-13" of card tCardName of me
Put "Print" into field "tags" of group "DZ-14" of card tCardName of me
wait 1 seconds with messages
end Repeat
unlock screen
answer "Complete, all " & tcardNo && "cards have been updated with master control."
end IDEUpdateControlsOnTagCards