Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Make CPTextFields setPlaceholderString resettable

#238

The way it is now, prevents one to change the placeholder text later on. (The first set placeholder text stays and is not updated).

var tf = [[CPTextField alloc] initWithFrame:CGMakeRectZero()]; [tf setPlaceholderString:@"No value"]; [tf setPlaceholderString:@"No selection"];

will display "No Value" instead of "No selection".

Proposed change below for CPTextField.j

-(void)setPlaceholderString:(CPString)aStringValue {

if(_placeholderString && [self stringValue] === _placeholderString)
    _value = @""; // or nil. or a flag.
_placeholderString = aStringValue;

//if there is no set value, automatically display the placeholder
if (!_value) 
    [self setStringValue:_placeholderString];

}

Reported by Moritz Angermann · March 7th, 2009 @ 01:09 AM

State: resolved
Milestone: none
Assigned to: nobody

Activity

  1. admin (at 280north)
    admin (at 280north)
    • State changed from new to resolved
    • Tag changed from bug, cptextfield, patch to @to-review, bug, cptextfield, patch

    (from [88035429bb5de912a7d804a8659b5af542f6faeb]) Fix in CPString setPlaceholderString

    [#238 Make CPTextFields setPlaceholderString resettable state:resolved] http://github.com/280north/cappu...

    March 7th, 2009 @ 07:06 PM

  2. admin (at 280north)
    admin (at 280north)

    (from [d1c0237bf3fd2fb566a465ec25cabe60ce5f8df4]) Fix for recursive notification postings crashing. Also fixed sizing issues with tableview, including crashing when not in a superview.

    Closes #238 Make CPTextFields setPlaceholderString resettable.

    Reviewed by me.
    http://github.com/280north/cappuccino/commit/d1c0237bf3fd2fb566a465...

    August 25th, 2009 @ 01:26 PM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.