Unicode Fun with Strike-Through in a ListView

This is a quickie project to demonstrate how to use Unicode to achieve a strike-through effect in a non-HTML context, like in a ListView Element.

Sample run:

sample run
(I stopped adding items at cherries, because I couldn't think of a fruit starting with 'd')

The secret of Unicode strike-through is at

where you can copy the special strike-through suffix character to paste into a text block.

Designer:

This project has a text box and button for insertion into the ListView, and a ListView.

No attempt is made to save and load the list Elements from TinyDB.
I leave that to you.


The Add button click event takes the input text from Text box1 and adds it to the end of the ListView Elements list. I used a local variable to avoid the kind of confusion a global variable might introduce, as to where the master copy of the list belongs.

Selecting an Element of the ListView replaces it with the result of flipping its value (Selection) between strike-through and non-strike-through.


This value procedure takes its input and inserts the special Unicode strike-through suffix character after every character, causing every character to appear struck through. The split is at the empty string, resulting in a list of all the characters in the input, one by one.


The reversal procedure tests if its input is already struck through (has the strike-through anywhere in it.) If it contains a strike-through character, it replaces them all with empty text. Otherwise, it applies the strike-through procedure.

Unicode_strikethrough.aia (3.0 KB)

2 Likes

You could have used the durian. :wink:

1 Like

This would be good as an extension if someone could program it. It could be free-extension

extension not needed

Yeah but it could be useful as one.

What value would be added by doing it as an extension?

The call would look the same, but now you would have lost access to the source and you would have lost the ability to use it on iOS.

I just thought that having it as an extension as well might help simplify the process, I am not saying that you would remove this bit of neat code (Good job @ABG ) But it might make it simpler, easier to implement, and better for beginners.

Anyone could simply drag the blocks into workspace. Why is that complicated?

I think I failed at fluffing up this sample with introductory notes on how to create it step by step, for beginners at procedures and lists.

I have attracted the wrong target audience for my intention.