Thanks to Shane and Mark I do see a some light on the horizon with my little test app.
As I explained before in other questions the app somehow should process video subtitle files.
The nature of these cue text things is that the text is displayed against a black (or grey) background. Text color default is white, but yellow, cyan sometimes purple are used as well depending on the type of cues.
So the background of the table view is black, some text cells might have a dark color other than black.
As long as no row is selected everything is fine. Once a row is selected it will get blue ( or the settings of the system). That’s something people might be able to live with.
But when the table view is “out of focus” the row turns into “light grey” and everything is not readable anymore.
Same with text selection.
Is there a way to change the “high-lighting” of a row into something like a “focus ring”?
One of the suggestions I found most useful when starting with Xcode was to always look for examples of what I wanted. If I couldn’t find them, there’s a fair chance I was doing something either impossible or discouraged (“fighting the frameworks”). It’s not always the case, but it’s worth considering. How many all-dark-background tables do you see?
That said, you may do better to make a single-column view-based table. That way you put all info as text fields on a view, and it gives you a lot more flexibility in terms of layout.
The upper black region displays the “real” text. The text in the table might be wrapped. Means you have a long text line and it looks good in the table cell cause it is wrapped but would be too long in real life usage. This is a “text view” to have a coloured insertion point.
The values per row are times for the text: in, out, duration and distance in frames to the previous text cue. The text itself followed by the count of characters of the longest line of the text and the reading speed in “characters per second”.
So changing the text will/can change both the “max characters” and/or the “CPS” value.
I haven’t found a way yet to update values automatically or get a warning when the row changes.
It worked fine in ASS to compare row changes before switching to the next row.
I could use a text field, but only get a black insertion point.
Changing times will affect “CPS” as well but can handled easily I think.
If you expand the table hierarchy for a single-column table, it looks like this:
The highlighted item is a view (NSTableCellView) which you can actually drag out to make as big as you want, and you can add text fields, image views, etc to it. By default is has just one text field, confusingly labeled Table View Cell in the above.
Once you have added the views you want, you set up their bindings. So the binding for standard text field might look like this:
It always starts with objectValue., and you add the key for the particular item you want inserted.
(You can ignore the Text Cell item — that’s for cell-based tables only.)