NSTextView: displaying "virtual" symbols?

2021-11-01 Thread David Young via Cocoa-dev
[resending with an even smaller attachment] I am working on a document storage format that consists of logical zones that nest. You can think of them sort of like elements from (X)HTML: All work and no play. Ordinarily, I would like for the zone boundaries marked by and to be invisible to th

Re: NSPanel / NSTextView in Dark Mode

2020-06-05 Thread Gabriel Zachmann via Cocoa-dev
> Make sure the text color is set to a named color such as Label Color instead > of Black. If the text view doesn't contain text in the xib, it might not > remember the color. In the XIB, the NSTextView does not contain any text , just the usual placeholder "lore ipsum&quo

Re: NSPanel / NSTextView in Dark Mode

2020-06-05 Thread Steve Mills via Cocoa-dev
On Jun 5, 2020, at 13:33:17, Gabriel Zachmann via Cocoa-dev wrote: > > Everything works, *except* in Dark Mode, the text in the NSTextView is not > legible, since it's black text on dark background. > > What should I do to make this panel also Dark Mode "proof"

NSPanel / NSTextView in Dark Mode

2020-06-05 Thread Gabriel Zachmann via Cocoa-dev
I have an NSPanel that contains just an NSTextView. The NSTextView is populated at init time using [helpView_ readRTFDFromFile: path]; I think, the NSPanel itself is created by all the XIB magic. Usually , the NSPanel is not visible; but when the user clicks a button, I present it using

Re: What is the preferred way to set NSTextView content from NSAttributedString?

2020-02-03 Thread Martin Wierschin via Cocoa-dev
es all current text. You should not need to manually call -setNeedsDisplay: on the NSTextView as was suggested earlier. If you're working with the right NSTextStorage then its view should observe the changes and automatically mark any redisplay as needed. ~Martin Wierschin > On Feb 02,

Re: What is the preferred way to set NSTextView content from NSAttributedString?

2020-02-02 Thread Jonathan Prescott via Cocoa-dev
Looking at the documentation for NSTextView, it is highly recommended that you manipulate the NSTextStorage associated with the view. NSTextStorage is a sub-class of NSMutableAttributedtString, so you have all of those capabilities as well. I’m just getting into this as well for my console

Re: What is the preferred way to set NSTextView content from NSAttributedString?

2020-02-02 Thread Greg Weston via Cocoa-dev
> - I want to set the displayed contents of V to T2. > > What is/are the recommended way/s to do this? > > *I would hope that I could assign V.attributedString = T2, but alas the > world does not seem to be this simple.* The documentation suggests you should be working with the view’s textStorag

RE: What is the preferred way to set NSTextView content from NSAttributedString?

2020-02-02 Thread Jonathan Prescott via Cocoa-dev
Did you tell V that it needs to re-load it’s display? There is a method on NSView (from which NSTextView is derived) called “needsDisplay(sic)” which sets a flag on the view so that the view will re-draw its content the next display cycle. So, after you set the content to T2, you need to call

What is the preferred way to set NSTextView content from NSAttributedString?

2020-02-02 Thread Jeff Younker via Cocoa-dev
Situation: - I am working in Swift 5. - I have an instance of an NSTextView. (Call it "V") - The value has already been set once. (Call this value "T1") - V is showing T1. - I have an NSAttributedString from another source. (Call this value "T2")

Re: Typing with multiple selections in NSTextView

2018-10-03 Thread Uli Kusterer
On 20. Sep 2018, at 08:54, Georg Seifert wrote: > I wonder why it supports multiple selection in the first place, when you can > do almost nothing with it? The way I remember it being introduced at WWDC was not as "multiple selection" but rather as "column selection". That might make some of th

Re: Typing with multiple selections in NSTextView

2018-09-20 Thread Martin Wierschin
It can be relatively tricky to enhance the text system in ways not originally conceived of by Apple. Still, NSTextView and friends are overall some nice tools. Best, ~Martin Wierschin > On Sep 19, 2018, at 11:54 PM, Georg Seifert wrote: > > Thanks for the explanation. > >

Re: Typing with multiple selections in NSTextView

