setting carousel images in code

This is the place to discuss anything relating to MobGUI

Moderators: heatherlaine, kevinmiller, robinmiller, malte, splash21

Post Reply
pthirkell
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 93
Joined: Tue Nov 17, 2009 6:47 pm
Location: Wellington, New Zealand

setting carousel images in code

Post by pthirkell » Mon Mar 17, 2014 11:26 am

Is it possible to add additional images to the carousel using a script, and/or change the image of an existing carousel control image to a new image?

splash21
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 369
Joined: Sun Dec 19, 2010 1:10 am
Location: UK
Contact:

Re: setting carousel images in code

Post by splash21 » Tue Mar 18, 2014 10:32 am

Hi, pthirkell. The mgProps["controls"] of a carousel contains a list in the following format;
control short id , width , height , animated (I've added spaces for readability)

The width and height data are the dimensions to display the control at when it's at the front position.
The animated flag is 0 for stationary and 1 for animated.

You can add / remove controls to / from the carousel group then ..

Code: Select all

send "mgCarouselReset" to group "Carousel"
LiveCode Development & Training : http://splash21.com

pthirkell
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 93
Joined: Tue Nov 17, 2009 6:47 pm
Location: Wellington, New Zealand

Re: setting carousel images in code

Post by pthirkell » Tue Mar 18, 2014 12:02 pm

Very cool thanks. I dug as far as the mgProps["controls"] ... but would never have gotten to the 'send' command to refresh.

Easy when you know how :)

Post Reply

Return to “MobGUI”