Re: How to Truncate lines in NSScrollView/NSClipView/NSTextView Combo

2016-04-26 Thread Graham Cox

> On 27 Apr 2016, at 9:29 AM, Graham Cox  wrote:
> 
> [[theTextView textContainer]  setContainerSize:NSMakeSize(contentSize.width, 
> FLT_MAX)];


Oops, that should be:

[[theTextView textContainer]  setContainerSize:NSMakeSize(FLT_MAX, 
contentSize.height)];

G.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: How to Truncate lines in NSScrollView/NSClipView/NSTextView Combo

2016-04-26 Thread Graham Cox

> On 26 Apr 2016, at 8:25 PM, Dave  wrote:
> 
> maybe its just impossible using an NSScrollView/NSTextView. In fact, since 
> there isn’t a handy-dandy method or property on any of the classes in 
> question to just do it, I’m beginning to think that’s the case.



[[theTextView textContainer]  setContainerSize:NSMakeSize(contentSize.width, 
FLT_MAX)];
[[theTextView textContainer]  setWidthTracksTextView:NO];


—Graham



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: How to Truncate lines in NSScrollView/NSClipView/NSTextView Combo

2016-04-26 Thread Dave
Hi,

I did do quite a few searches but I didn’t find that - I’m not that good at 
formulating the correct search string, I think was trying things like 
"NSScrollView Truncate Text”.

Anyway, I managed to piece together something that would and I created a 
Category method on NSScrollView so I will (hopefully) never lose it again.

Cheers
Dave

> On 26 Apr 2016, at 15:23, Gary L. Wade  wrote:
> 
> Did you try doing an internet search?  This search phrase in Google has a 
> number of people asking the same thing with many variations on the same 
> answer:
> 
> how to prevent nstextview from wrapping 
> 
> --
> Gary L. Wade
> http://www.garywade.com/ 
>> On Apr 26, 2016, at 3:25 AM, Dave > > wrote:
>> 
>> Hi,
>> 
>> I’ve tried loads of different way of doing it but none of them work. Maybe 
>> its because I’m not using Auto-Layout, maybe its just impossible using an 
>> NSScrollView/NSTextView. In fact, since there isn’t a handy-dandy method or 
>> property on any of the classes in question to just do it, I’m beginning to 
>> think that’s the case.
>> 
>> Apple’s documentation is so bad that I can’t find anything related to it and 
>> I must have wasted around 2 hours fiddling with this. Still I have lots of 
>> lovely animations in XCode to make up for it so all is not lost! I’m giving 
>> up and it’s too much of a time-sync to muck around with it as I have more 
>> pressing things that need doing.
>> 
>> Thanks a lot for for taking the time to help.
>> 
>> All the Best
>> Dave
>> 
>> 
>>> On 26 Apr 2016, at 10:00, Bill Cheeseman >> > wrote:
>>> 
>>> Graham Cox is right.
>>> 
>>> I realized overnight that I was misinterpreting your question. I happen to 
>>> be working on truncation of text myself, and I was focused on the usual 
>>> meaning of "truncation" in the attributed string context. It means placing 
>>> three periods at the end or in the middle of truncated lines of text.
>>> 
>>> What you are trying to do, as I now understand it, is to keep the original 
>>> line breaks of the text in place, without "wrapping," even though the text 
>>> view or window is made narrower. In other words, your text view will act 
>>> like a peephole into a bigger page. That is what NSTextContainer is for. I 
>>> think the references I gave to you for text handling in general will lead 
>>> you to the relevant documentation.
>>> 
>>> From the NSTextContainer reference document:
>>> 
>>> "The NSTextContainer class defines a region where text is laid out. An 
>>> NSLayoutManager 
>>> >>  
>>> >
>>>  uses NSTextContainer to determine where to break lines, lay out portions 
>>> of text, and so on. An NSTextContainerobject normally defines rectangular 
>>> regions, but you can define exclusion paths inside the text container to 
>>> create regions where text does not flow. You can also subclass to create 
>>> text containers with nonrectangular regions, such as circular regions, 
>>> regions with holes in them, or regions that flow alongside graphics."
>>> 
>>> Since you're in a very speed-sensitive environment, you will also be 
>>> interested in the paragraph that follows that quoted text, about using 
>>> threads.
>>> 
 On Apr 25, 2016, at 11:34 AM, Dave  >> wrote:
 
 I’m familiar with NSAttributedString and friends. I had thought that there 
 was a higher level interface to it as it seems like a common thing to want 
 to do.
 
 Basically my ScrollView is just a scrolling line log similar to XCode’s 
 NSLog window.
