Deleting contents inside a scroller and contents shift accordingly [Solved]

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
EddieLee
Posts: 118
Joined: Thu Oct 25, 2018 1:06 pm

Deleting contents inside a scroller and contents shift accordingly [Solved]

Post by EddieLee » Fri Sep 11, 2020 4:26 am

Hi all,

Grp 1
Grp 2
Grp 3
Grp 4

Imagine these 4 grps are placed vertically on a card inside a scroller. What will be the best way that when a user deletes grp 1, grp 2,3,4 will move up. Delete grp 2, grp 3,4 will move up.
Assuming all the grp contains img, flds and widget.
Thanks !
Last edited by EddieLee on Fri Sep 11, 2020 3:16 pm, edited 2 times in total.
Eddie :D

kdjanz
Posts: 300
Joined: Fri Dec 09, 2011 12:12 pm
Location: Fort Saskatchewan, AB Canada

Re: Deleting contents inside a scroller and contents shift accordingly

Post by kdjanz » Fri Sep 11, 2020 5:10 am

Use a field with List behaviour?

EddieLee
Posts: 118
Joined: Thu Oct 25, 2018 1:06 pm

Re: Deleting contents inside a scroller and contents shift accordingly

Post by EddieLee » Fri Sep 11, 2020 5:36 am

kdjanz wrote:
Fri Sep 11, 2020 5:10 am
Use a field with List behaviour?
Hi,

What do you mean?
Eddie :D

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9648
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Deleting contents inside a scroller and contents shift accordingly

Post by dunbarx » Fri Sep 11, 2020 1:58 pm

Hi.

Not sure how this goes down in mobile, since I do not develop for it, but back in good ol' LC (pseudo):

Code: Select all

on mouseUp
   repeat with y = 4 down to 2
      set the top of grp y to the top of grp (y-1)
   end repeat
   delete grp 1
end mouseUp
Craig

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”