Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • May 21 03:53
    daumiller starred cappuccino/cappuccino
  • May 17 14:48
    cappbot commented #2967
  • May 17 14:29
    cappbot closed #2967
  • May 17 14:29
    cappbot commented #2967
  • May 17 14:29
    cappbot labeled #2967
  • May 17 14:14
    daboe01 commented #2967
  • May 17 11:58
    ivucica commented #2967
  • May 12 19:04
    cappbot commented #3042
  • May 12 18:41
    cappbot labeled #3042
  • May 12 18:41
    cappbot milestoned #3042
  • May 12 18:33
    enquora edited #3042
  • May 12 18:33
    enquora opened #3042
  • May 03 09:04
    iKettles starred cappuccino/cappuccino
  • Apr 26 18:17
    cappbot commented #3005
  • Apr 26 18:11
    cappbot closed #3005
  • Apr 26 18:11
    cappbot commented #3005
  • Apr 26 18:11
    cappbot labeled #3005
  • Apr 26 17:59
    daboe01 commented #3005
  • Apr 26 16:34
    michaelbach commented #3004
  • Apr 26 16:33
    michaelbach commented #3004
Michael Bach
@michaelbach
There's good reason for the CPSlider crash: removeEphemeralSubviewNamed: is nowhere defined.
Shawn Platkus
@platkus

@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];
    }

Michael Bach
@michaelbach
@platkus : Thank you. "Never"? Curiouser and curiouser… W/o bindings tickmark stopping works quite smoothly for me. I've now programmed around it by adding an action, and in the action:
[sender setDoubleValue: [sender closestTickMarkValueToValue: [sender doubleValue]]];
But it's a markedly poorer user experience than the true "stopping at tick marks".
Shawn Platkus
@platkus
@michaelbach Well, I’m using the Cappuccino 1.0.0 Release with two targeted pulls to fix a couple bugs. I don’t know if this is fixed in the latest source. But checking the box to only stop at tick marks in Xcode does not work for me. Also, the UI doesn’t show tick marks for me either. I have to create a background image that I place behind the CPSlider with tick marks carefully lined up with where the Slider will stop. That works for a constant range of values, but it isn’t a solution for dynamically generated sliders with variable ranges.
1 reply
daboe01
@daboe01

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.

did you try to track only the height?
Gustavo "Mucho Love"
@mucholove
@daboe01 - true! I did stub one out...but I fixed the problem by changing the size with which I init the view. I would init with CGRectZero and the view suddenly expanded when I started it like so:
        #if CAPPUCCINO
        textViewFrame = CGRectMake(0,0, 1e7, 1e7); //
        #endif
So—yay! Problem fixed :)
Not exactly sure why the frame was SOOOOOO small
Gustavo "Mucho Love"
@mucholove
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 of super calls :)
Michael Bach
@michaelbach
FWIW: A typo in 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.
Michael Bach
@michaelbach
CPSlider problem, next installment: Via a category I added
- (void) removeEphemeralSubviewNamed: (CPString) aName {.
Indeed this is called by a programmatically instantiated slider if it's set to setAllowsTickMarkValuesOnly: YES. If I do nothing in the "remove…" function, the slider does not appear. If I pass the bucket up:
[super removeEphemeralSubviewNamed: aName];
(because creation is also done by a super), an error
Uncaught InternalError: too much recursion
appears. I give up for now… 😭
daboe01
@daboe01

FWIW: A typo in 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.

@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 of super calls :)

@mucholove do you have a reduction of your issue?

daboe01
@daboe01
@didierkorthoudt would you mind pushing the combobox stuff you have so far? i will be on a long boring train ride tomorrow ;-)
Michael Bach
@michaelbach
@daboe01 : Typo in CPView.j: "CPSet<tab>_ephereralSubviews;" is on line 235. And on line 3462 w/o typo.
daboe01
@daboe01

@daboe01 : Typo in CPView.j: "CPSet<tab>_ephereralSubviews;" is on line 235. And on line 3462 w/o typo.

@michaelbach i agree that this is a typo. excellent catch! will you make a PR to fix this?

1 reply
daboe01
@daboe01
@didierkorthoudt found the background issue. was an additional call to _init on my side (i do not remember why i did shit 9 years ago). one issue less :-)
Didier Korthoudt
@didierkorthoudt
@daboe01 Excellent !..
A discussion of the history of web frameworks —initiated by someone who hasn’t experienced most of them ;-)
Including a mention of Cappuccino by Francisco T.
Martin Carlberg
@mrcarlberg
Nice read! Thanks for sharing!
daboe01
@daboe01
+1
Alexander Ljungberg
@aljungberg
Nice one.
Gustavo "Mucho Love"
@mucholove
@daboe01 - still working through CPTextVIew kinks. It zeroes out when the single _rangeEntry goes from having a range with length of NaN
I have it printing out on the console
On my version of TextStorage I had / have it set up for the Apple implementation where 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
Right now, I wish I knew when exactly that range turned into a NaN
Trying to debug this by printing out a whole bunch of stuff to console. Not sure if I can do KVC observing
But it is quite hard to pinpoint exactly what causes it. I don't know how to reproduce it
Tips on how to get it to reproduce would be nice!
Gustavo "Mucho Love"
@mucholove
@[ { attributes: @{ @"CPFontAttributeName": <CPFont 0x00bc81> 12px Arial, sans-serif, @"CPForegroundColorAttributeName": <CPColor 0x000dbf> rgb(0, 0, 0) }, range: { length: NaN, location: 0 } } ]
daboe01
@daboe01
@mucholove is the textview fully empty when length is NaN?
i do not think that you can KVC observing. you will have to walk through the source and have a look on each assignment to the range property.

Clearly, the CPTextStorage : CPAttributedString is different

we have replaceCharactersInRange:(CPRange)aRange withString:(CPString)aString

Martin Carlberg
@mrcarlberg
@mucholove Can't you redeclare the function CPMakeRange(location, length) so it will break in the debugger if the length is NaN?
Something like:
function CPMakeRange(location, length)
{
    if (isNaN(length)) debugger;
    return { location:location, length:length };
}
Martin Carlberg
@mrcarlberg
You could just type in the following in the console in your browser when you have stopped your application on a break point to redeclare the function:
CPMakeRange = function(location, length)
{
    if (isNaN(length)) debugger;
    return { location:location, length:length };
}
Just continue your application and it will break when the length will be set to NaN
Gustavo "Mucho Love"
@mucholove
@mrcarlberg - yes! Fantastic idea. Will try
@daboe01 - yes the textview goes fully empty the second the length is NaN. I am printing to console from attributesAtIndex:effectiveRange:
daboe01
@daboe01
@mucholove can you post the stack trace that places the NaN?
Gustavo "Mucho Love"
@mucholove
@daboe01 - I could—but as expected, it was my mistake! It was incredibly easy to find after following the rewrite 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
Thank you @mrcarlberg !
daboe01
@daboe01
@mrcarlberg great help for debugging!
Martin Carlberg
@mrcarlberg
Thanks! It is just a pleasure to be able to help!
daboe01
@daboe01
@didierkorthoudt any news about CPComboBox?
Michael Bach
@michaelbach
As it happens, just today I added a CPComboBox, and it worked well (I only use a binding on it).
BUT: We have now 2 (TWO) MacOS updates that broke our toolchain (XcodeCapp chokes due to Python 2 removal). I can only keep working in Cappuccino because I have one computer which I can leave at the outdated MacOS version (so far).
I know I can run nib2cib by myself, but I see no way to set up new actions w/o the .m/.h files created by XcodeCapp that make actions accessible in the InterfaceBuilder.
2 replies