Re: NSRulerMarker question

2012-11-22 Thread Ross Carter
On Nov 21, 2012, at 8:22 PM, Graham Cox graham@bigpond.com wrote: The standard NSRulerMarker draws a black line in the client view as it is dragged. This comes 'for free' but I wonder how on earth it works. There is also no way to customise it that I can see. I'm wondering if this

Re: enhancing NSTextView for optionally-hidden text

2012-11-21 Thread Ross Carter
Nov 21, 2012, at 2:26 AM, Quincey Morris quinceymor...@rivergatesoftware.com wrote: On Nov 20, 2012, at 21:03 , Kurt Bigler kkbli...@breathsense.com wrote: Given how this view is used, for appending only in the style of an uneditable text log permitting user selections and Copy, the

Re: drawGlyphsForGlyphRange layout issue

2012-09-22 Thread Ross Carter
On Sep 21, 2012, at 8:33 PM, Graham Cox graham@bigpond.com wrote: NSLayoutManager adopts the NSGlyphStorage protocol. That protocol declares a method, -layoutOptions, and one of the flags it can return is NSShowInvisibleGlyphs. Simply returning that flag may be all you need to do. I

Re: drawGlyphsForGlyphRange layout issue

2012-09-21 Thread Ross Carter
On Sep 21, 2012, at 6:54 AM, jonat...@mugginsoft.com jonat...@mugginsoft.com wrote: The following is used to draw a glyph representing a tab character in an NSLayoutManager subclass. When using say the Monaco font everything looks fine. When switching to Menlo however the glyphs drawn in

Re: How to insert a screen-only character in an NSTextView?

2012-09-03 Thread Ross Carter
I think Kyle and William are saying the same thing: leave NSTextStorage alone and adjust the presentation as needed. On Sep 3, 2012, at 6:57 PM, Kyle Sluder k...@ksluder.com wrote: On Sep 3, 2012, at 3:06 PM, William Squires wsqui...@satx.rr.com wrote: This would be better handled with

Re: How to insert a screen-only character in an NSTextView?

2012-09-01 Thread Ross Carter
and 1012 are online. - Koen. On Aug 31, 2012, at 4:55 PM, Ross Carter rosscarter...@me.com wrote: Or a custom NSGlyphGenerator. There was a WWDC session on this a few years back. On Aug 31, 2012, at 2:21 PM, Kyle Sluder k...@ksluder.com wrote

Re: How to insert a screen-only character in an NSTextView?

2012-08-31 Thread Ross Carter
Or a custom NSGlyphGenerator. There was a WWDC session on this a few years back. On Aug 31, 2012, at 2:21 PM, Kyle Sluder k...@ksluder.com wrote: On Fri, Aug 31, 2012, at 08:24 AM, Koen van der Drift wrote: Is it possible to insert character/glyphs in an NSTextView without changing the

Re: How to size a TextView to fit a given line?

