Need to get some guide on how to populate the combo menu like in Visual Basic.
Is there an additem function?
Populating combo menu
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Populating combo menu
Hi,
Kind regards,
Mark
Code: Select all
put "one" & cr & "two' & cr & "three" into btn "Your Combo Menu"
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Re: Populating combo menu
is there a way to populate a menu combo button with variables? For instance....
on mouseUp
local vSomething
put vSomething after btn "MenuCombo"
end mouseUp
Every time I try this bit of code, it wants to replace the previous entry with the new one. I would like to be able to populate a menu with as many items as the user chooses...is this possible without saving entries into a database and THEN populating the button?
on mouseUp
local vSomething
put vSomething after btn "MenuCombo"
end mouseUp
Every time I try this bit of code, it wants to replace the previous entry with the new one. I would like to be able to populate a menu with as many items as the user chooses...is this possible without saving entries into a database and THEN populating the button?
Re: Populating combo menu
Hi,
Your script won't replace the "previous entry". Can you explain more?
Kind regards,
Mark
Your script won't replace the "previous entry". Can you explain more?
Kind regards,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Re: Populating combo menu
Hi Mark,
I have been working on a program for the past few months and am about to wrap it up. One section of the program has a card that allows the user to enter a persons name with the "ask "Please enter a name" " command. The variable "it" is then placed as the label of a option menu button. The user then has the option of saving the name into the option menu. I accomplish this by scripting a "save" button that puts the label of the option menu button into a variable called vName. I am trying to take vName and place it into the option menu for later use. It will place the variable in the menu, but the very next time I save another variable into the menu it gets replaced by the new entry. Previously, I had been accomplishing this by saving the name into a SQLite database then populating the button when the card opens. This seems to work fine, but I get some weird characters at the end of the name when the button is populated. Here is a link to what has been giving me problems... http://forums.runrev.com/phpBB2/viewtop ... 12&t=11210 I was sitting here last night thinking about my problem when it occurred to me that I could just fill a option menu with user defined variables instead of saving it in a database, then save the button when the card closes. I am going to look back over my code this morning over a cup of coffee and see what I am doing wrong...any input on your part would be greatly appreciated!
Thanks again Mark!
EDIT* I am an idiot!
I figured out what the issue was....I was taking "it" from the ask dialog and putting it INTO the option menu....it kept replacing the last entry...I would still like your input on the link I posted if you get a chance....Nothing like a fresh mind and a strong cup of coffee to fix a coding problem!
I have been working on a program for the past few months and am about to wrap it up. One section of the program has a card that allows the user to enter a persons name with the "ask "Please enter a name" " command. The variable "it" is then placed as the label of a option menu button. The user then has the option of saving the name into the option menu. I accomplish this by scripting a "save" button that puts the label of the option menu button into a variable called vName. I am trying to take vName and place it into the option menu for later use. It will place the variable in the menu, but the very next time I save another variable into the menu it gets replaced by the new entry. Previously, I had been accomplishing this by saving the name into a SQLite database then populating the button when the card opens. This seems to work fine, but I get some weird characters at the end of the name when the button is populated. Here is a link to what has been giving me problems... http://forums.runrev.com/phpBB2/viewtop ... 12&t=11210 I was sitting here last night thinking about my problem when it occurred to me that I could just fill a option menu with user defined variables instead of saving it in a database, then save the button when the card closes. I am going to look back over my code this morning over a cup of coffee and see what I am doing wrong...any input on your part would be greatly appreciated!
Thanks again Mark!
EDIT* I am an idiot!
I figured out what the issue was....I was taking "it" from the ask dialog and putting it INTO the option menu....it kept replacing the last entry...I would still like your input on the link I posted if you get a chance....Nothing like a fresh mind and a strong cup of coffee to fix a coding problem!