Pass
Posted: Mon Aug 13, 2012 7:53 pm
I have a chunk of code that is causing problems. I am trying to change an image size that is somehow involved in a Group and is involved with "Pass".
I set everything up in on PreOpenCard and then it UNDOES what I did when it calls pass preOpenCard. The line above the problem point says something about "Pass preOpenCard so the navigation background group receives it and lays itself out" - but I don't know how to access navigation background group to see why it is undoing what I set up in preOpenCard. Passing from PreOPenCard to PreOpenCard seems like a perpetual loop - I just don't get it.
Here is the code:
on preopencard
## Ensure the card is laid out correctly
layoutCard put empty into field "description"
## Populate the fields
put empty into field "title"
## Check which task we want to edit
## using the custom property set on this card when we selected a task from the list
put the cTaskID of me into tTaskID
## Get the current details of the task
put taskDetail(tTaskID, "title") into tTitle
put taskDetail(tTaskID, "description") into tDescription
put taskDetail(tTaskID, "completed") into tCompleted
## And display then in the relevant fields
put tTitle into field "title"
put tDescription into field "description"
## Set the icons of the completed button to allow you to toggle the state
if tCompleted then
set the icon of button "completed" to 1029
set the hiliteIcon of button "completed" to 1028
else
set the icon of button "completed" to 1015
set the hiliteIcon of button "completed" to 1014
end if
## Pass preOpenCard so the navigation background group receives it and lays itself out
pass preOpenCard
end preopencard
I set everything up in on PreOpenCard and then it UNDOES what I did when it calls pass preOpenCard. The line above the problem point says something about "Pass preOpenCard so the navigation background group receives it and lays itself out" - but I don't know how to access navigation background group to see why it is undoing what I set up in preOpenCard. Passing from PreOPenCard to PreOpenCard seems like a perpetual loop - I just don't get it.
Here is the code:
on preopencard
## Ensure the card is laid out correctly
layoutCard put empty into field "description"
## Populate the fields
put empty into field "title"
## Check which task we want to edit
## using the custom property set on this card when we selected a task from the list
put the cTaskID of me into tTaskID
## Get the current details of the task
put taskDetail(tTaskID, "title") into tTitle
put taskDetail(tTaskID, "description") into tDescription
put taskDetail(tTaskID, "completed") into tCompleted
## And display then in the relevant fields
put tTitle into field "title"
put tDescription into field "description"
## Set the icons of the completed button to allow you to toggle the state
if tCompleted then
set the icon of button "completed" to 1029
set the hiliteIcon of button "completed" to 1028
else
set the icon of button "completed" to 1015
set the hiliteIcon of button "completed" to 1014
end if
## Pass preOpenCard so the navigation background group receives it and lays itself out
pass preOpenCard
end preopencard