Thanks Achim, I'll think about that one...
I guess the main thing that's confusing to me, is it seems that according to
NSNumberFormatter, the default behavior seemingly should be that things should
be a float. So, I'm not 100% sure why this is happening, or anything would need
to be done to enable the formatter to create floating point.
For instance:
[formatter setAllowsFloats:YES];
Could be called, where formatter is an NSNumberFormatter, but the default is
supposed to be that this is true anyway.
I also tried:
[formatter setGeneratesDecimalNumbers:YES];
Which is also supposed to be true by default. And I tried a few permutations of
this.
I haven't really gone through the example code with a fine tooth comb yet, but
it would be cool to get it working, because other than that "it works for me".
I half suspect that the formatter behavior for the qcindexport, where
allowsFloats is turned to false, may be affecting the behavior of the number
ports later. (I should also test this and compile before sending back to list,
but hey, someone may have already been through this one before.)
-gt
On Apr 14, 2012, at 12:11 AM, Achim Breidenbach wrote:
> Hello George,
>
> maybe you can debug and check with -(NSUInteger)maximumFractionDigits what
> the current value of your "formatter" is, and set it with
> -(void)setMaximumFractionDigits:(NSUInteger)number to a certain number?
>
> Just a guess, I am no expert in UI programming.
>
> best,
>
> Achim Breidenbach
> Boinx Software
>
> On 13.04.2012, at 23:19, George Toledo wrote:
>
>> The Apple QCTV example has some code like this in Composition Parameters
>> View.m
>>
>> else if([type isEqualToString:QCPortTypeNumber]) {
>> minNumber = [inputAttributes
>> objectForKey:QCPortAttributeMinimumValueKey];
>> maxNumber = [inputAttributes
>> objectForKey:QCPortAttributeMaximumValueKey];
>> if(minNumber && maxNumber) {
>> control = [[NSSlider alloc]
>> initWithFrame:NSMakeRect(0, kVOffset + totalHeight, kDefaultWidth, 15)];
>> [[control cell]
>> setControlSize:NSSmallControlSize];
>> [(NSSlider*)control setMinValue:[minNumber
>> doubleValue]];
>> [(NSSlider*)control setMaxValue:[maxNumber
>> doubleValue]];
>> }
>> else {
>> control = [[NSTextField alloc]
>> initWithFrame:NSMakeRect(0, kVOffset + totalHeight - 3, kDefaultWidth, 19)];
>> [[control cell] setWraps:NO];
>> [[control cell] setScrollable:YES];
>> [[control cell] setFont:[NSFont
>> systemFontOfSize:[NSFont smallSystemFontSize]]];
>> formatter = [NSNumberFormatter new];
>> [formatter setMinimum:minNumber];
>> [formatter setMaximum:maxNumber];
>> [[control cell] setFormatter:formatter];
>> [formatter release];
>> [[control cell] setSendsActionOnEndEditing:YES];
>> }
>> [control setAutoresizingMask:NSViewWidthSizable];
>> totalHeight += 25;
>> }
>>
>>
>> My "problem" is, that the created "Inspector" turns floating point values
>> that are entered in, into Integer. I've tried fiddling with a few things
>> with no success, I think just because I've gotten some syntax wrong
>> somewhere.
>>
>> Does anyone know how to fix it so that I can get floating point values
>> working?
>>
>> Thanks,
>> gt
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Quartzcomposer-dev mailing list ([email protected])
>> Help/Unsubscribe/Update your Subscription:
>> https://lists.apple.com/mailman/options/quartzcomposer-dev/achim%40boinx.com
>>
>> This email sent to [email protected]
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com
This email sent to [email protected]