Search Results

Search found 3 results on 1 pages for 'carlosb'.

Page 1/1 | 1 

  • NSStepper ignores current NSTextField value

    - by JanX2
    I have the same initial problem as described in Integrate NSStepper with NSTextField: I need to have a NSTextField working with a NSStepper as being one control so that I can edit an integer value either by changing it directly on the text field or using the stepper up/down arrows. Using bindings as commented on by carlosb results in a usable UI. However, in the initial question carlosb describes the following: Problem is that if I edit the text field then click the stepper again it will forget about the value I manually edited and use the stepper's internal value. This is why I am posting a variation on this question again. carlosb's use of bindings doesn't solve this problem. This happens in both the current project I am working on and a test project I have created. The test project can be found at GitHub. You can download it there (even without git) via the "Download Source" button in the top right. Is there a clean way to solve this issue?

    Read the article

  • How to limit NSTextField text length and keep it always upper case?

    - by carlosb
    Need to have an NSTextField with a text limit of 4 characters maximum and show always in upper case but can't figure out a good way of achieving that. I've tried to do it through a binding with a validation method but the validation only gets called when the control loses first responder and that's no good. Temporarly I made it work by observing the notification NSControlTextDidChangeNotification on the text field and having it call the method: - (void)textDidChange:(NSNotification*)notification { NSTextField* textField = [notification object]; NSString* value = [textField stringValue]; if ([value length] > 4) { [textField setStringValue:[[value uppercaseString] substringWithRange:NSMakeRange(0, 4)]]; } else { [textField setStringValue:[value uppercaseString]]; } } But this surely isn't the best way of doing it. Any better suggestion?

    Read the article

1