ID:670029
 
Applies to:Dream Seeker
Status: Open

Issue hasn't been assigned a status value.
Ternary expressions used in .winset are currently very useful for simple things. For instance, if you would like to toggle the visibility of a window, you would do this.

.winset "window.is-visible=true ? window.is-visible=false : window.is-visible=true"

But what would you do if you wanted to toggle the visibility of a window, but only if another window is visible? I would expect to do this.

.winset "window2.is-visible=true ? window1.is-visible=true ? window.is-visible=false : window.is-visible=true"

This, though, does not work, and attempting to use nested ternaries can lead to unexpected results. In order to actually achieve this, you would have to use .winset to send a command verb to the server. That verb would have to winget() the windows' visibility, evaluate the same if-if-else expression, and then winset() the results. As you can see, this is not very intuitive.

I request that nested ternaries be supported for .winset, so that complex expressions can easily be evaluated client-side, without the need for a four-way trip.
The syntax here is wrong for a ternary; you have three ? operators and only one : operator. A ternary expression requires that each ? have a matching : and vice-versa.
From the Skin Reference:
The choice2 item is optional.
.winset "bigbutton.is-checked=true ? window.background-color=#ff0000"

Besides, there are only two ?s and it doesn't work even when you do use the optional choice.
Did you not read my post? A) The skin reference says otherwise. B) It works without. C) Nesting doesn't work at any rate. Lummox and I had this discussion (not here) in full, a long time ago.