2018-09-19 Thread Georg Seifert
Thanks for the explanation. I wonder why it supports multiple selection in the first place, when you can do almost nothing with it? Georg > On 19. Sep 2018, at 18:26, Martin Wierschin wrote: > > So far as I know this is not possible with a stock NSTextView. The selected > ra

Re: Typing with multiple selections in NSTextView

2018-09-19 Thread Martin Wierschin
So far as I know this is not possible with a stock NSTextView. The selected range array is automatically normalized by NSTextView, to sort and coalesce ranges as needed. If any zero-length ranges are in a given selection array, only a single zero-length range is allowed and maintained by

Typing with multiple selections in NSTextView

2018-09-19 Thread Georg Seifert
Hi Is it possible to make NSTextView to allow typing with multiple insertion points? One can set multiple selection and delete all of them at once. But typing only replaces the first range and ignores the other ranges. Thanks Georg ___ Cocoa-dev

Re: ncurses type wrapper for NStextview

2017-03-06 Thread Jens Alfke
> On Mar 6, 2017, at 1:43 PM, Julie Porter wrote: > > I was surprised that there seems to be no wrapper class to NSTextView to do > simple character cursor positioning equivalent to the Unix nCurses library. A word processor isn’t the same thing as a terminal. They have very dif

Re: ncurses type wrapper for NStextview

2017-03-06 Thread Jonathan Mitchell
> On 6 Mar 2017, at 21:43, Julie Porter wrote: > > I am looking for something much simpler along the lines of > > textmoveto(3,4) > displaytext(Hello World) > This is probably not what you were thinking of but it does provide for positional layout to a pdf view tho

Re: ncurses type wrapper for NStextview