2012-08-13 Thread Ross Carter
On Aug 12, 2012, at 5:34 AM, Gerriet M. Denkmann gerr...@mdenkmann.de wrote: In windowWillUseStandardFrame:defaultFrame: in a subclass of NSDocument (which is also the delegate of it's window) I want to set the window to just contain a certain line. -

Re: Dynamic modification of text search results

2012-07-04 Thread Ross Carter
On Jul 4, 2012, at 5:43 PM, Martin Wierschin mar...@nisus.com wrote: Instead, you'll want to use a custom attribute/name, eg: NSString* TPDocumentMatchAttributeName = @TPDocumentMatchAttribute; ... [storage addAttribute:TPDocumentMatchAttributeName value:match

Re: adding space for 'annotations' with a typesetter subclass

2012-06-04 Thread Ross Carter
On Jun 1, 2012, at 9:36 AM, Bill Dudney wrote: I'm able to add additional space around a paragraph in my subclass of NSATSTypesetter's implementation of willSetLineFragmentRect:forGlyphRange:usedRect:baselineOffset:. However, I am not getting what I expect as I tweak the parameters to this

Re: Placeholder text on a multi-line NSTextField

2012-02-29 Thread Ross Carter
Use the delegate method control:textShouldBeginEditing: to set the placeholder string to nil when editing begins, and control:textShouldEndEditing: to restore the placeholder if the text field is empty? On Feb 29, 2012, at 1:23 PM, Geoff Beier wrote: I've opened radar #10954811 about the

Re: Recommended way to present a font preference

2012-02-27 Thread Ross Carter
On Feb 26, 2012, at 8:13 PM, John Brownie wrote: I'm rewriting an existing Carbon application with Cocoa, and am working on the preferences. One preference that the user should be able to set is a default font and size for text display. In the Carbon app, there is a pop-up button with a

Re: Respecting tabs across applications

2012-01-11 Thread Ross Carter
On Jan 10, 2012, at 10:14 PM, James Merkel wrote: the default NSParagraphStyle is being applied to my string. To be precise, a NSParagraphStyle is being applied to your attributed string. The NSString does not contain any formatting information. When you copy rich text, say from TextEdit,

Re: Text system glitch - lines across text view

2011-12-28 Thread Ross Carter
On Dec 25, 2011, at 4:22 PM, Andrew Hughes wrote: NSTextView NSTextContainer NSTextView NSTextContainer NSTextStorage NSTextView NSTextContainer NSView - NSTextView NSTextContainer NSTextView NSTextContainer

Re: NSTextField odd background colour behaviour

2011-12-10 Thread Ross Carter
Just to make sure: are you certain that the text field is not being edited (and therefore obscured by the field editor) when you set the bg color? On Dec 10, 2011, at 3:50 AM, Peter Hudson wrote: Hi All I have an NSTextField in an app. For some years I have set the background colour

Re: NSTextField odd background colour behaviour

2011-12-10 Thread Ross Carter
it ? Peter On 10 Dec 2011, at 15:48, Ross Carter rosscarter...@me.com wrote: Just to make sure: are you certain that the text field is not being edited (and therefore obscured by the field editor) when you set the bg color? On Dec 10, 2011, at 3:50 AM, Peter Hudson wrote: Hi

Re: How to highlight the current line in NSTextView?

2011-11-07 Thread Ross Carter
On Nov 6, 2011, at 12:46 PM, Keary Suska wrote: you should then be able to use lineFragmentUsedRectForGlyphAtIndex:effectiveRange: and passing its return value to -setSelectedRange:. I don't think you want to change the selected range. You just want to draw a background color.

Re: UTI in Lion

2011-09-23 Thread Ross Carter
On Sep 23, 2011, at 11:27 AM, Kyle Sluder wrote: and if the user had the ability to change that recorded value And if the app had the ability to specify the value when the file is created or saved. ___ Cocoa-dev mailing list

Re: Properly wrapping non-contiguous NSTextViews

2011-08-17 Thread Ross Carter
On Aug 16, 2011, at 3:40 PM, Nick Zitzmann wrote: Okay. As I just found out, TextEdit has the same problem as my application, and it turns out it is using almost the same code (I didn't write the original pagination code in the app). To see it for yourself: 1. Download this RTF -

Re: Properly wrapping non-contiguous NSTextViews

2011-08-16 Thread Ross Carter
On Aug 15, 2011, at 6:19 PM, Nick Zitzmann wrote: Of course, if there is a better way of using the Cocoa text system to layout multiple non-contiguous pages of text with margins, I'd like to hear about it. Maybe it'll even solve the problem I'm having. Well, it should just work without any

Re: Properly wrapping non-contiguous NSTextViews

2011-08-16 Thread Ross Carter
On Aug 16, 2011, at 12:59 PM, Nick Zitzmann wrote: On Aug 16, 2011, at 9:09 AM, Ross Carter wrote: On Aug 15, 2011, at 6:19 PM, Nick Zitzmann wrote: Of course, if there is a better way of using the Cocoa text system to layout multiple non-contiguous pages of text with margins, I'd like

Re: Properly wrapping non-contiguous NSTextViews

2011-08-14 Thread Ross Carter
On Aug 13, 2011, at 3:24 PM, Nick Zitzmann wrote: Each text view represents one page of text. None of the text views are embedded in individual scroll views, though all of the text views are subviews of a view that is in a scroll view. Think like a word processing app that shows multiple

Re: Properly wrapping non-contiguous NSTextViews

2011-08-13 Thread Ross Carter
On Aug 12, 2011, at 6:23 PM, Nick Zitzmann wrote: I've got a problem that has been driving me nuts all day. I tried searching around and didn't see anything that helped. I have a series of non-contiguous NSTextViews (not to be confused with non-contiguous NSLayoutManager layout), with

Re: Windows get released on 10.6, leak on 10.7

2011-07-25 Thread Ross Carter
On Jul 21, 2011, at 6:40 PM, Corbin Dunn wrote: Log the address of your object. Then, break in gdb and do: info gc-roots address Then see what is rooting it. also, try gc-references in it to see what references it, but roots are more important. Thanks, Corbin. I'm trying to understand

Windows get released on 10.6, leak on 10.7

2011-07-21 Thread Ross Carter
I'm looking for ideas on what might cause this behavior: an existing app that was compiled with 10.6 SDK runs fine on 10.6 and 10.5. When run on 10.7, document windows (and their window controllers and NSDocuments) do not get released when the window is closed. All thoughts appreciated.

Re: Windows get released on 10.6, leak on 10.7

2011-07-21 Thread Ross Carter
Just a long shot, but does this have anything to do with the new ARC (Automatic Reference Counting)? Joanna: The app uses GC, and was built long before ARC was announced. Everything gets collected on 10.6. I'm puzzled how ARC could affect GC. Have you used Instruments to find out why? If

Re: Resizing custom subclassed NSTextView

2011-06-09 Thread Ross Carter
On Jun 9, 2011, at 6:11 AM, Joe White wrote: I think it would solve all my problems if I was able to do auto-completion, etc... with NSTextField. I don't have enough knowledge of the Cocoa API to make an informed decision yet. If you are not familiar with the field editor, I recommend you

Re: Resizing custom subclassed NSTextView

2011-06-08 Thread Ross Carter
On Jun 6, 2011, at 6:29 PM, Joe White wrote: Hi, I currently have a custom subclassed NSTextView as a subview of an NSView (which is its delegate). I'm trying to to dynamically resize the minimum width of the NSTextView based on the string input so that view resizes to fit (the height is

Re: Resizing custom subclassed NSTextView

2011-06-08 Thread Ross Carter
On Jun 8, 2011, at 7:19 PM, Joe White wrote: Basically, the interface is separate editable objects that are usually single symbols with a few arguments included. This means that the each object is always one line high and usually not that wide. I started off using NSTextField (which I

Re: Why does NSArray count return NSUInteger?

2011-05-30 Thread Ross Carter
On May 30, 2011, at 9:38 PM, Graham Cox wrote: On 31/05/2011, at 11:06 AM, koko wrote: Nothing but mental masturbation ... give it a rest ... moderator, do your job, please. Get out of bed the wrong side today? Quincey is one of the most helpful contributors on the list; you might

Re: brushing up my skills/knowledge

2011-05-25 Thread Ross Carter
On May 24, 2011, at 1:41 PM, Koen van der Drift wrote: I did some Cocoa/ObjC coding several years ago, but haven't really touched it since. I want to dive back in, and am looking for resources to brush up my knowledge, especially related to subjects like CoreData, CoreAnimation, etc. Besides

Re: Incremental parsing/highlighting in an NSTextView via shouldChangeTextInRange delegate method

2011-05-20 Thread Ross Carter
On May 19, 2011, at 1:23 PM, Martin Schürrer wrote: I want to highlight @mentions, #hashtags and links in an NSTextView as the user types. I've been thinking I'd implement this via the shouldChangeTextInRange delegate method. My plan is as follows: I'm going to construct the new string

Re: NSLayoutManager didCompleteLayout callback NSFormFeedCharacter

2011-05-16 Thread Ross Carter
In my opinion, using layoutManager:didCompleteLayoutForTextContainer:atEnd is fraught with danger and should be avoided. Most of the time, it does not not provide truly useful information and you cannot rely on layout being complete even if the flag is YES. If you open a new page-wrapped

Re: NSTextView and NSTextContainer size clipping area

2011-05-08 Thread Ross Carter
- - (void) setFrameSize:(NSSize)newSize { [super setFrameSize:newSize]; NSTextContainer *container = [self textContainer]; newSize.width -= 200; [container setContainerSize:newSize]; } 08.05.2011, в 5:53, Ross Carter написал(а): We need to see your code

Re: NSTextView and NSTextContainer size clipping area

2011-05-07 Thread Ross Carter
of text container too. 06.05.2011, в 22:56, Ross Carter написал(а): On May 6, 2011, at 2:40 AM, Дмитрий Николаев wrote: If there are any possibility to draw inside text view but outside of text container ? It depends on who is doing the drawing. NSTextView is an NSView subclass

Re: NSTextView and NSTextContainer size clipping area

2011-05-06 Thread Ross Carter
On May 6, 2011, at 2:40 AM, Дмитрий Николаев wrote: If there are any possibility to draw inside text view but outside of text container ? It depends on who is doing the drawing. NSTextView is an NSView subclass and you can override drawRect: just like any NSView. The Cocoa text system,

Re: NSTextView with custom space width

2011-04-21 Thread Ross Carter
On Apr 21, 2011, at 6:35 AM, Michael Dautermann wrote: On Apr 18, 2011, at 5:37 AM, Дмитрий Николаев wrote: I need to implement custom separator with custom width between two part of paragraph in text view: AA A BBB B B This is separator must be included as non-editable

Re: Looking for help scanning entire drives

2011-02-23 Thread Ross Carter
On Feb 23, 2011, at 12:37 PM, Andreas Grosam wrote: If there is no appropriate free or commercial tool which could solve your problem already . . . I haven't tried it myself, but you might look at the FolderSweep source code from Rainer Brockerhoff and Matt Gemmell.

Re: NSTextAttachment, MouseOver, GlyphPosition

2011-02-21 Thread Ross Carter
On Feb 19, 2011, at 12:49 PM, Peter Krajčík wrote: What is a proper way to get cellFrame for NSTextAttachmentCell (or to be more general, position of glyph in NSAttributedString) that is inserted to NSAttributedString or drawn by NSTextFieldCell? If you have subclassed NSTextAttachmentCell,

Re: Nib not awoken

2011-02-15 Thread Ross Carter
On Feb 15, 2011, at 10:49 AM, Bruce Cresanta wrote: I am using an NSDocument based application and I'm having trouble with the following code: -(void) analyzePressed { NSString * raw = [[[NSString alloc] initWithBytes:[pageData bytes] length:[pageData length] encoding:

Re: Help Book authoring tool?

2011-01-31 Thread Ross Carter
On Jan 30, 2011, at 2:03 PM, Luc Van Bogaert wrote: Hello, I would like to solicite some recommendations for an authoring tool to create help books. I'm looking for a preferably freeware application, with a decent html editor. Well, there is Helpify, which uses Omni Outliner. Personally,

Re: NSTableView selecting text within a cell

2011-01-31 Thread Ross Carter
On Jan 31, 2011, at 12:30 AM, Ben Golding wrote: I have an app with a NSTableView where the data is presented to the user. When the user hits Find, I'd like to be able to scroll the table view to the visible cell (easy enough) and then select the range that matched within that field (not

Re: text orientation/positioning with layout manager

2011-01-31 Thread Ross Carter
On Jan 31, 2011, at 10:53 PM, David F. wrote: So why aren't glyphs drawn upside-down when the context hasn't been flipped?! Why do you think they should be upside down? Flippedness is implicated in determining the origin point of the text container. Text containers themselves are always

Re: text orientation/positioning with layout manager

2011-01-31 Thread Ross Carter
On Jan 31, 2011, at 9:04 PM, Todd Heberlein wrote: For now, if I want my string drawn on a base line beginning at the point basePoint, I currently define a glyphPoint which subtracts the font's pointSize from the basePoint's Y value. So far it seems to work on a variety of font sizes. Are

Re: Drawers on windows...

2010-11-30 Thread Ross Carter
On Nov 30, 2010, at 4:29 PM, Sherm Pendley wrote: On Tue, Nov 30, 2010 at 4:06 PM, lbland lbl...@vvi.com wrote: When drawers first came out they were all the rage. Then they went out of favor by some, so much so I thought they would be depreciated. But, it seems like drawers are sticking

NSXMLParser chokes on DTD declaration

2010-11-28 Thread Ross Carter
If I use NSXMLParser (on 10.6.5) to parse xml data that looks like this: ?xml version=1.0 encoding=UTF-8 standalone=no ? !DOCTYPE docData SYSTEM docData.dtd docData [elements omitted] /docData and if I have sent the parser a setShouldResolveExternalEntities:YES message, I would expect

Re: Keeping data in sync across Mac and iPhone

2010-11-24 Thread Ross Carter
On Nov 24, 2010, at 12:48 PM, Nick Zitzmann wrote: On Nov 24, 2010, at 9:28 AM, Lorenzo Thurman wrote: I have a customer request to sync application preferences between Macs and iPhone. The user may not have a MobileMe account, so Sync Services is not an option (or is it?). Sadly, it

Re: NSTextView vs NSTextField

2010-11-11 Thread Ross Carter
If so and if I am programmatically creating one of these controls, is there any reason why I would want to use a NSTextField? (I know that IB uses a NSTextField for Labels, for example...is this just a historical artifact?) For editing multiple strings it is more efficient to have multiple

Re: NSTextFieldCell multi-line

2010-11-09 Thread Ross Carter
On Nov 9, 2010, at 4:45 AM, Micha Fuhrmann wrote: Thanks for your respons, but I need the exacte size in points, which means drawing with the right Font etc. So here's where I am in - (CGFloat)tableView:(NSTableView *)tableView heightOfRow:(NSInteger)row I'm calling a function

Re: Choosing a correct font size when resizing

2010-10-26 Thread Ross Carter
On Oct 26, 2010, at 10:29 AM, Alexander Cohen wrote: I have a specific layout that has known font sizes for certain page dimensions. I need to take that layout and resize it to fit it in multiple different places in my app. I can't just apply that resize ratio to the fonts, it just does

Where is SimpleTextInput sample code project?

2010-10-08 Thread Ross Carter
Text and Web Programming Guide for iOS (http://developer.apple.com/library/ios/#documentation/StringsTextFonts/Conceptual/TextAndWebiPhoneOS/CustomTextProcessing/CustomTextProcessing.html) says: The code was taken from the SimpleTextInput sample code project. Does that sample code project

Re: Cocoa Text System - Temporarily Disabling Layout

2010-09-24 Thread Ross Carter
Yeah I have line numbers views set up in all of this too, for which I have to set the width before I set the strings of the text views so you don't see the views resizing on first load if the line numbers aren't wide enough to accommodate the number of lines in the new string. Resizing the

Re: Cocoa Text System - Temporarily Disabling Layout

2010-09-23 Thread Ross Carter
Maybe, to disable layout, set the textview's textContainer to nil, then restore it to enable layout? On Sep 23, 2010, at 7:54 AM, Jonathan Dann j.p.d...@gmail.com wrote: Hi all, In our app, Kaleidoscope, I have 2 text views side-by-side. In one configuration the layout of the text in each

Re: NSAttributedString to / from Pasteboard....

2010-09-07 Thread Ross Carter
On Sep 7, 2010, at 9:43 AM, Kartik Reddyreddy wrote: Is there a way to push/pop an NSAttributedString to/from Pasteboard...?? I have an NSAttributedString with some custom attributes. See this thread. Note particularly the excellent comment by Mike Ash:

Re: UIKit: Customized text display

2010-09-07 Thread Ross Carter
On Sep 7, 2010, at 11:14 AM, Phillip Mills wrote: Perhaps I need to use my own container view and dynamically alternate UILabels and UITextFields...or subclass UITextView...or build a new view type from scratch Core text? Other

Re: Number of layout managers for NSTextStorage increases

2010-09-07 Thread Ross Carter
On Sep 7, 2010, at 12:22 PM, Jens Bauer wrote: ...Does anyone have an idea about why the number of layout managers increase ? I don't know the answer, but I expect it is easy to find out. Set a breakpoint on layout manager -init and see who is creating them. Or, look at the contents of the

Re: Highlight Text like with FIne

2010-09-06 Thread Ross Carter
On Sep 5, 2010, at 7:33 PM, Brad Stone wrote: I want to highlight different substrings contained in controls in a window (two different comboBoxes for example) programmatically when the user is searching for a subString. I can do this for one comboBox but not both simultaneously. Here's

Re: Knowing how a Text Editing Session ended

2010-07-22 Thread Ross Carter
On Jul 22, 2010, at 4:47 AM, Motti Shneor wrote: My Question: How can I Persuade the FieldEditor to end an Editing Session when these specific key-combinations occur? Should I override something? Is there a specific Delegate for that? You might try subclassing the field editor and override

Re: Small caps in NSTextView

2010-07-22 Thread Ross Carter
On Jul 22, 2010, at 11:44 AM, Vincent Habchi wrote: I'd like to highlight some text in a NSTextView by showing it in small caps. It seems this is not a standard text attribute, so this is not possible unless changing [NSTextView string] contents. Is this right? No, you do not have to modify

Re: NSTextView becomes temporarily unresponsive

2010-07-13 Thread Ross Carter
On Jul 12, 2010, at 6:01 PM, David Swofford wrote: I'm beginning the conversion of a scientific app from Carbon to Cocoa, and have run into a problem with NSTextView. FWIW, I have it embedded in an NSScrollView that is in turn included as an HICocoaView in a Carbon window (but I don't

Re: NSTextView becomes temporarily unresponsive

2010-07-13 Thread Ross Carter
only ACTG and -, in one scrolling text view? Mightn't you present only a snippet at a time, rather than the entire sequence? Just a thought. Hope this helps. -Ross On Jul 13, 2010, at 3:24 PM, David Swofford wrote: On Jul 13, 2010, at 2:38 PM, Ross Carter wrote: Could you post a test file

Re: Isolate NSTextView from NSColorWell

2010-06-24 Thread Ross Carter
This thread should help: http://www.cocoabuilder.com/archive/cocoa/149756-understanding-nstextview-setinsertionpointcolor.html On Jun 23, 2010, at 3:05 AM, Bernard Knaepen wrote: The NSTextView is indeed richtext and this is what I need. Do I need to subclass the NSColorWell or the

Re: changing NSTextView text colour

2010-06-06 Thread Ross Carter
On Jun 6, 2010, at 1:21 PM, James Maxwell wrote: I have a NSTextView that's displaying MIDI info from my app's current MIDI input device. I show this info in a couple of places - one is in a MIDI Setup type window, and the other is in an Inspector window. I want the Inspector window to

Re: setting tab stops in a document

2010-06-05 Thread Ross Carter
On Jun 5, 2010, at 1:09 AM, Boyd Collier wrote: In an application I'm working on, I read in plain text files containing data to be analyzed. This uses a slightly-modified version of MyDocument.m that is produced as a result of starting a project with the template for NSDocument

Re: Binding SelectedText Background

2010-06-02 Thread Ross Carter
On Jun 1, 2010, at 4:25 PM, Keary Suska wrote: On Jun 1, 2010, at 11:18 AM, Erick Pérez wrote: Hi: I manage to bind the text color to a color well, one of those many tutorials you can find online, but what i want is to change the color of the selected text's background. Can i bind that ?

Re: using coregraphics with vector art from illustrator

2010-04-21 Thread Ross Carter
Is there perhaps a way to create vector art paths in illustrator, and import the data into xcode and use those paths in CG and stroke/fill them there? It might be worth looking at Opacity from likethought.com. It exports directly into source code.

Re: program termination after releasing self defined NSXMLParser class

2010-04-16 Thread Ross Carter
On Apr 16, 2010, at 5:58 AM, Dominic Dauer wrote: Ok. Sorry for that. I never worked with the debugger. After I entered bt or backtrace I got the following message: Program received signal: “EXC_BAD_ACCESS”. #0 0x93e0bedb in objc_msgSend () #1 0x in ?? () Just a wild guess:

Re: exceptions when NSTextStorage initialized with empty string

2010-04-07 Thread Ross Carter
On Apr 7, 2010, at 11:52 AM, Martin Hewitson martin.hewit...@aei.mpg.de wrote: Hi Kyle, At the moment it does nothing but call super. I was using it to handle line-wrapping, but in the process of debugging this problem it's reduced to - (void)insertText:(id)aString { [super

Re: Sending a Cmd-V keystroke

2010-03-26 Thread Ross Carter
On Mar 26, 2010, at 12:23 AM, Jim Graham wrote: [textField1 becomeFirstResponder]; From the docs: Use the NSWindow makeFirstResponder: method, not this method, to make an object the first responder. Never invoke this method directly. ___

Dealing with glyphs that draw outside their NSTextView

2010-03-04 Thread Ross Carter
In a new TextEdit Wrap to Page document, change the font to Zapfino and type a lowercase f. The left swash is cut off. I would like to draw the entire glyph, as Pages does (and I am aware that Pages does not use NSTextView). It's easy enough to draw the entire glyph by sending -lockFocus to the

Re: NSScrollView its width

2010-02-05 Thread Ross Carter
I've tried setting the documentView's frame width to the width of the largest picture. That sort of works, but as soon as the window (or the view) is resized, everything snaps back to the undesired state. Try using setMinSize: on the NSTextView.

Re: Custom Field Editor Problem

2010-02-02 Thread Ross Carter
On Feb 2, 2010, at 2:02 PM, John Nairn wrote: I copied code from Cocoa documentation to create a custom field editor. It gets created OK and seems to work, but always crashes when the the window closes with the message Program received signal: “EXC_BAD_ACCESS”. sharedlibrary

Re: NSTextView Drag and Drop

2010-01-31 Thread Ross Carter
On Jan 30, 2010, at 9:25 PM, Jon Buys wrote: What is the best way to get access to the file that is dropped on an NSTextView. I don't want to embed the file in the view, but I'd like to copy the file somewhere else and add arbitrary text in its place. I'm thinking I should be looking at

Re: setTailIndent problems

2010-01-13 Thread Ross Carter
On Jan 11, 2010, at 3:31 PM, Fabry, Geza wrote: I try to set tailIndent for an NSMutableParagraphStyle attribute of an NSMutableAttributedString. The documentation says: If positive, this is the distance from the leading margin (for example, the left margin in left-to-right text). That is,

Re: Setting the Line Height/ Line Spacing in an NSTextView.

2009-12-30 Thread Ross Carter
On Dec 30, 2009, at 10:43 AM, Joshua Garnham wrote: How would I set the Line Height/ Line Spacinh in an NSTextView? e.g How tall each line is or how much space is between each line. Here's what I've tried (but doesn't work), it is in a NSTextView subclass … -

Re: Command+Option+Return not sent to doCommandBySelector:

2009-12-18 Thread Ross Carter
On Dec 17, 2009, at 12:16 AM, Gideon King wrote: I have a custom view that implements the NSTextInputClient protocol, and it successfully receives doCommandBySelector: method calls for just about every other non-text entry key combination, but Command+Option+Return just doesn't get there

Re: NSMutableAttributedString Links color

2009-12-14 Thread Ross Carter
On Dec 13, 2009, at 8:55 PM, PCWiz wrote: Hi, I am, for lack of a better word, enabling links in my NSMutableAttributedString by applying the NSLinkAttributeName attribute to them, and I'm changing their color from the default blue to a different color using

Re: NSTextView Horizontal Scrollbar bug

2009-12-06 Thread Ross Carter
On Dec 5, 2009, at 9:14 AM, Eric Gorr wrote: On Dec 4, 2009, at 12:30 PM, Ross Carter wrote: On Dec 4, 2009, at 9:29 AM, Eric Gorr wrote: I've got a sample application at http://ericgorr.net/cocoadev/TextViewNoWrap.zip which demonstrates the problem I am seeing. Basically

Re: NSTextView Horizontal Scrollbar bug

2009-12-04 Thread Ross Carter
On Dec 4, 2009, at 9:29 AM, Eric Gorr wrote: I've got a sample application at http://ericgorr.net/cocoadev/TextViewNoWrap.zip which demonstrates the problem I am seeing. Basically, there is just a text view on a window with a horizontal scrollbar which appears only when needed. I

Re: How to stop NSScrollView from scrolling to top when horizontally resizing contained NSTextView?

2009-11-17 Thread Ross Carter
Fundamentally, I want to: 1. Display lines of text that don't wrap in my NSTextView. 2. Display a horizontal scrollbar. 3. Make sure that the width of the NSTextView is appropriately wide for that line of text so that: 3.1 The user can scroll the width of the longest line of text and no

Re: how to filter available fonts for my application?

2009-10-29 Thread Ross Carter
On Oct 29, 2009, at 11:17 AM, Jens Alfke wrote: But the NSFontManager Class Reference tells me that this delegate methods is not called in Mac OS X version 10.3 and later. I don't have any idea how to implement it now? does anyone know it? thanks Do you really need to support 10.3? I'm

Re: NSSpellChecker -learnWord: how to specify LocalDictionary

2009-10-21 Thread Ross Carter
On Oct 17, 2009, at 6:06 PM, Ross Carter wrote: In 10.6, there is a spell checking dictionary named LocalDictionary that contains words learned outside the context of a particular language. How does one use NSSpellChecker -learnWord: and -unlearnWord: so that those methods write

NSSpellChecker -learnWord: how to specify LocalDictionary

2009-10-17 Thread Ross Carter
In 10.6, there is a spell checking dictionary named LocalDictionary that contains words learned outside the context of a particular language. How does one use NSSpellChecker -learnWord: and -unlearnWord: so that those methods write to LocalDictionary? For other language dictionaries, one

Re: standard colors

2009-10-17 Thread Ross Carter
On Oct 17, 2009, at 5:31 PM, Alastair Houghton wrote: On 17 Oct 2009, at 21:32, Michael Cinkosky wrote: Has Apple provided documentation on their standard source list background color? I haven't found it in the HIG docs, or with Google (I have not come up with the right terms to make the

Re: NSLayoutManager and best override point for temporary attributes

2009-10-06 Thread Ross Carter
On Oct 5, 2009, at 3:12 PM, Keith Blount wrote: I tried saving the edited range of text in the text storage and then having my layout manager check this from: -textStorage:edited:range:changeInLength:invalidatedRange: Then my layout manager adds temp attribs in this method. Turns out that

Re: Drawing text chunks (e.g. paras) in a text view with alternating background colours

2009-09-24 Thread Ross Carter
Hi, Keith. Couple of thoughts: In my NSTextView subclass’s -drawViewBackgroundInRect: method, I get the range of characters in the current -visibleRect: using code similar to this: -visibleRect is a much larger rect than you need, I should think. What's wrong with using the rect passed

Re: settings to build for 10.5 on 10.6?

2009-09-16 Thread Ross Carter
On Sep 16, 2009, at 1:03 PM, Matt Neuburg wrote: What are the correct build settings to develop on 10.6 in such a way that my app will also run on 10.5? (It runs fine on my 10.6 machine.) I've already set the SDK and Base to 10.5, and my app does launch successfully (if I set it to 32 bit)

Re: NSTextView resizeability and scrolling

2009-09-11 Thread Ross Carter
On Sep 10, 2009, at 12:10 AM, Stamenkovic Florijan wrote: Hi Ross, Thanks for your reply, On Sep 09, 2009, at 13:15, Ross Carter wrote: I've googled for a solution, found nothing. I tried making it by observing the NSViewFrameChangedNotification of the NSTextView from it's parent

Re: NSTextView resizeability and scrolling

2009-09-09 Thread Ross Carter
I've googled for a solution, found nothing. I tried making it by observing the NSViewFrameChangedNotification of the NSTextView from it's parent, and resizing, but this is more tricky then I imagined. I think you are on the right track. You might want to look at these threads:

Re: NSUserDefaults synchronization in Foundation tools

2009-09-09 Thread Ross Carter
No, it does actually behave as documented. In 10.6 I know it syncs after 15 seconds. In 10.6, I've noticed that my app and other apps are leaving some empty files in ~/Library/Preferences such as com.apple.iTunes.eq.plist.Z9l0HBm. Is it possible for these relics to occur if the

Re: change in launch services binding behavior?

2009-09-06 Thread Ross Carter
On Sep 6, 2009, at 1:50 AM, Mark Munz wrote: On Sat, Sep 5, 2009 at 5:46 PM, Matt Neuburgm...@tidbits.com wrote: Yeah, that's just FUD. It supports creator codes, but not in the same *way* that Leopard did. And since this is a major undocumented change, which has broken the way apps like

Re: Normalize an NSAttributedString

2009-08-30 Thread Ross Carter
On Aug 29, 2009, at 5:29 PM, Ken Thomases wrote: On Aug 29, 2009, at 3:48 PM, Ross Carter wrote: On Aug 29, 2009, at 1:22 PM, Ken Thomases wrote: On Aug 29, 2009, at 11:46 AM, Ross Carter wrote: Suppose an NSAttributedString comprises the string o + umlaut in decomposed form, plus one

Re: Normalize an NSAttributedString

2009-08-29 Thread Ross Carter
On Aug 26, 2009, at 1:21 PM, Ken Thomases wrote: On Aug 26, 2009, at 10:43 AM, Michael Ash wrote: On Wed, Aug 26, 2009 at 5:42 AM, Ken Thomasesk...@codeweavers.com wrote: On Aug 25, 2009, at 7:21 PM, Ross Carter wrote: I haven't tried it, but this should work: NSAttributedString

Re: Auto complete accepts on space, any way to change?

2009-08-29 Thread Ross Carter
On Aug 28, 2009, at 12:02 PM, Ben Lachman wrote: My app, SousChef, uses the AppKit autocomplete functionality in a bunch of places. Currently if a user types So they are presented with a list of completions and the first actual completion (Soup) is used inline and selected so that this

Re: Normalize an NSAttributedString

2009-08-29 Thread Ross Carter
On Aug 29, 2009, at 1:22 PM, Ken Thomases wrote: On Aug 29, 2009, at 11:46 AM, Ross Carter wrote: Suppose an NSAttributedString comprises the string o + umlaut in decomposed form, plus one attribute. Its length is 2, and the range of an attribute is {0, 2}. The string and its attribute

Normalize an NSAttributedString

2009-08-25 Thread Ross Carter
NSString has methods for normalizing the content using Normalization Forms D, KD, C, and KC. NSAttributedString does not. Is there any way to normalize an NSAttributedString? I need to archive an NSAttributedString by extracting its string, attributes, and the attribute ranges. This is easy

Re: Normalize an NSAttributedString

2009-08-25 Thread Ross Carter
On Aug 25, 2009, at 11:02 AM, Ross Carter wrote: NSString has methods for normalizing the content using Normalization Forms D, KD, C, and KC. NSAttributedString does not. Is there any way to normalize an NSAttributedString? I need to archive an NSAttributedString by extracting its string

Re: Normalize an NSAttributedString

2009-08-25 Thread Ross Carter
I haven't tried it, but this should work: NSAttributedString* original = whatever; NSMutableAttributedString* normalized = [[original mutableCopy] autorelease]; CFMutableStringRef str = (CFMutableStringRef)[original mutableString]; CFStringNormalize(str,

Re: From NSTextView to address an NSTextField

2009-08-04 Thread Ross Carter
On Aug 3, 2009, at 4:43 AM, Alastair Houghton wrote: On 2 Aug 2009, at 21:48, Steve Cronin wrote: Folks; NSTextView - NSText - NSView - NSReponder - NSObject NSTextField - NSView - NSReponder - NSObject At runtime if I have access to an instance of NSTextView how can I

Re: GC bug in NSFontManager?

2009-07-01 Thread Ross Carter
On Jun 30, 2009, at 7:57 PM, Tommy Nordgren wrote: Is CCMApp an NSApplication subclass. This stack trace seems to indicate that there is an instance of it in your nib/xib file. Nope, it's the application delegate. The principal class is NSApplication.

  1   2   >