libs-gui
libs-gui copied to clipboard
NSImageView acceptsFirstResponder while it should not
I found out that a custom NSImageView inside a scrollview "eats" copy&paste events because it accepts the first responder instead of the window/document containing it. On Mac instead it works. A first way to proof that is on GNUstep to override in the custom view acceptsFirstResponder and return NO.
Further analysis shows that this comes actually from the NSControl getting the responder property from the cell.
So, the workaround can be reduced to [[self selectedCell] setRefusesFirstResponder:YES];
Now I think that either the initialization of NSCell is itself wrong or GORM is instantiating it wrong (where wrong means different from Mac).
an NSImageCell instantiated on Mac returns refusesFirstResponder YES while on GNUstep it is NO. On Mac this happens for both an code instantiated NSImageCell as well as one inside an NSImageView instantiated with IB. So, I think this is a hint for a wrong GUI default value, not an IB vs. GORM initialization thing.
Now the question is at which level of the NSImageCell hiearchy the value is wrong?
Furthermore I checked on Mac acceptsFirstResponder: NSCell : NO NSActionCell: NO NSTextFieldCell: NO NSButtonCell: NO NSImageCell: YES
I made further tests on initWithImageCell. NSImageCell initWithImageCell : acceptsFirstResponder YES NSCell initWithImageCell : acceptsFirstResponder NO
I will rework on this.
Looks like this was fixed on 22th of May by yourself