>>> 
>>> -- 
>>> 
>>> Bill Cheeseman - wjcheese...@comcast.net  
>>> >
>>> 
>>> -- 
>>> 
>>> Bill Cheeseman - wjcheese...@comcast.net 
>>> 
> 

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Custom-vs-modal presentation?

2016-04-26 Thread Rick Mann
I have a custom UI view controller presentation using UIPresentationController 
and UIViewControllerTransitioningDelegate. But I'm wondering how best to do 
this only on iPad and iPhone 6 plus, and to use a regular modal presentation on 
other iPhones. Is that even an appropriate desire?

Basically, I show a small details view for my app's objects. But it's big 
enough that it should just fill the screen (and act like a modal presentation) 
on the smaller devices.

Suggestions? Thanks.

-- 
Rick Mann
rm...@latencyzero.com



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: How to Truncate lines in NSScrollView/NSClipView/NSTextView Combo

2016-04-26 Thread Gary L. Wade
Did you try doing an internet search?  This search phrase in Google has a 
number of people asking the same thing with many variations on the same answer:

how to prevent nstextview from wrapping 

--
Gary L. Wade
http://www.garywade.com/ 
> On Apr 26, 2016, at 3:25 AM, Dave  wrote:
> 
> Hi,
> 
> I’ve tried loads of different way of doing it but none of them work. Maybe 
> its because I’m not using Auto-Layout, maybe its just impossible using an 
> NSScrollView/NSTextView. In fact, since there isn’t a handy-dandy method or 
> property on any of the classes in question to just do it, I’m beginning to 
> think that’s the case.
> 
> Apple’s documentation is so bad that I can’t find anything related to it and 
> I must have wasted around 2 hours fiddling with this. Still I have lots of 
> lovely animations in XCode to make up for it so all is not lost! I’m giving 
> up and it’s too much of a time-sync to muck around with it as I have more 
> pressing things that need doing.
> 
> Thanks a lot for for taking the time to help.
> 
> All the Best
> Dave
> 
> 
>> On 26 Apr 2016, at 10:00, Bill Cheeseman  wrote:
>> 
>> Graham Cox is right.
>> 
>> I realized overnight that I was misinterpreting your question. I happen to 
>> be working on truncation of text myself, and I was focused on the usual 
>> meaning of "truncation" in the attributed string context. It means placing 
>> three periods at the end or in the middle of truncated lines of text.
>> 
>> What you are trying to do, as I now understand it, is to keep the original 
>> line breaks of the text in place, without "wrapping," even though the text 
>> view or window is made narrower. In other words, your text view will act 
>> like a peephole into a bigger page. That is what NSTextContainer is for. I 
>> think the references I gave to you for text handling in general will lead 
>> you to the relevant documentation.
>> 
>> From the NSTextContainer reference document:
>> 
>> "The NSTextContainer class defines a region where text is laid out. An 
>> NSLayoutManager 
>> 
>>  uses NSTextContainer to determine where to break lines, lay out portions of 
>> text, and so on. An NSTextContainerobject normally defines rectangular 
>> regions, but you can define exclusion paths inside the text container to 
>> create regions where text does not flow. You can also subclass to create 
>> text containers with nonrectangular regions, such as circular regions, 
>> regions with holes in them, or regions that flow alongside graphics."
>> 
>> Since you're in a very speed-sensitive environment, you will also be 
>> interested in the paragraph that follows that quoted text, about using 
>> threads.
>> 
>>> On Apr 25, 2016, at 11:34 AM, Dave >> > wrote:
>>> 
>>> I’m familiar with NSAttributedString and friends. I had thought that there 
>>> was a higher level interface to it as it seems like a common thing to want 
>>> to do.
>>> 
>>> Basically my ScrollView is just a scrolling line log similar to XCode’s 
>>> NSLog window.
>> 
>> -- 
>> 
>> Bill Cheeseman - wjcheese...@comcast.net 
>> 
>> -- 
>> 
>> Bill Cheeseman - wjcheese...@comcast.net
>> 

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: How to Truncate lines in NSScrollView/NSClipView/NSTextView Combo

2016-04-26 Thread Dave
Hi,

