Re: [tw] Re: [TW5] Need help writing better macro
Thank you so much for all your help. Here is sort of what I ended up with: \define reveal1(button) <> <$reveal type="match" state="$:/temp/$(currentTiddler)$!!$button$" text="$:/$button$_b"> \end <> Happy Connecting. Sent from my Sprint Samsung Galaxy S® 5 Original message From: PMario <pmari...@gmail.com> Date: 4/20/16 8:30 AM (GMT-07:00) To: TiddlyWiki <tiddlywiki@googlegroups.com> Subject: Re: [tw] Re: [TW5] Need help writing better macro On Wednesday, April 20, 2016 at 2:31:39 PM UTC+2, Andrew wrote: You are right, I really went at this from the wrong angle. Ok, so I would like to have slider or toggle buttons that when clicked, they reveal some text. The problem is that in order to be able to reset all of them with a reset button, I had to store the targets of buttons in fields of a temp tiddler using a global macro. Reset, basically deletes the temp tiddler. I would like to figure out a macro that uses the button name so I can define one button and reveal and then transclude several times and each with the names of the toggle buttons. I'm probably trying to get macro results from within another macro. Not possible right? Let me recap, so I can see if I did understand it. - "Some content" should be shown/hidden with the help of a toggle button - There should be a "reset button" that deletes all state tiddlers - The tiddler content, to modify the states should be relatively easy to read. some questions 1) What do you mean with "some content"? Since TW is highly optimized for tiddlers. As in "the tiddler is the thing" for me "some content" means tiddler content. So it will be easy to transclude. eg: with a macro like this: <> 2) should the state "show/hide" tiddlers be persistent between sessions This is important, since we need to know if we use "state" or "temp" variables 3) Are there any sliders, that need to be open by default This makes a difference for the macro code --- I'm thinking about a maro like this <> produces 2 buttons [show] / [hide] [show] / [hide] replace each other when active possible state tiddler names are: - $:/state/toggleMe/tiddlerName for session persistent tiddlers - $:/temp/toggleMe/tiddlerName for temporary state tiddlers <> will delete all state or temp tiddlers with one click, so all "sliders" are closed There may be "groups of sliders" eg: <> so <> just deletes all states that belong to one group eg: <> uses a state tiddler $:/state/toggleMe/-asdf <> uses a state tiddler $:/state/toggleMe/mario- <> uses a state tiddler $:/state/toggleMe/mario- so <> deletes all states that start with tiddler $:/state/toggleMe/mario I'm testing this idea at the moment. ... The funny thing is, that the code is actually simpler than this description :) feedback needed have fun! mario -- You received this message because you are subscribed to the Google Groups "TiddlyWiki" group. To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+unsubscr...@googlegroups.com. To post to this group, send email to tiddlywiki@googlegroups.com. Visit this group at https://groups.google.com/group/tiddlywiki. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/5e798001-c9bc-4db9-aaf9-6c1f870d0a8e%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "TiddlyWiki" group. To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+unsubscr...@googlegroups.com. To post to this group, send email to tiddlywiki@googlegroups.com. Visit this group at https://groups.google.com/group/tiddlywiki. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/jq56lflh32vb9fqur7drc6m1.1461220367335%40email.android.com. For more options, visit https://groups.google.com/d/optout.
Re: [tw] Re: [TW5] Need help writing better macro
On Wednesday, April 20, 2016 at 2:31:39 PM UTC+2, Andrew wrote: > > You are right, I really went at this from the wrong angle. Ok, so I would > like to have slider or toggle buttons that when clicked, they reveal some > text. The problem is that in order to be able to reset all of them with a > reset button, I had to store the targets of buttons in fields of a temp > tiddler using a global macro. Reset, basically deletes the temp tiddler. I > would like to figure out a macro that uses the button name so I can define > one button and reveal and then transclude several times and each with the > names of the toggle buttons. I'm probably trying to get macro results from > within another macro. Not possible right? > Let me recap, so I can see if I did understand it. - "Some content" should be shown/hidden with the help of a toggle button - There should be a "reset button" that deletes all state tiddlers - The tiddler content, to modify the states should be relatively easy to read. some questions 1) What do you mean with "some content"? Since TW is highly optimized for tiddlers. As in "the tiddler is the thing" for me "some content" means tiddler content. So it will be easy to transclude. eg: with a macro like this: <> 2) should the state "show/hide" tiddlers be persistent between sessions This is important, since we need to know if we use "state" or "temp" variables 3) Are there any sliders, that need to be open by default This makes a difference for the macro code --- I'm thinking about a maro like this <> produces 2 buttons [show] / [hide] [show] / [hide] replace each other when active possible state tiddler names are: - $:/state/toggleMe/tiddlerName for session persistent tiddlers - $:/temp/toggleMe/tiddlerName for temporary state tiddlers <> will delete all state or temp tiddlers with one click, so all "sliders" are closed There may be "groups of sliders" eg: <> so <> just deletes all states that belong to one group eg: <> uses a state tiddler $:/state/toggleMe/-asdf <> uses a state tiddler $:/state/toggleMe/mario- <> uses a state tiddler $:/state/toggleMe/mario- so <> deletes all states that start with tiddler $:/state/toggleMe/mario I'm testing this idea at the moment. ... The funny thing is, that the code is actually simpler than this description :) feedback needed have fun! mario -- You received this message because you are subscribed to the Google Groups "TiddlyWiki" group. To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+unsubscr...@googlegroups.com. To post to this group, send email to tiddlywiki@googlegroups.com. Visit this group at https://groups.google.com/group/tiddlywiki. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/5e798001-c9bc-4db9-aaf9-6c1f870d0a8e%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
RE: [tw] Re: [TW5] Need help writing better macro
You are right, I really went at this from the wrong angle. Ok, so I would like to have slider or toggle buttons that when clicked, they reveal some text. The problem is that in order to be able to reset all of them with a reset button, I had to store the targets of buttons in fields of a temp tiddler using a global macro. Reset, basically deletes the temp tiddler. I would like to figure out a macro that uses the button name so I can define one button and reveal and then transclude several times and each with the names of the toggle buttons. I'm probably trying to get macro results from within another macro. Not possible right? Happy Connecting. Sent from my Sprint Samsung Galaxy S® 5 Original message From: PMario <pmari...@gmail.com> Date: 4/19/16 11:41 PM (GMT-07:00) To: TiddlyWiki <tiddlywiki@googlegroups.com> Subject: [tw] Re: [TW5] Need help writing better macro Hi Andrew, It would be easier, if you describe, what you want to achieve, instead of posting some code and let us reverse engineer it, to find out (guess) what you want. Also if I copy paste the code to tiddlywiki.com it doesn't do anything. -mario -- You received this message because you are subscribed to the Google Groups "TiddlyWiki" group. To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+unsubscr...@googlegroups.com. To post to this group, send email to tiddlywiki@googlegroups.com. Visit this group at https://groups.google.com/group/tiddlywiki. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/db91eb48-5e7c-49fd-93d0-241ceca40369%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "TiddlyWiki" group. To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+unsubscr...@googlegroups.com. To post to this group, send email to tiddlywiki@googlegroups.com. Visit this group at https://groups.google.com/group/tiddlywiki. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/hpnylry2huimt55p7yv468q0.1461135809092%40email.android.com. For more options, visit https://groups.google.com/d/optout.
[tw] Re: [TW5] Need help writing better macro
Hi Andrew, It would be easier, if you describe, what you want to achieve, instead of posting some code and let us reverse engineer it, to find out (guess) what you want. Also if I copy paste the code to tiddlywiki.com it doesn't do anything. -mario -- You received this message because you are subscribed to the Google Groups "TiddlyWiki" group. To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+unsubscr...@googlegroups.com. To post to this group, send email to tiddlywiki@googlegroups.com. Visit this group at https://groups.google.com/group/tiddlywiki. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/db91eb48-5e7c-49fd-93d0-241ceca40369%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.