2017-03-06 Thread Saagar Jha
NSTextView is a general purpose text rendering view; as such, since it works with non-proportional fonts, there is no API for drawing characters at a certain position. A solution may be to implement the text drawing manually using some of NSString’s methods, specifically draw(at:withAttributes

ncurses type wrapper for NStextview

2017-03-06 Thread Julie Porter
placed into a NSTextView object. I want to parse and format this returned data (which can contain abstract binary data.) I have code in postscript which can take the captured data and display it by using ANSI Escape codes in terminal. I was surprised that there seems to be no wrapper class to

Re: Typing into a NSTextView and overriding it

2017-02-20 Thread Quincey Morris
key and pressing another key will send a key event for a control character through the text system, and if un-intercepted it may well end up being translated into an ASCII controller character, but many will be intercepted as control or editing functions. For example, this email text is likely a N

Typing into a NSTextView and overriding it

2017-02-20 Thread Daryle Walker
1. How can one type in control characters into a text-view? I mean ASCII range 0 through 31 and 127, not counting horizontal-tab and line-feed. 2. Is there a way to filter out the user from typing (or pasting, etc.) characters you don't want (like NUL)? 3. Is there a way to limit the length of a

Re: NSTextView tab stop count

2016-10-15 Thread tridiak
Ok. Your code works. I think the reason I couldn’t get it to work is when I was using [textView insertText:mas], causing my settings to be overridden. Thanks for help. > On 15/10/2016, at 12:22 PM, Shane Stanley wrote: > > On 15 Oct. 2016, at 12:43 am, tridiak wrote: >> >> This works up to 12

Re: NSTextView tab stop count

2016-10-14 Thread Shane Stanley
On 15 Oct. 2016, at 12:43 am, tridiak wrote: > > This works up to 12. Above that, it sticks to 12. Are you sure you're just not seeing them because the text in some columns is longer than you tab width? I just made a simple example with this: NSMutableAttributedString *mas = [[NSMutableA

Re: NSTextView tab stop count

2016-10-14 Thread Jens Alfke
> On Oct 14, 2016, at 6:43 AM, tridiak wrote: > > How does Xcode & Text Wrangler pull it off? Xcode pretty heavily customizes the Cocoa text engine; even back in the ProjectBuilder days they had a bunch of custom editing subclasses. I wouldn’t be surprised if they implement their own tabbing

NSTextView tab stop count

2016-10-14 Thread tridiak
Why can’t I use more than 12 tab stops in NSTextView (enclosed by a standard NSScrollView)? I can use less, but I need significantly more. Is it to do with the ruler? NSMutableParagraphStyle *style = [[NSMutableParagraphStyle alloc] init]; NSMutableArray* ma=[NSMutableArray array]; for (int t=0

Re: NSTextView read real text content (without 0xA added by wordwrap)

2016-09-27 Thread Felipe Monteiro de Carvalho
Hello, Sorry for the noise, it turns out that the bug was in my software after all! thanks, -- Felipe Monteiro de Carvalho ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Con

Re: NSTextView read real text content (without 0xA added by wordwrap)

2016-09-27 Thread Jens Alfke
> On Sep 27, 2016, at 2:07 AM, Graham Cox wrote: > > Are you sure about that? I’ve never seen the text view add line endings to > the underlying raw text - that’s just not how text layout works. +1. I’ve been using NSTextView since 2001 and I know for a fact that it doesn’t

Re: NSTextView read real text content (without 0xA added by wordwrap)

2016-09-27 Thread Graham Cox
> On 27 Sep 2016, at 7:28 PM, Felipe Monteiro de Carvalho > wrote: > > By the way, not sure if this makes a difference, but the original text > was added via NSTextView.string > > It is not text inputted by the user. > Well, a NSTextView can’t have a string unles

Re: NSTextView read real text content (without 0xA added by wordwrap)

2016-09-27 Thread Graham Cox
> On 27 Sep 2016, at 7:26 PM, Felipe Monteiro de Carvalho > wrote: > > But to be sure I will test the same thing as you are testing, you are > reading the text via NSTextView.string ? Yes. I set up a very simple situation where the NSTextView’s delegate simply logs the textView.string as I t

Re: NSTextView read real text content (without 0xA added by wordwrap)

2016-09-27 Thread Felipe Monteiro de Carvalho
On Tue, Sep 27, 2016 at 11:26 AM, Felipe Monteiro de Carvalho wrote: > But to be sure I will test the same thing as you are testing, you are > reading the text via NSTextView.string ? By the way, not sure if this makes a difference, but the original text was added via NSTextView.string It is not

Re: NSTextView read real text content (without 0xA added by wordwrap)

2016-09-27 Thread Felipe Monteiro de Carvalho
On Tue, Sep 27, 2016 at 11:07 AM, Graham Cox wrote: > Are you sure about that? I’ve never seen the text view add line endings to > the underlying raw text - that’s just not how text layout works. > (Indeed I just made a quick test case and I don’t see that happening). What I am writing is a larg

Re: NSTextView read real text content (without 0xA added by wordwrap)

2016-09-27 Thread Graham Cox
> On 27 Sep 2016, at 5:31 PM, Felipe Monteiro de Carvalho > wrote: > > But the resulting string contains line endings which are added in the > places where the word-wrap takes places, and I need the raw text, > without such added line endings. Are you sure about that? I’ve never seen the text

NSTextView read real text content (without 0xA added by wordwrap)

2016-09-27 Thread Felipe Monteiro de Carvalho
Hello, I have a normal NSTextView and I would like to programatically read the text inside it. This is trivial, just call txt.string or txt.textContainer.string But the resulting string contains line endings which are added in the places where the word-wrap takes places, and I need the raw text

Re: NSTextView pagination

2016-07-07 Thread Graham Cox
> On 8 Jul 2016, at 2:42 AM, Jonathan Mitchell wrote: > > could supply a new view that would correspond to the new page orientation (if > I could get an appropriate notification) but NSPrintOperation’s -view > is readonly. Do it this way. The textview can share the same NSTextStorage a

NSTextView pagination

2016-07-07 Thread Jonathan Mitchell
Is there a recommended way to change the content of an NSTextView subclass during an NSPrintOperation preview? My subclass needs to adjust its content depending on the NSPrintInfo page orientation. Drawing into the margin with NSView -drawPageBorderWithSize: is not an appropriate solution in

Re: unicode fraction symbol in a NSTextView

2016-06-22 Thread tridiak
gt; Copied from another project which uses an html document to be inserted into the NSTextView. This project did have a database which did not have an HTML layout field and I forgot to change to NSAttributedString(string:s). Found another DB which has an HTML data field (after I posted the original

unicode fraction symbol in a NSTextView

2016-06-22 Thread Aandi Inston
of one-half? It is c2bd. So this seems the classic case of interpreting UTF-8 as ISO-8859-1. Where that is happening is for you to find, but my bet is that it is later than you think. On 22 June 2016 at 17:32, tridiak > wrote: > I am setting some text to a NSTextView which includ

Re: unicode fraction symbol in a NSTextView

2016-06-22 Thread Steve Christensen
unless you're doing some extra formatting not shown in your code snippet, is there any reason you wouldn't be initializing ats with NSAttributedString(string:s)? > On Jun 22, 2016, at 9:32 AM, tridiak wrote: > > I am setting some text to a NSTextView which includes the ‘½

Re: unicode fraction symbol in a NSTextView

2016-06-22 Thread Paul Scott
> On Jun 22, 2016, at 9:32 AM, tridiak wrote: > > I am setting some text to a NSTextView which includes the ‘½’ character. > > s = name + “ CR " > switch (CR) { >case 0.5: >s=s+”½” // \u{00bd} >case 0.33: >s=s+"⅓" >ca

Re: unicode fraction symbol in a NSTextView

2016-06-22 Thread Quincey Morris
On Jun 22, 2016, at 09:32 , tridiak wrote: > > What I see is 'Aasimar CR ½’ instead of 'Aasimar CR ½’. > Where is the ‘Â' coming from? Well, the first thing you need to determine is whether this is the value of ’s’ itself, or the result of interpreting ’s’ as HTML. ___

unicode fraction symbol in a NSTextView

2016-06-22 Thread tridiak
I am setting some text to a NSTextView which includes the ‘½’ character. s = name + “ CR " switch (CR) { case 0.5: s=s+”½” // \u{00bd} case 0.33: s=s+"⅓" case 0.25: s=s+"¼" case

Re: Set font on NSTextView that uses bindings?

2016-05-19 Thread Rick Mann
that the bindings mechanism is then able to > replace that text while preserving the font. I have the rich text option > turned off, and I'm using the Value binding of the NSTextView. > > Suggestion 2: I found a different kludge that I used 5 years ago where I send > setFon

Re: Set font on NSTextView that uses bindings?

2016-05-19 Thread Andy Lee
sm is then able to replace that text while preserving the font. I have the rich text option turned off, and I'm using the Value binding of the NSTextView. Suggestion 2: I found a different kludge that I used 5 years ago where I send setFont: to the text view, in code.. Haven't retested

Re: Set font on NSTextView that uses bindings?

2016-05-19 Thread Jonathan Mitchell
> On 19 May 2016, at 04:47, Rick Mann wrote: > > I seem to be unable to set the font used in an NSTextView that uses bindings > to set the text content. The property it's bound to creates a plain NSString > (no attributes). > > I've tried setting the font

Set font on NSTextView that uses bindings?

2016-05-18 Thread Rick Mann
I seem to be unable to set the font used in an NSTextView that uses bindings to set the text content. The property it's bound to creates a plain NSString (no attributes). I've tried setting the font, setting the typing attributes, setting the font on textStorage, all to no avail.

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

2016-04-27 Thread Dave
> On 27 Apr 2016, at 09:01, Martin Wierschin wrote: > > This code is never going to work: > >> [[myTextView textStorage] addAttribute:NSParagraphStyleAttributeName >> value:[NSNumber numberWithInt:NSLineBreakByTruncatingTail] range:myRange]; >> >> But this results in nothing being displayed i

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

2016-04-27 Thread Martin Wierschin
This code is never going to work: > [[myTextView textStorage] addAttribute:NSParagraphStyleAttributeName > value:[NSNumber numberWithInt:NSLineBreakByTruncatingTail] range:myRange]; > > But this results in nothing being displayed in the ScrollView/TextView. In fact, using that code probably thr

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. __

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. [[theTextVie

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

2016-04-26 Thread Dave
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: > >

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 <https://www.google.com/search?client=safari&rls=en&q=how+to+prevent+nstextview+from+

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

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 truncat

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

2016-04-25 Thread Graham Cox
> On 26 Apr 2016, at 2:08 AM, Dave wrote: > > If anyone knows the secret please let me know! Set the associated text container to an extremely wide width. The text won’t wrap unless there’s a line break. —Graham ___ Cocoa-dev mailing list (Coco

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

2016-04-25 Thread Dave
I tried the following: myTextView = [self documentView]; [[[myTextView textStorage] mutableString] appendString:theString]; myRange = NSMakeRange(0,[[[myTextView textStorage] mutableString] length] - 1); [[myTextView textStorage] addAttribute:NSParagraphStyleAttributeName value:[NSNumber numberW

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

2016-04-25 Thread Dave
Hi Bill, 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. I’m just appending an NSString to the Docum

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

2016-04-25 Thread Bill Cheeseman
> On Apr 25, 2016, at 6:48 AM, Dave wrote: > > I can’t believe its this hard to set wrapping or not and I can’t find real > info on this from searching either. For your purposes, the key point is that NSTextStorage is a subclass of NSMutableAttributedString, which is in turn a subclass of NS

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

2016-04-25 Thread Dave
I’ve found the Text Storage like this: NSTextStorage* myTextStorage; myTextStorage = [[self.pLogScrollView documentView] textStorage]; > You can control trucation behavior in an NSTextView by using NSTextStorage, > which is a subclass of NSMutableAttributedString. The trun

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

2016-04-24 Thread Bill Cheeseman
> On Apr 24, 2016, at 1:13 PM, Dave wrote: > > I’ve got the Text View Selected in XCode/IB and I can’t find any option for > “Layout” in any of the property tabs? Auto-layout is off at the moment for > this window, it wouldn’t have anything to do with that would it? I was describing text fiel

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

2016-04-24 Thread Dave
Hi, > On 24 Apr 2016, at 17:29, Bill Cheeseman wrote: > > >> On Apr 24, 2016, at 12:04 PM, Dave > <mailto:d...@looktowindward.com>> wrote: >> >> I’m not sure what you mean? Is this a method or property on NSScrollView or >> NSTextView? >>

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

2016-04-24 Thread Bill Cheeseman
> On Apr 24, 2016, at 12:04 PM, Dave wrote: > > I’m not sure what you mean? Is this a method or property on NSScrollView or > NSTextView? > > I can’t see it in the XIB file? In an NSTextField, IB shows you the "Layout" pop-up menu, which includes a "tru

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

2016-04-24 Thread Dave
Hi, I’m not sure what you mean? Is this a method or property on NSScrollView or NSTextView? I can’t see it in the XIB file? Cheers Davw > On 24 Apr 2016, at 16:58, Andreas Mayer wrote: > > >> Am 24.04.2016 um 17:15 schrieb Dave : >> >> I have an NSTextView

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

2016-04-24 Thread Andreas Mayer
> Am 24.04.2016 um 17:15 schrieb Dave : > > I have an NSTextView inside an NSScrollView. At present the Text Lines is > wrapped if they are longer than the Scroll View, I'd them to truncate. I had > thought I’d seen some properties somewhere for doing this but I can’

How to Truncate lines in NSScrollView/NSClipView/NSTextView Combo

2016-04-24 Thread Dave
Hi All, I know this has been covered before but I can’t for the life of me find it by searching. I have an NSTextView inside an NSScrollView. At present the Text Lines is wrapped if they are longer than the Scroll View, I'd them to truncate. I had thought I’d seen some properties some

Re: output string like a teleprinter (NSTextView)

2015-12-18 Thread Graham Cox
> On 18 Dec 2015, at 8:37 PM, sqwarqDev wrote: > > I’m pretty sure I didn’t use a timer (see below). > I wasn’t really trying to second-guess how you might have done this in the past; more, I was suggesting how you could do it without having “discovered” this effect previously. It definitel

Re: output string like a teleprinter (NSTextView)

2015-12-18 Thread sqwarqDev
> On 18 Dec 2015, at 06:34, Graham Cox wrote: > > If it happened accidentally it was most likely due to setting up a situation > that caused extreme low performance No, it wasn’t. > You could just gradually add characters from the original string to a > ‘display’ string using a timer and

Re: output string like a teleprinter (NSTextView)

2015-12-17 Thread Graham Cox
> On 18 Dec 2015, at 1:49 AM, sqwarqDev wrote: > > A couple of years ago I was messing around with NSTextView and NSTextStorage > and accidentally ended up with a method that printed my string (could have > been attributed string) to my textview one character at a time, rather

output string like a teleprinter (NSTextView)

2015-12-17 Thread sqwarqDev
A couple of years ago I was messing around with NSTextView and NSTextStorage and accidentally ended up with a method that printed my string (could have been attributed string) to my textview one character at a time, rather like an old fashioned teleprinter. At the time, that wasn’t the effect

Re: NSTextView Question

2015-09-08 Thread Dave
= NO; All the Best Dave > On 8 Sep 2015, at 16:17, Ken Thomases wrote: > > On Sep 8, 2015, at 9:22 AM, Dave wrote: > >> I’ve got an NSTextView that’s working in that it Scrolls ok vertically, but >> If I have a long line, it wraps instead of clipping the line and

Re: NSTextView Question

2015-09-08 Thread Ken Thomases
On Sep 8, 2015, at 9:22 AM, Dave wrote: > I’ve got an NSTextView that’s working in that it Scrolls ok vertically, but > If I have a long line, it wraps instead of clipping the line and allowing > Horizontal Scrolling. I’ve looked at the properties of the ScrollView and the >

Re: NSTextView Question

2015-09-08 Thread Dave
Hi, Having thought about it a bit more, I think I understand, the problem was that the data I wish to display has two types of data embedded in it. The first type is more of a NSTextView in that it should wrap as necessary as the Text Box Frame changes size and another type that is a list, e.g

NSTextView Question

2015-09-08 Thread Dave
Hi All, I’ve got an NSTextView that’s working in that it Scrolls ok vertically, but If I have a long line, it wraps instead of clipping the line and allowing Horizontal Scrolling. I’ve looked at the properties of the ScrollView and the underlying TextView but I can see no option to have it

Re: Strange behavior of view based NSTableView with NSTextView

2015-07-18 Thread Jonathan Mitchell
wWithIdentifier: > @"FirstColumnCellView" owner:tableView]; > > NSTextView *view = [[[tableCellView subviews][0] subviews][0] > subviews][0]; > > view.string = [NSString stringWithString:self.entries[row]]; > > view.delegate = self; > > &g

Strange behavior of view based NSTableView with NSTextView

2015-07-18 Thread Nick
Hello I am trying to debug a problem in NSTableView but i can't figure out what is the cause. Basically I have a View-based NSTableView (the view is NSTextView), and I would like to be able to add and remove rows to the table using buttons, and also allow the user to edit the textview that

NSTextView + NSTextTable print pagination query

2015-05-29 Thread Jonathan Mitchell
I am printing my NSTableView by constructing an NSTextTable attributed string representation and storing that into an NSTextView. This works great and it paginates correctly :i.e.: table rows don’t get split between pages. My NSTextTable has a header row and this is output at the start of each

Re: NSTextView Copy-and-Paste Problem

2015-03-02 Thread Charles Jenkins
e, but from what I saw, the behavior is expected. You’re applying custom keys to the NSTextView/NSTextStorage that will not be serialized when copy-pasting. By default when you select some text in NSTextView and trigger a copy action, the selected text will be vended on the pasteboard via some

Re: NSTextView Copy-and-Paste Problem

2015-03-02 Thread Martin Wierschin
ld leave you with a > consistent set of attributes. … > I’d like to know if this behavior is expected or a bug I didn’t look long at your code, but from what I saw, the behavior is expected. You’re applying custom keys to the NSTextView/NSTextStorage that will not be serialized when copy-pas

Force a find in an NSTextView

2015-03-02 Thread Fritz Anderson
Target OS X 10.10. How does a view controller force an NSTextView to perform a search if it doesn’t own the text view? My application is a debugging tool to break an attributed string into style runs and display the runs in a table. I’d like to double-click a row in the table, and select

Re: NSTextView Copy-and-Paste Problem

2015-03-02 Thread Charles Jenkins
Can I convince anyone to look at my demo app and tell me what if anything I'm doing wrong? I can hardly believe copying and pasting in a text view would lose or replace attributes like this . . . seems like a very serious bug someone would have noticed long before me. --  Charles On February

NSTextView Copy-and-Paste Problem

2015-02-28 Thread Charles Jenkins
I’m having problems with text attributes getting mangled by copy-and-paste operations within the selfsame text view. Obviously text pasted in from outside the app would have an unpredictable set of attributes, but you’d think copying and pasting in the same text view would leave you with a consi

Few questions about NSTextView

2014-12-22 Thread ecir hana
Hi! I'm trying to work with NSTextView but in the course of my learning I encountered several behaviors which I cannot understand why they are happening. Please, I would greatly appreciate if someone could explain in a few words why do they behave like they do and how to achieve the opp

Re: NSTextView and Syntax Highlighting

2014-12-20 Thread Charles Jenkins
ensureGlyphsForCharacterRange: in order to synch up the layout manager with the current content of text storage. I took that and ran with it. Here is the resulting code that works for me, which I donate to the public domain in case anyone else finds it useful. The methods below are found in a subclass of NSTextView

Re: NSTextView and Syntax Highlighting

2014-12-19 Thread Martin Hewitson
I’m using temporary attributes for TeXnicle (LaTeX editor), but as others have said, it doesn’t work if you need bold etc. Anyway, you can see the source at github: https://github.com/martinhewitson/TeXnicle You need to look in TeXnicle/TeXnicle/TeXEditor/TextView/TeXColoringEngine.m Origina

Re: NSTextView and Syntax Highlighting

2014-12-19 Thread ecir hana
On Fri, Dec 19, 2014 at 6:58 PM, Quincey Morris < quinceymor...@rivergatesoftware.com> wrote: > On Dec 19, 2014, at 05:36 , Charles Jenkins wrote: > > > > Could it be that even though the layout manager's temporary attributes > are designed for purposes like syntax highlighting, folks don't actua

Re: NSTextView and Syntax Highlighting

2014-12-19 Thread Quincey Morris
On Dec 19, 2014, at 05:36 , Charles Jenkins wrote: > > Could it be that even though the layout manager's temporary attributes are > designed for purposes like syntax highlighting, folks don't actually use them > because they don't work right during edits? I tried to use them once for underli

Re: NSTextView and Syntax Highlighting

2014-12-19 Thread Charles Jenkins
03, Charles Jenkins wrote: > In my text-editing app, there are some special characters I’d like to > highlight whenever they are entered. I developed a function for this purpose, > found in my subclass of NSTextView: > > -(void)setTemporaryAttributes:(NSDictionary*)attributes &g

NSTextView and Syntax Highlighting

2014-12-17 Thread Charles Jenkins
In my text-editing app, there are some special characters I’d like to highlight whenever they are entered. I developed a function for this purpose, found in my subclass of NSTextView: -(void)setTemporaryAttributes:(NSDictionary*)attributes forSpecialCharacters:(NSCharacterSet*)set

Re: NSTableView inside NSTextView

2014-10-17 Thread Ulf Dunkel
Lee Ann, thank you for pointing me to the TextEdit sources which I had already checked. They do not even contain the terms "NSTable" or "NSTextTable" at all. TextEdit seems to keep all text content in a simple NSTextView. They just added the system method -orderFrontTa

RE: NSTableView inside NSTextView

2014-10-16 Thread Lee Ann Rucker
mware@lists.apple.com] on behalf of Ulf Dunkel [dun...@calamus.net] Sent: Thursday, October 16, 2014 5:13 AM To: Cocoa Development Subject: NSTableView inside NSTextView When I place a table (NSTableView) in an TextEdit document, I can easily resize the column width of any table column using the mouse pointer,

Re: NSTableView inside NSTextView

2014-10-16 Thread Charles Jenkins
ew, right? > > - - - - - > > Am 16.10.2014 um 14:41 schrieb Charles Jenkins: > > Ulf, > > > > As you can see from my text view struggles, I’m no expert, but I don’t > > think you’ll have a lot of success trying to stick an NSTableView into > > an NSTextView

Re: NSTableView inside NSTextView

2014-10-16 Thread Ulf Dunkel
NSTextView. The kind of table you put inside a text view is a different animal: really just a fancy attributed string the text system knows how to display and manipulate as a table. Check out https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/TextLayout/Articles/TextTables.html

Re: NSTableView inside NSTextView

2014-10-16 Thread Charles Jenkins
Ulf, As you can see from my text view struggles, I’m no expert, but I don’t think you’ll have a lot of success trying to stick an NSTableView into an NSTextView. The kind of table you put inside a text view is a different animal: really just a fancy attributed string the text system knows

NSTableView inside NSTextView

2014-10-16 Thread Ulf Dunkel
When I place a table (NSTableView) in an TextEdit document, I can easily resize the column width of any table column using the mouse pointer, just by dragging the column border lines to and fro. In my app, I want to use the same tables (NSTableView), but inside NSTextView containers in a

Re: Questions on using a NSTextView as a source viewer.

2014-10-11 Thread Ken Thomases
On Oct 11, 2014, at 9:23 AM, Keary Suska wrote: > On Oct 11, 2014, at 3:53 AM, Daryle Walker wrote: > >> On Oct 10, 2014, at 1:58 AM, Ken Thomases wrote: >> >>> I tested this and it worked for me. In summary, all three steps: >>> >>> * Set the text view's max. width >>> * Set the text view

Re: Questions on using a NSTextView as a source viewer.

2014-10-11 Thread Keary Suska
On Oct 11, 2014, at 1:31 PM, Daryle Walker wrote: > There was a minor detour where I just had “textContainer.containerSize” set. > You need BOTH “containerSize” and “widthTracksTextView” set (to {10M, 10M} > and NO, respectively). Both of these can be set in the user-defined run-time > attribu

Re: Questions on using a NSTextView as a source viewer.

2014-10-11 Thread Daryle Walker
On Oct 11, 2014, at 10:23 AM, Keary Suska wrote: > On Oct 11, 2014, at 3:53 AM, Daryle Walker wrote: > >> On Oct 10, 2014, at 1:58 AM, Ken Thomases wrote: >> >>> On Oct 10, 2014, at 12:02 AM, Daryle Walker wrote: >>> On Oct 7, 2014, at 8:03 PM, Ken Thomases wrote: > On Oct 7

Re: Questions on using a NSTextView as a source viewer.

2014-10-11 Thread Keary Suska
On Oct 11, 2014, at 3:53 AM, Daryle Walker wrote: > On Oct 10, 2014, at 1:58 AM, Ken Thomases wrote: > >> On Oct 10, 2014, at 12:02 AM, Daryle Walker wrote: >> >>> On Oct 7, 2014, at 8:03 PM, Ken Thomases wrote: >>> On Oct 7, 2014, at 5:29 PM, Daryle Walker wrote: > 1. Altho

Re: Questions on using a NSTextView as a source viewer.

2014-10-11 Thread Daryle Walker
On Oct 10, 2014, at 1:58 AM, Ken Thomases wrote: > On Oct 10, 2014, at 12:02 AM, Daryle Walker wrote: > >> On Oct 7, 2014, at 8:03 PM, Ken Thomases wrote: >> >>> On Oct 7, 2014, at 5:29 PM, Daryle Walker wrote: >>> 1. Although the text in the window expands vertically as needed, it nev

Re: Questions on using a NSTextView as a source viewer.

2014-10-09 Thread Ken Thomases
On Oct 10, 2014, at 12:02 AM, Daryle Walker wrote: > On Oct 7, 2014, at 8:03 PM, Ken Thomases wrote: > >> On Oct 7, 2014, at 5:29 PM, Daryle Walker wrote: >> >>> 1. Although the text in the window expands vertically as needed, it never >>> does horizontally. Wrapping always happens when line

Re: Questions on using a NSTextView as a source viewer.

2014-10-09 Thread Daryle Walker
On Oct 7, 2014, at 8:03 PM, Ken Thomases wrote: > On Oct 7, 2014, at 5:29 PM, Daryle Walker wrote: > >> 1. Although the text in the window expands vertically as needed, it never >> does horizontally. Wrapping always happens when lines are too long, but it >> adjusts as the width of the window

Re: Questions on using a NSTextView as a source viewer.

2014-10-07 Thread Ken Thomases
On Oct 7, 2014, at 5:29 PM, Daryle Walker wrote: > 1. Although the text in the window expands vertically as needed, it never > does horizontally. Wrapping always happens when lines are too long, but it > adjusts as the width of the window is changed. How do I get “infinite” space > horizontall

  1   2   3   4   5   6   7   8   9   10   >