Tech projects, hobby programming, and geeky thoughts of Paolo Amoroso

Overriding card editing with a no-op in WebCard

I wrote some throwaway code to experiment with editing cards of type Web in WebCard, my RetroChallenge 2024 project. The goal is to make the card read only with the least amount of effort.

In a NoteCards hypertext a Web card is a stand-in for a website, a placeholder for a URL that gets visited when links leading to the card are clicked. The Web card type inherits from the Text type but, since the user isn't supposed to enter text into a Web card, the card should be read only.

An approach I tried is to override the card editing operation for the Web type. The overridden function was a no-op that did nothing and immediately returned, as I thought not calling the TEdit editor would prevent text from being entered or modified.

It turned out the function worked even too well and did nothing at all, really. Like, not even opening or displaying the card.

Back to the drawing board.

A more substantial function would involve additional complexity to interact with TEdit, which would do nothing anyway. An easier approach is to make the content of a Web card read only in the constructor as soon as it's created.

I'm actually also considering to drop the read only requirement and allow editing the content of Web cards. It could be handy to enter a description or note about the website.

#WebCard #Interlisp #Lisp

Discuss...
Email | Reply @amoroso@fosstodon.org