Hopefully someone can provide some insight

I’m not expecting a “solution”, but perhaps a comment that might make me go “AHA!”

So let me see if I can explain this clearly enough.
I have created an Attribute Inspector in Swift (similar to the one in the Xojo IDE).
This consists of

  • NSScrollView -> NSTableView -> NSTableCellView

The NSTableCellView has various controls (textfield, segCtrl, etc). If you have downloaded the proof of concept of “my replacement” you know what I mean :slight_smile:

There are TWO instances of this control currently in the app. One on the main IDE screen… and it works just fine

The other is in a different window and will be used to collect project config info, and there in lies the problem. On that window all the controls “work” EXCEPT for textfields… If I click 3 or 4 times, the text highlights (but in GRAY), and it won’t allow any typing. Segment controls are also gray, but do allow selection.

I have compared all relavant attributes between how the instances are created in both windows, and am at a loss as to why one works and the other doesn’t.

Note : All delegates are local to the Attribute Inspector class, so the parent window doesn’t need to know about the controls inside.

Like I said. I don’t expect a “solution”… but perhaps someone can make a SWAG that might help?

this is what I get (note the gray)

almost like the view is readonly OR is not the keyboard focused control - macOS API’s have a name for that I cant recall off the top of my head … keyView or something ?

same as I was thinking… but I can’t figure what it might be… the two windows that have this control are of a similar construction… in the one that works (you’ve seen it), there are 3 NSViews side by side, with the right one enclosing the Inspector.

In the one above, there are also 3 NSView, but only one at a time is visible (think page panel). I have even removed all but the one pane, with same results.

Guess I’ll attach some code to see if I can follow the focus

do the views becomeFirstResponder maybe ?
dunno if you need to specifically do that in the way you’re using them ?

I just put code in to tell me when the textfield gets or loses “focus” [becomesFirstResponder, and resignsFirstResponder).

When I ran it and clicked on the text field… it said GOT then LOST. so I thought “Aha!”
but then I went to the one that worked… and it said the same thing, but didn’t seem to have lost focus…(as in it still worked)

OK that gets a “WTF ???”

yeah… that is about where I am at… is WTF :frowning:

Ok I was wrong… both instances… get LOST then GOT which seems to be correct

so somehow the non-working instance seems to think the field is Read-Only, but unlike iOS I can’t find a UserInteraction flag to check

even though both instance are created the same

well it seems the issue isn’t (probably) with the Inspector control itself, I removed all the controls from the window, and inserts a plain vanilla textfield… and it doesn’t work either, even though it reports as selectable, editable and enabled


Turns out (and I do not know why)… but setting the WIndow Mask to .fullSizeContentView turns the whole window (and its contents) to “read only”

I created a simple test window with just a single TextField… and it worked if I used any other mask, but did not work if I made it fullsizecontent

make the mask [.titled,.fullsizecontentview]
self.titlebarAppearsTransparent = true
self.closeButton = false
self.maximizeButton = false
self.minimizeButton = false