TW5: set button font by same button?

43 views
Skip to first unread message

Dave

unread,
Mar 12, 2017, 5:49:32 PM3/12/17
to tiddl...@googlegroups.com
I have this table and buttons:

\define ips.opp()
<$set name="ips" value={{!!f1}}><$set name="opp" value={{!!f2}}>
<table>
<tr style="font-weight:<<ips>>"><td style="text-align:center"><$button><$action-setfield  $field="side" $value="ips"/><$action-setfield $field="f1" $value="bold" /><$action-setfield  $field="f2" $value="normal" />ips</$button></td></tr>
<tr style="font-weight:<<opp>>"><td style="text-align:center"><$button><$action-setfield $field="side" $value="opp" /><$action-setfield $field="f1" $value="normal" /><$action-setfield $field="f2" $value="bold" />opp</$button></td></tr></table>
<<ips>>,<<opp>>
\end

|<<ips.opp>>|

its basically got 2 buttons "ips" and "opp", and the primary function is to set a field "side" to either "ips" or  "opp", and that works fine.

What I also want to do is have the font on the button go bold once its pressed.  The f1 and f2 fields are being set properly as are the variables "ips" and "opp", so I don't know why this won't work (the font just stays normal the whole time).


Any ideas?

thanks,
- Dave



FrD

unread,
Mar 12, 2017, 6:38:09 PM3/12/17
to TiddlyWiki
Hi Dave,

Try this :

\define ips.opp()
<$wikify name="ips" text=font-weight:{{!!f1}}><$wikify name="opp" text=font-weight:{{!!f2}}>
<table>
<tr style=<<ips>>><td style="text-align:center"><$button><$action-setfield  $field="side" $value="ips"/><$action-setfield $field="f1" $value="bold;" /><$action-setfield  $field="f2" $value="normal;" />ips</$button></td></tr>
<tr style=<<opp>>><td style="text-align:center"><$button><$action-setfield $field="side" $value="opp" /><$action-setfield $field="f1" $value="normal;" /><$action-setfield $field="f2" $value="bold;" />opp</$button></td></tr></table>
<<ips>>,<<opp>>
</$wikify></$wikify>
\end

|<<ips.opp>>|



Regards

FrD

Dave

unread,
Mar 12, 2017, 11:02:26 PM3/12/17
to TiddlyWiki
Oh, so <$wikify> is kind of like <$set> (but better, ha ha).  Cool.

Thank you! :)
Reply all
Reply to author
Forward
0 new messages