I’ve tried loads of different way of doing it but none of them work. Maybe its 
because I’m not using Auto-Layout, maybe its just impossible using an 
NSScrollView/NSTextView. In fact, since there isn’t a handy-dandy method or 
property on any of the classes in question to just do it, I’m beginning to 
think that’s the case.

Apple’s documentation is so bad that I can’t find anything related to it and I 
must have wasted around 2 hours fiddling with this. Still I have lots of lovely 
animations in XCode to make up for it so all is not lost! I’m giving up and 
it’s too much of a time-sync to muck around with it as I have more pressing 
things that need doing.

Thanks a lot for for taking the time to help.

All the Best
Dave


> On 26 Apr 2016, at 10:00, Bill Cheeseman  wrote:
> 
> Graham Cox is right.
> 
> I realized overnight that I was misinterpreting your question. I happen to be 
> working on truncation of text myself, and I was focused on the usual meaning 
> of "truncation" in the attributed string context. It means placing three 
> periods at the end or in the middle of truncated lines of text.
> 
> What you are trying to do, as I now understand it, is to keep the original 
> line breaks of the text in place, without "wrapping," even though the text 
> view or window is made narrower. In other words, your text view will act like 
> a peephole into a bigger page. That is what NSTextContainer is for. I think 
> the references I gave to you for text handling in general will lead you to 
> the relevant documentation.
> 
> From the NSTextContainer reference document:
> 
> "The NSTextContainer class defines a region where text is laid out. An 
> NSLayoutManager 
> 
>  uses NSTextContainer to determine where to break lines, lay out portions of 
> text, and so on. An NSTextContainerobject normally defines rectangular 
> regions, but you can define exclusion paths inside the text container to 
> create regions where text does not flow. You can also subclass to create text 
> containers with nonrectangular regions, such as circular regions, regions 
> with holes in them, or regions that flow alongside graphics."
> 
> Since you're in a very speed-sensitive environment, you will also be 
> interested in the paragraph that follows that quoted text, about using 
> threads.
> 
>> On Apr 25, 2016, at 11:34 AM, Dave > > wrote:
>> 
>> I’m familiar with NSAttributedString and friends. I had thought that there 
>> was a higher level interface to it as it seems like a common thing to want 
>> to do.
>> 
>> Basically my ScrollView is just a scrolling line log similar to XCode’s 
>> NSLog window.
> 
> -- 
> 
> Bill Cheeseman - wjcheese...@comcast.net 
> 
> -- 
> 
> Bill Cheeseman - wjcheese...@comcast.net
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> 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:
> https://lists.apple.com/mailman/options/cocoa-dev/dave%40looktowindward.com
> 
> This email sent to d...@looktowindward.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: How to Truncate lines in NSScrollView/NSClipView/NSTextView Combo

2016-04-26 Thread Bill Cheeseman
Graham Cox is right.

I realized overnight that I was misinterpreting your question. I happen to be 
working on truncation of text myself, and I was focused on the usual meaning of 
"truncation" in the attributed string context. It means placing three periods 
at the end or in the middle of truncated lines of text.

What you are trying to do, as I now understand it, is to keep the original line 
breaks of the text in place, without "wrapping," even though the text view or 
window is made narrower. In other words, your text view will act like a 
peephole into a bigger page. That is what NSTextContainer is for. I think the 
references I gave to you for text handling in general will lead you to the 
relevant documentation.

From the NSTextContainer reference document:

"The NSTextContainer class defines a region where text is laid out. An 
NSLayoutManager 

 uses NSTextContainer to determine where to break lines, lay out portions of 
text, and so on. An NSTextContainerobject normally defines rectangular regions, 
but you can define exclusion paths inside the text container to create regions 
where text does not flow. You can also subclass to create text containers with 
nonrectangular regions, such as circular regions, regions with holes in them, 
or regions that flow alongside graphics."

Since you're in a very speed-sensitive environment, you will also be interested 
in the paragraph that follows that quoted text, about using threads.

> On Apr 25, 2016, at 11:34 AM, Dave  > wrote:
> 
> I’m familiar with NSAttributedString and friends. I had thought that there 
> was a higher level interface to it as it seems like a common thing to want to 
> do.
> 
> Basically my ScrollView is just a scrolling line log similar to XCode’s NSLog 
> window.

-- 

Bill Cheeseman - wjcheese...@comcast.net 

-- 

Bill Cheeseman - wjcheese...@comcast.net

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com