Dave,

Using a field as the state field, as opposed to the tags allows you to do 
this for a two value check

<$checkbox field="selected" checked="a" unchecked ="b"> A?</$checkbox>
<$checkbox field="selected" checked="b" unchecked ="a"> B?</$checkbox>

You do not need two values 0 and 1 and 0 and 1 if they are intimately 
linked  such as "1 and 0" OR "0 and 1"

Or 

<$checkbox field="selected" checked="left" unchecked ="right"> 
Left?</$checkbox>
<$checkbox field="selected" checked="right" unchecked ="left"> 
Right?</$checkbox>

this kind of logical selection is is often referred to as "radio buttons".

So see this https://tiddlywiki.com/#RadioWidget

Also with left and right being the choice you could use the range widget, 
in this case with a neither left or 
right https://tiddlywiki.com/#RangeWidget

<$range field="lorr" min="-1" max="1" default="0" increment="1"/> {{!!lorr}}

There are many ways to do this.

Regards
Tony







On Monday, June 25, 2018 at 1:55:43 PM UTC+10, Dave wrote:
>
> I'm trying to make a macro that presents a pair of checkboxes like this: 
> R[[_]] [[_]]L.
>
> I can get the checkboxes to assign 1 for checked and 0 for unchecked, but 
> I'd like to be able to cause the Right checkbox to automatically uncheck 
> when the Left one checks and vice versa.
>
> Here's what I have that's not working:
>
> \define nullr(testname)
> <$action-setfield $tiddler=<<currentTiddler>> $field="$testname$.right" 
> $value="0" />
> \end
> \define nulll(testname)
> <$action-setfield $tiddler=<<currentTiddler>> $field="$testname$.left" 
> $value="0" />
> \end
>
>
> \define rorlcheck(testname)
> R<$checkbox tiddler="""$(currentTiddler)$""" field="$testname$.right" 
> checked="1" unchecked="0" actions="<<nulll '$testname$'>>" >L<$checkbox 
> tiddler="""$(currentTiddler)$""" field="$testname$.left"  checked="1" 
> unchecked="0" actions="<<nullr '$testname$'>>">
> \end
>
> <<rorlcheck test>>
>
>
> Can anyone tell me how to make this work?
>
> Thank you,
> Dave
>
>
> P.S. I've also tried it with """$(currentTiddler)$""" in the null macros
>

-- 
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 post to this group, send email to [email protected].
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/7cd34ce9-ad0a-40a8-8c5a-6fbd260eddcf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to