开发者

cocoa textfield disabling doesn't disable the cursor change

Hello I have a box with 2 NSTextFields in one row.

Also on specific action a custom semiopaque view appears over these 2 textfields. And then on other action, disappears.

When these texfields are covered with the semiopaque view I want them to become disabled and my cursor开发者_如何学JAVA not to change when it comes into the area of any of these textfields. And then I want them to become enabled when my custom view disappears.

I do it using the following commands:

[fileNameField setEnabled:NO];
[folderPathField setSelectable:NO];
[folderPathField setEnabled:NO];

and

[fileNameField setEnabled:YES];
[folderPathField setEnabled:YES];
[folderPathField setSelectable:YES];

respectively.

The problem is that one called fileNameField does change correctly: it becomes a bit dimmed and doesn't either get selected or change my cursor when it is over the textfield.

But another one, folderPathField also becomes disabled, it isn't possible to select the text, but it still changes my cursor when it enters it's area.

The only differences between these two textfields are:

1. fileNameField has rounded border and folderPathField has no border.

2. fileNameField has layout set to "Scrolls" and folderPathField - "Truncates".

Does somebody know what can be the reason for such behaviour?


You need to set it to not be editable

[textfield SetEditable:NO];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