@michaelbach I’ve never been able to get CPSlider to stop at tick marks. I just coded around it with this soltuion:
(IBAction)performGlobalSlider:(id)aSender
{
var nSliderValue;
nSliderValue = [sliderGlobal intValue];
// Now Set the Slider's new value
[sliderGlobal setIntValue:nSliderValue];
}
[sender setDoubleValue: [sender closestTickMarkValueToValue: [sender doubleValue]]];
Hi! I'm using the CPTextView and for some reason it types vertically and not horizontally. If I assign my own text container and specify
[_textContainer setHeightTracksTextView:YES]; [_textContainer setWidthTracksTextView:YES];
I don't event get to see the text. Is there something that needs to be set to get this to work?
@mucholove i am not sure whether tracking in both directions makes sense at all.
#if CAPPUCCINO
textViewFrame = CGRectMake(0,0, 1e7, 1e7); //
#endif
CPView.j
: "CPSet<tab>_ephereralSubviews;". I bet this should be called "_ephemeralSubviews;". And indeed, later _ephemeralSubviews
is created in CPView.j
, but because not declared it becomes global, I think. Doesn't seem to affect the system, but might be nice to fix.
- (void) removeEphemeralSubviewNamed: (CPString) aName {
.setAllowsTickMarkValuesOnly: YES
. If I do nothing in the "remove…" function, the slider does not appear. If I pass the bucket up:[super removeEphemeralSubviewNamed: aName];
Uncaught InternalError: too much recursion
FWIW: A typo in
CPView.j
: "CPSet<tab>_ephereralSubviews;". I bet this should be called "_ephemeralSubviews;". And indeed, later_ephemeralSubviews
is created inCPView.j
, but because not declared it becomes global, I think. Doesn't seem to affect the system, but might be nice to fix.
@michaelbach what line number are you talking about?
Hmm....So I spoke too soon. I also had to exclude my custom
KNNTextStorage
from the object for it to display text. Not sure where exactly the problem lies because the code works on Apple code but I guess it has something to do with the sequencing ofsuper
calls :)
@mucholove do you have a reduction of your issue?
NSMutableAttributedString adds two primitive methods to those of NSAttributedString. These primitive methods provide the basis for all the other methods in its class. The primitive replaceCharacters(in:with:) method replaces a range of characters with those from a string, leaving all attribute information outside that range intact. The primitive setAttributes(_:range:) method sets attributes and values for a given range of characters, replacing any previous attributes and values for that range.
Clearly, the CPTextStorage : CPAttributedString is different
we have replaceCharactersInRange:(CPRange)aRange withString:(CPString)aString
NaN
attributesAtIndex:effectiveRange:
CPMakeRange
function suggestion. The hardest part was coming to terms with how the methods are different in Cappuccino VS Apple which led to a few little changes—some of which had an error