Page 1 of 1
scroller staying despite delete?
Posted: Tue Mar 22, 2011 8:21 am
by witeowl
I believe that I'm supposed to use
iphoneControlDelete sScrollerId (that's the variable I'm using to store the result of iphoneControlCreate) to get rid of the scroller when changing cards, but it doesn't seem to be working. I go to the next card, and although it has no effect, the little scroller along the side will show up on attempted swipes, sized to what it was on the previous card.
I have it in the closeCard handler, and the other commands in the handler are working.
The only way the little fake scroller goes away is when opening a card with a datagrid small enough that it's not needed. It will then stay away on subsequent card openings.
Help

Re: scroller staying despite delete?
Posted: Tue Mar 22, 2011 8:31 am
by witeowl
Now that I ask this, I was thinking of a work-around, and began to wonder whether I should just go ahead and let it stay, resizing it as needed (and using a global variable to store the control ID). That almost sounds better than creating it and deleting it on each card that needs it. Am I way off with this thinking?
Re: scroller staying despite delete?
Posted: Tue Mar 22, 2011 10:09 am
by bn
Hi witeowl,
did you declare a script local variable? That is a variable that is declared outside of any handler ususally at the top of a script. It can then be accessed from any handler in that script.
Code: Select all
local sScrollerID
on opencard
-- any code here
end opencard
on closecard
iphoneControlDelete sScrollerId
end closecard
if you dont declare the script local variable and try to use it in the closecard handler it will not work.
Whether to delete a scroller when leaving the card or not depends on your app. I prefer to do it because it is easier to maintain.
Kind regards
Re: scroller staying despite delete?
Posted: Wed Mar 23, 2011 1:30 am
by witeowl
No, I'm a dork. I got so used to using just temporary and global variables in this project that I forgot to call the local variable outside of a handler. Duh, and thanks.