[SOLVED] Creating and destroying cards/controls dynamically
Posted: Fri Jul 10, 2020 11:25 pm
I just learned how to create a new card while my app is running by using "new card". Simple.
I also created a new button on that card but it's properties are not necessarily as easy. In the Property Inspector, in the Size and Position tab, there is a button for "Fit Content". What is the syntax for the different styles and for the "Fit Content" to handle this in script? Better yet, you can point me to a LC lesson or other materials that would help because it isn't just buttons that I want to create on the go.
Although I wrote this code, I don't understand why the new button is not being created on the card that I am currently on but rather it is created on the newly created card. That is what I wanted but I don't understand the "why".
Oh yes, where is the best place to put code (and what would the code be?) for deleting the newly made card when I want to leave that card? I did find "deleteCard" in the Dictionary.
How do I set script for a newly created button on a newly created card?
Again, if you want to point me to a document that deals with this, it is OK.
Thank you,
Linda
I also created a new button on that card but it's properties are not necessarily as easy. In the Property Inspector, in the Size and Position tab, there is a button for "Fit Content". What is the syntax for the different styles and for the "Fit Content" to handle this in script? Better yet, you can point me to a LC lesson or other materials that would help because it isn't just buttons that I want to create on the go.
Although I wrote this code, I don't understand why the new button is not being created on the card that I am currently on but rather it is created on the newly created card. That is what I wanted but I don't understand the "why".
Code: Select all
on mouseUp
new card "theNewCard"
new button "theNewbutton"
go to card "theNewCard"
end mouseUp
How do I set script for a newly created button on a newly created card?
Again, if you want to point me to a document that deals with this, it is OK.
Thank you,
Linda