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:) <https://developer.apple.com/reference/foundation/nsstring/1533109-draw>.
Saagar Jha > On Mar 6, 2017, at 13:43, Julie Porter <jpor...@delectra.com> wrote: > > It has been a while since I asked anything here. Most of the scripting I do > is in PostScript using the ghostscript interpreter. > > Occasionally I convert my postscript code to Objective C/Quartz. This works > really well for graphical output as Quarts drawing is just postscript > backward. > > I now have an objective C application that is built on the Arduino Serial > Example code that was on the Arduino website. This uses IOKit to open a > serial port. I modified this code to create some button functions. That > send text command strings to the Arduino. The Arduino returns data which gets > 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 NSTextView to do > simple character cursor positioning equivalent to the Unix nCurses library. > > I spent the morning using a popular search engine with variations of the > following search terms. (note all the exclusions to avoid phone related hits.) > > '"objective c" NStextview write text at row column position like ncurses move > -ios -iphone -NSTableView -UITableView -UITextView' > > The best I could find was a full blown terminal editor program called iTerm2 > I am looking for something much simpler along the lines of > > textmoveto(3,4) > displaytext(Hello World) > > Most of the example form editors seem to be based on NSTableView which I find > overly complex. The cursor positioning search hits relate to mouse pointers. > > There are a number of command line examples that should run in terminal. > This makes it awkward as the drop down menu is needed given that Ardino > serial devices show up in the /dev folder with unique serialize names. It > is also convenient to have the user buttons that can send the command > shortcuts to the Arduino. > > > > _______________________________________________ > > 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/saagar%40saagarjha.com > > This email sent to saa...@saagarjha.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