I wrote this code to do two things when you click on a button - it adds a tag and closes the sidebar
<$fieldmangler>
<$button>
<$action-setfield $tiddler="$:/state/sidebar"
text ="no" />
<$action-sendmessage $message="tm-add-tag" $param="wow"/>
Add tag `wow` and collapse the sidebar
</$button>
</$fieldmangler>
It works fine - but when I wrote it felt strange.
I looked for but could not find an action-sendmessage that sets the field of a tiddler
I'd kind of expected to find
something like
<$action-sendmessage $message="tm-set-field" $tiddler="$:/state/sidebar" text="no" />
Which would make the body the button easier
to understand.
My mental model of a button is something
that when you press it sends messages to different parts of the system, causing things to happen.
Can't everything be done with messages?
Cheers
/Joe