So, of course that I know this project is read only, but usually, pressing an arrow key (or fn-down arrow) is not rejected (do not have to issue this information message.
I am allowed to copy a piece of code, but only if I select it with the Mouse… (with the ending quote that I do not needed)…
The reason file access is checked “all over the place” is that projects can have files in them from multiple sources. If it didn’t check, a user could have the impression that making changes to a read-only item was going to work but the changes wouldn’t be saved to disk. Then you’d be really mad.
I would hope that it would check the save actually happened when you went to save it and it would let you know if it succeeded or not. It seems really odd to me that it’s checking hundreds/thousands of times before the actual save takes place on the off chance that something changed to read only and not “they have hit save, lets do the check now and let them know what happened”.
I have the same issue with Excel. If I get a workbook that’s set to read only, I can’t so much as select a cell value to put it on the clipboard to paste it into some other app. Even if I don’t change it. And of late the restrictions have gotten worse: I can’t use the arrow keys to navigate around, I have to use the mouse to scroll. I’m guessing that someone found a way to alter something indirectly with arrow keys so they just block those now.
In some cases It think it is just a lot more work to allow the user to do things that might potentially edit text, than to just keep them from touching it at all.
I agree with the OP, though; my expectation with read only is just that I can’t save any changes; I tend to think of things in terms of preserving the underlying file. I suppose that most users expect the document to mimic the read only state of the file or something. And admittedly, if you forget what you’re working on and have a sudden inspiration and start making a bunch of changes and THEN find out you’re working on the wrong copy, that could be occasion for weeping, wailing and gnashing of teeth.
There’s plenty of ways to lock down an Excel sheet and some of them are in there to purposefully restrict access to things. But things get a bit odd when you can’t even right click and copy of a block of code without saving the project to another location because of an overzealous decision to protect the user from an error message when they come to save their project.
I don’t think that’s the case with Xojo though as I believe the entire project is in memory as you can quite happily delete the “read-only” file in question without it batting an eyelid which ironically stops the error from showing.
As a thought experiment I just created an external Module, made it read only in windows then added all sorts of things to the navigator, methods etc., renamed methods, added parameters etc. All this time I received no errors about it being read only, hit save and nothing was saved, no errors were shown and all that work was lost when I loaded things back in. If I was doing all this for real, this would make me really mad. Only when I went to add some code was I stopped from typing but with no error message.
This is why there should be a single point of warning, on the save, to ensure that things like this aren’t missed and I suspect it would clean up a whole lot of duplicate code and make sure that things added/changed in he future aren’t missed like I’ve shown above.
As you now understand, this was running MacOS (Ventura).
To complete your second paragraph, once you get the Locked message on the save attempt, it will be time to use Save As… (if available) to not lost your changes.
It is in the error message (MacOS)
Unfortunately, I also lost code for multiple reasons (do not save the changes, lost the file, format the hard disk, etc.) and I an sure I am not alone on this ship.
IIRC It would have had to be read-only when it was added to the navigator. Either as an import or when you first opened the project. It doesn’t hit the disk every time to check.
It hits the disk every time a key is pressed in the code editor as that accurately tracks the status of the file when its an external module.
I made sure the external was read only before I added it to the project, it still allowed me to make plenty of changes that ultimately went unsaved. I also checked how it behaved when it was created then set to read only, again, plenty of changes could be made that went unsaved. All these things are protected when the main project is read only, I assume that these have all been overlooked for externals because there are so many places to check some will eventually be missed.
When you say “nothing was saved” do you mean that the Save appeared to complete as normal, with no apparent problem?
If so then this seems to me to be a bug. It should be possible to have a template, make it read only, but then be able to use it as or include it in a project, and then be saveable. If using it as the basis for a project, then Save As … would need to be used. If included as part of an existing project, this should later save with no issues.
Yes, I was able to make changes to a read only external which dirtied the project and the changes to the external weren’t saved when the project was saved and reloaded.