Setting the lines of a button to a list...

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
rrBUSS9EE
Posts: 98
Joined: Wed May 02, 2012 3:46 pm

Setting the lines of a button to a list...

Post by rrBUSS9EE » Thu Oct 03, 2013 12:20 am

Hey...

I have a return delimited list of commands I would like to set the lines of a button to. I know I can:

repeat with L=1 to the number of lines of theList
set line L of button 1 to line L of theList
end repeat

But isn't there some property I can just set to the list? Can't seem to find one.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10305
Joined: Wed May 06, 2009 2:28 pm

Re: Setting the lines of a button to a list...

Post by dunbarx » Thu Oct 03, 2013 3:38 am

Hi.

"Lines of a button"

--Do you mean the contents of, say, a pullDown button, so that the list contents becomes the choices of that button?

Code: Select all

put yourList into btn "yourButton"
A button is also a container, the contents of which are read by LC as the choices in a menu-style button.

--Do you mean set the script? The script is a property, and you can:

Code: Select all

set the script of btn "yourButton" to yourList.
Or do you mean something entirely different?

Craig Newman

rrBUSS9EE
Posts: 98
Joined: Wed May 02, 2012 3:46 pm

Re: Setting the lines of a button to a list...

Post by rrBUSS9EE » Thu Oct 03, 2013 5:14 pm

Thanks. The first example is what I was looking for as I am populating the button for a contextual menu.

Post Reply