Hi Mark,

now it works :-) And: It works and looks fantastic- that was exactly my 
dream :-)

Why I wrote it like before: I thought The <$fieldmangler 
tiddler="$style1$"> means, that I have to title the Stylesheet-tiddlers 
like that.
Surya



On Thursday, October 10, 2019 at 4:24:46 AM UTC+2, Mark S. wrote:
>
> Never mind. I just read to the bottom of your code. When you invoke the 
> macro, you need to specify your two stylesheets. Like
>
> <<swapper "MyFavoriteStyleSheet" "MyNotFavoriteStyleSheet">>
>
> In your example, you're trying to invoke the variables $style1$ and 
> $style2$. I don't understand that.
>
> Good luck!
>
>
> On Wednesday, October 9, 2019 at 7:22:44 PM UTC-7, Mark S. wrote:
>>
>> May I see how you are invoking your style changes?
>>
>> Also, is there anything in your stylesheets that might hide a button? So 
>> that when
>> you change the style, you also hide the button that will bring it back?
>>
>> It might help if you post your stylesheets.
>>
>> Good luck!
>>
>> On Wednesday, October 9, 2019 at 5:58:50 PM UTC-7, Surya wrote:
>>>
>>> Funny,
>>> just 3 days before asked the same question...
>>>
>>> That's exactly what I am looking for :-)
>>> I tried it: When I click the button it switches the style :-)
>>> But then the button is not visible anymore.
>>> I tried it on my wiki but also on an empty wiki (Version 5.1.21), 
>>> freshly downloaded.
>>>
>>> The code:
>>> \define SwapActiveStyle(style1,style2)
>>> <$fieldmangler tiddler="$style1$">
>>> <$action-sendmessage $message="tm-add-tag" $param="$:/tags/Stylesheet"/>
>>> </$fieldmangler>
>>> <$fieldmangler tiddler="$style2$">
>>> <$action-sendmessage $message="tm-remove-tag" $param="$:/tags/Stylesheet
>>> "/>
>>> </$fieldmangler>
>>> \end
>>>
>>> \define swapper(style1,style2)
>>> <$vars sheet="$:/tags/Stylesheet">
>>> <$list filter="[[$style1$]tag<sheet>]">
>>> <$button><$text text="""<"""/>
>>> <<SwapActiveStyle """$style2$""" """$style1$""">>
>>> </$button>
>>> </$list>
>>> <$list filter="[[$style2$]tag<sheet>]">
>>> <$button><$text text=""">"""/>
>>> <<SwapActiveStyle """$style1$""" """$style2$""">>
>>> </$button>
>>> </$list>
>>> </$vars>
>>> \end
>>>
>>> <<swapper $style1$ $style2$>>
>>>
>>> Why does it disappear, what am I doing wrong?
>>> Thanks for your help!
>>> Surya
>>>
>>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/16cd76a5-993f-424e-b870-50f19d539ec8%40googlegroups.com.

Reply via email to