Page 1 of 1
Populate buttons onMouseclick
Posted: Sun Jan 12, 2014 1:40 pm
by ace
Please help. . .
i want to populate buttons when a certain button is clicked and automatically set their size and location.
Re: Populate buttons onMouseclick
Posted: Sun Jan 12, 2014 2:11 pm
by Klaus
Hi ace,
could please answer your other thread (slider zoom inout in case you are still interested?
ace wrote:i want to populate buttons...
If you mean MENUS (popup, option etc...) then this script will create a three line menu in that button:
line 1
line 2
line 3
Code: Select all
...
set the text of btn "the one you want to populate..." to "line 1" & CR & "line 2" & CR & "line 3"
...
ace wrote:... when a certain button is clicked...
Code: Select all
on mouseup
## do this and that
end mouseup
ace wrote:... automatically set their size and location.
Code: Select all
...
set the WIDTH of btn "xyz" to 100
set the HEIGHT of btn "xyz" to 80
## or directly set the complete RECT:
## set the RECT of btn "xyz" to 10,10,200,180
set the LOC of btn "xyz" to 500,478
## LOC = abbr. location
...
You really should take a look at these stacks to get the basics of Livecode:
http://www.hyperactivesw.com/revscriptc ... ences.html
Best
Klaus
Re: Populate buttons onMouseclick
Posted: Tue Jan 14, 2014 6:37 am
by ace
Thanks Sir. That's very helpful
But what i mean is, when a button is .clicked, it will automatically populate new buttons and set their location.
Re: Populate buttons onMouseclick
Posted: Tue Jan 14, 2014 12:52 pm
by Klaus
Hi ace,
ace wrote:Thanks Sir. That's very helpful
But what i mean is, when a button is .clicked, it will automatically populate new buttons and set their location.
Well, that is exactly what I wrote!? However only for ONE button!
Could you please explain what you mean and show your efforts in this respect so far?
Best
Klaus
Re: Populate buttons onMouseclick
Posted: Wed Jan 15, 2014 10:30 am
by doobox
Could you mean "create" new buttons and set there size and location..?
If so in the button script :
Code: Select all
on mouseUp
repeat with x = 1 to 3
create button ("newButton" & x)
set the width of button ("newButton" & x) to 75
set the height of button ("newButton" & x) to 40
put x & 00 into tYloc
set the loc of button ("newButton" & x) to 100,tYloc
end repeat
end mouseUp
This would create 3 new buttons and set there locations in a vertical column.