Tobias,

Your first example seems like it would require some sort of type checking, 
I have no idea how you would achieve that or if it is really possible.

For the second part I think that you could get that functionality with 
something like the reveal widget that is able to send widget messages based 
on the reveal state. In your example, if I understand correctly, you would 
take the input and immediately send a widget message to set a state field, 
then the if/else statements would act similarly to the reveal widget based 
on this field. The problem is that this sort of message that isn't tied to 
an event like a button press may get sent many times as the wiki refreshes 
and could be sending conflicting messages.

If this makes any sense:

\define macro(foo)
<$action-setfield field='stateField' value=$foo$/>
<$if state='stateField' type='match' value='bar'>
do this
</$if>
<$if state='stateField' type='nomatch' value='bar'>
    <$if state='stateField' type='match' value='baz'>
        do this other thing
    </$if>
    <$if state='stateField' type='nomatch' value='baz'>
       do yet another thing
    </$if>
</$if>

To get a real if/else sort of widget that fits with the current wikitext 
syntax I think you would need something like:

<$ifelse state=<<someState>> condition=<<someCondition>> 
match=<<macroToCallIfMatched>> nomatch=<<macroToCallIfNotMatched>>/>

The problem with both of those is that unless there is a way to allow 
widget messages or something similar without a triggering event I don't 
think they can be done. And allowing messages without a triggering event 
may break everything. Like having a select widget that sets a field, and a 
button that sets the field to a value that isn't allowed by the select 
widget. If you have some function that depends on the state of the select 
widget pressing the button will just break it. And if you allow the field 
to be set without the button or select widget than the two will both try to 
edit the same thing simultaneously.

If in your second example you disallow content that would violate this than 
you are left with something identical to using nested reveal widgets.

I would like to find a way around this, but because the wiki may be 
re-rendered unpredictably I don't think that you could define consistent 
behaviour in these cases.

-- 
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 http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.

Reply via email to