Group Abstract Group Abstract

Message Boards Message Boards

1
|
7.8K Views
|
4 Replies
|
6 Total Likes
View groups...
Share
Share this post:

[Solved] A Button to affect a value in a list?

Posted 5 years ago
POSTED BY: Andrew Burnett
4 Replies
Posted 5 years ago
POSTED BY: Andrew Burnett
POSTED BY: Martijn Froeling

I was looking for a simple way to manually reorder images - this is exactly what I needed! Many thanks for sharing!

POSTED BY: Henrik Schachner
Posted 5 years ago

Andrew:

I do not have time to validate my idea, but I think you can do what you want by identifying the "self" through the action parameter to Button[].

The documentation gives an example of using Print[10!] as the value for action. You should be call different functions, or the same function with different parameters that identify the song.

If you want to programmatically generate the Buttons, then you call use ToExpression[] with the action. ToExpression[] takes a string (that you can generate with the song title).

Something like:

doIt[song_String] := ToExpression[Print[song]];
Button["do it", ToExpression["Print[\"title\"]"]]

Good luck, and have a great week.

POSTED BY: Mike Besso
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard