Please help. . .
i want to populate buttons when a certain button is clicked and automatically set their size and location.
Populate buttons onMouseclick
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: Populate buttons onMouseclick
Hi ace,
could please answer your other thread (slider zoom inout in case you are still interested?
line 1
line 2
line 3
You really should take a look at these stacks to get the basics of Livecode:
http://www.hyperactivesw.com/revscriptc ... ences.html
Best
Klaus
could please answer your other thread (slider zoom inout in case you are still interested?
If you mean MENUS (popup, option etc...) then this script will create a three line menu in that button:ace wrote:i want to populate buttons...
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
...
http://www.hyperactivesw.com/revscriptc ... ences.html
Best
Klaus
Re: Populate buttons onMouseclick
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.
But what i mean is, when a button is .clicked, it will automatically populate new buttons and set their location.
Re: Populate buttons onMouseclick
Hi ace,
Could you please explain what you mean and show your efforts in this respect so far?
Best
Klaus
Well, that is exactly what I wrote!? However only for ONE button!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.
Could you please explain what you mean and show your efforts in this respect so far?
Best
Klaus
Re: Populate buttons onMouseclick
Could you mean "create" new buttons and set there size and location..?
If so in the button script :
This would create 3 new buttons and set there locations in a vertical column.
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.
Kind Regards
Gary
https://www.doobox.co.uk
Gary
https://www.doobox.co.uk