FROM : Jonathan Dann
DATE : Sat May 24 11:52:32 2008
You're welcome, but I'd replace this:
> const CGFloat LargeNumberForText = 1.0e7;
> [[textView textContainer]
> setContainerSize:NSMakeSize(LargeNumberForText, LargeNumberForText)];
with
[[textView textContainer] setContainerSize:NSMakeSize(FLT_MAX,
FLT_MAX)];
hey presto 1 less line of code! FLT_MAX is the largest representable
floating point number. It *may* insulate you from processor
differences, but someone would have to confirm to me that this could
ever be a problem.
Jon
On 24 May 2008, at 02:35, David Carlisle wrote:
> Based on your kindly giving me a precise reference I was able to
> remove a few unnecessary statements from my awake from nib. It now
> reads as follows:
>
> - (void) awakeFromNib {
> const CGFloat LargeNumberForText = 1.0e7;
> [[textView textContainer]
> setContainerSize:NSMakeSize(LargeNumberForText, LargeNumberForText)];
> [[textView textContainer] setWidthTracksTextView:NO];
> [textView setHorizontallyResizable:YES];
> }
>
> Thanks,
> DC
>
> On May 23, 2008, at 4:08 PM, Jonathan Dann wrote:
>
>> Its in SMLViewMenuController.m line -(IBAction)lineWrapTextAction:
>>
>> Jon
>>
>> On 23 May 2008, at 22:58, David Carlisle wrote:
>>
>>> Looks interesting. Thanks.
>>>
>>> DC
>>>
>>> On May 23, 2008, at 3:37 PM, Jonathan Dann wrote:
>>>
>>>> You may also like to look at the source code to Smultron by Peter
>>>> Borg. It's in there but I forget exactly.
>>>>
>>>> http://smultron.sourceforge.net/
>>>>
>>>> Jon
>>>>
>>>> On 23 May 2008, at 21:55, David Carlisle wrote:
>>>>
>>>>> I made some guesses at which statements to copy from
>>>>> BiScrollAspect.m and came up with the following awakeFromNib.
>>>>> I'm not sure which statements are the most relevant, and why,
>>>>> but it seems to do what I need.
>>>>>
>>>>> - (void) awakeFromNib {
>>>>> const CGFloat LargeNumberForText = 1.0e7;
>>>>> [[textView textContainer]
>>>>> setContainerSize:NSMakeSize(LargeNumberForText,
>>>>> LargeNumberForText)];
>>>>> [[textView textContainer] setWidthTracksTextView:NO];
>>>>> [[textView textContainer] setHeightTracksTextView:NO];
>>>>> [textView setAutoresizingMask:NSViewNotSizable];
>>>>> [textView setMaxSize:NSMakeSize(LargeNumberForText,
>>>>> LargeNumberForText)];
>>>>> [textView setHorizontallyResizable:YES];
>>>>> [textView setVerticallyResizable:YES];
>>>>> }
>>>>>
>>>>> On May 23, 2008, at 12:03 PM, Douglas Davidson wrote:
>>>>>
>>>>>>
>>>>>> On May 23, 2008, at 10:33 AM, David Carlisle wrote:
>>>>>>
>>>>>>> I've spent the last few hours trying to create an NSTextView
>>>>>>> without word wrap. The BiScrollAspect.m file in the
>>>>>>> textSizingExample project file is no help at all.
>>>>>>
>>>>>> No help in that it doesn't do what you want, or no help in that
>>>>>> you can't get it working in your app, or no help in some other
>>>>>> way?
>>>>>>
>>>>>> Douglas Davidson
>>>>>>
>>>>>
>>>>> _______________________________________________
>>>>>
>>>>> Cocoa-dev mailing list (<email_removed>)
>>>>>
>>>>> Please do not post admin requests or moderator comments to the
>>>>> list.
>>>>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>>>>>
>>>>> Help/Unsubscribe/Update your Subscription:
>>>>> http://lists.apple.com/mailman/options/cocoa-dev/j.p.<email_removed>
>>>>>
>>>>> This email sent to j.p.<email_removed>
>>>>
>>>
>>
>> _______________________________________________
>>
>> Cocoa-dev mailing list (<email_removed>)
>>
>> Please do not post admin requests or moderator comments to the list.
>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>>
>> Help/Unsubscribe/Update your Subscription:
>> http://lists.apple.com/mailman/options/cocoa-dev/<email_removed>
>>
>> This email sent to <email_removed>
>
DATE : Sat May 24 11:52:32 2008
You're welcome, but I'd replace this:
> const CGFloat LargeNumberForText = 1.0e7;
> [[textView textContainer]
> setContainerSize:NSMakeSize(LargeNumberForText, LargeNumberForText)];
with
[[textView textContainer] setContainerSize:NSMakeSize(FLT_MAX,
FLT_MAX)];
hey presto 1 less line of code! FLT_MAX is the largest representable
floating point number. It *may* insulate you from processor
differences, but someone would have to confirm to me that this could
ever be a problem.
Jon
On 24 May 2008, at 02:35, David Carlisle wrote:
> Based on your kindly giving me a precise reference I was able to
> remove a few unnecessary statements from my awake from nib. It now
> reads as follows:
>
> - (void) awakeFromNib {
> const CGFloat LargeNumberForText = 1.0e7;
> [[textView textContainer]
> setContainerSize:NSMakeSize(LargeNumberForText, LargeNumberForText)];
> [[textView textContainer] setWidthTracksTextView:NO];
> [textView setHorizontallyResizable:YES];
> }
>
> Thanks,
> DC
>
> On May 23, 2008, at 4:08 PM, Jonathan Dann wrote:
>
>> Its in SMLViewMenuController.m line -(IBAction)lineWrapTextAction:
>>
>> Jon
>>
>> On 23 May 2008, at 22:58, David Carlisle wrote:
>>
>>> Looks interesting. Thanks.
>>>
>>> DC
>>>
>>> On May 23, 2008, at 3:37 PM, Jonathan Dann wrote:
>>>
>>>> You may also like to look at the source code to Smultron by Peter
>>>> Borg. It's in there but I forget exactly.
>>>>
>>>> http://smultron.sourceforge.net/
>>>>
>>>> Jon
>>>>
>>>> On 23 May 2008, at 21:55, David Carlisle wrote:
>>>>
>>>>> I made some guesses at which statements to copy from
>>>>> BiScrollAspect.m and came up with the following awakeFromNib.
>>>>> I'm not sure which statements are the most relevant, and why,
>>>>> but it seems to do what I need.
>>>>>
>>>>> - (void) awakeFromNib {
>>>>> const CGFloat LargeNumberForText = 1.0e7;
>>>>> [[textView textContainer]
>>>>> setContainerSize:NSMakeSize(LargeNumberForText,
>>>>> LargeNumberForText)];
>>>>> [[textView textContainer] setWidthTracksTextView:NO];
>>>>> [[textView textContainer] setHeightTracksTextView:NO];
>>>>> [textView setAutoresizingMask:NSViewNotSizable];
>>>>> [textView setMaxSize:NSMakeSize(LargeNumberForText,
>>>>> LargeNumberForText)];
>>>>> [textView setHorizontallyResizable:YES];
>>>>> [textView setVerticallyResizable:YES];
>>>>> }
>>>>>
>>>>> On May 23, 2008, at 12:03 PM, Douglas Davidson wrote:
>>>>>
>>>>>>
>>>>>> On May 23, 2008, at 10:33 AM, David Carlisle wrote:
>>>>>>
>>>>>>> I've spent the last few hours trying to create an NSTextView
>>>>>>> without word wrap. The BiScrollAspect.m file in the
>>>>>>> textSizingExample project file is no help at all.
>>>>>>
>>>>>> No help in that it doesn't do what you want, or no help in that
>>>>>> you can't get it working in your app, or no help in some other
>>>>>> way?
>>>>>>
>>>>>> Douglas Davidson
>>>>>>
>>>>>
>>>>> _______________________________________________
>>>>>
>>>>> Cocoa-dev mailing list (<email_removed>)
>>>>>
>>>>> Please do not post admin requests or moderator comments to the
>>>>> list.
>>>>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>>>>>
>>>>> Help/Unsubscribe/Update your Subscription:
>>>>> http://lists.apple.com/mailman/options/cocoa-dev/j.p.<email_removed>
>>>>>
>>>>> This email sent to j.p.<email_removed>
>>>>
>>>
>>
>> _______________________________________________
>>
>> Cocoa-dev mailing list (<email_removed>)
>>
>> Please do not post admin requests or moderator comments to the list.
>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>>
>> Help/Unsubscribe/Update your Subscription:
>> http://lists.apple.com/mailman/options/cocoa-dev/<email_removed>
>>
>> This email sent to <email_removed>
>
| Related mails | Author | Date |
|---|---|---|
| David Carlisle | May 23, 19:33 | |
| Douglas Davidson | May 23, 20:03 | |
| David Carlisle | May 23, 20:15 | |
| David Carlisle | May 23, 22:55 | |
| Douglas Davidson | May 23, 23:01 | |
| Jonathan Dann | May 24, 00:08 | |
| David Carlisle | May 24, 03:35 | |
| Jonathan Dann | May 24, 11:52 |






Cocoa mail archive

