Re: converting a NSView into an NSImage, when scaling via scaleUnitSquareToSize [SOLVED, kinda]

2009-10-04 Thread Martin Redington
]; CGContextScaleCTM([[NSGraphicsContext currentContext] graphicsPort], scale.width, scale.height); [self drawRect: [self frame]]; [screenshot unlockFocus]; return [screenshot autorelease]; } On Fri, Oct 2, 2009 at 3:38 AM, Martin Redington mar

converting a NSView into an NSImage, when scaling via scaleUnitSquareToSize ...

2009-10-01 Thread Martin Redington
In order to work around the some of the issues I've been encountering when scrolling scaled NSTextView's, I've been looking at capturing the NSTextView as an NSImage, and using that instead (which would meet my requirements). I've tried the usual approaches (see below), but none of them are

poor performance when scrolling scaled text view, with small number of characters per line only

2009-09-30 Thread Martin Redington
I'm seeing very poor performance when programmatically scrolling an NSTextView under certain conditions. The text view is scaled using [NSView scaleUnitSquareToSize:], and the scroll amounts are fractional (I need to exactly match the appearance of a smaller text view that is also being

Re: Scrolling NSScrollView by fractional amounts - why would values get rounded?

2009-09-11 Thread Martin Redington
: On Sep 10, 2009, at 7:01 AM, Martin Redington wrote: This works fine when the new y value is a whole integer, but I'm seeing some strange behaviour when trying to scroll by fractional amount (e.g. .25 or .5 of a pixel). Are you sure you want to scroll by fractional pixels? It will be slower

Re: Scrolling NSScrollView by fractional amounts - why would values get rounded?

2009-09-11 Thread Martin Redington
Copy on scroll is off for both views - with it set on, I get smearing, but only in the view that's working with fractional amounts (i.e. not rounding off). In this particular case, I actually want slow, but smooth, scrolling, and the ability to change the scrolling speed in very fine increments,

Scrolling NSScrollView by fractional amounts - why would values get rounded?

2009-09-10 Thread Martin Redington
I've got two NSScrollView's in separate windows, that I'm trying to scroll programmatically in synchrony. I'm calling [[scrollView contentView] scrollToPoint:theNewPoint]; This works fine when the new y value is a whole integer, but I'm seeing some strange behaviour when trying to scroll by

Testing C functions using OCUnit

2009-02-15 Thread Martin Redington
In my projects, I tend to define methods which need access to member variables as class methods, and related functions, which do not need direct access to any internal object data, as C functions, like the simple example below. @implementation FunctionTestAppController + (id) sharedController {

Re: Testing C functions using OCUnit

2009-02-15 Thread Martin Redington
of 1f9c (__TEXT,__text) non-external (was a private external) _SomeFunction and linking succeeds ... On Sun, Feb 15, 2009 at 6:50 PM, Greg Parker gpar...@apple.com wrote: On Feb 15, 2009, at 10:32 AM, Martin Redington wrote: In my projects, I tend to define methods which need access to member

Re: intercepting NSBrowser multiple selection extension with shift down/up arrow

2008-10-14 Thread Martin Redington
On Tue, Oct 14, 2008 at 8:12 AM, Andy Lee [EMAIL PROTECTED] wrote: On Oct 14, 2008, at 12:45 AM, Martin Redington wrote: On Tue, Oct 14, 2008 at 5:25 AM, Andy Lee [EMAIL PROTECTED] wrote: How about if you leave the matrix class alone and do [myBrowser setSendsActionOnArrowKeys:YES

Re: intercepting NSBrowser multiple selection extension with shift down/up arrow

2008-10-14 Thread Martin Redington
On Tue, Oct 14, 2008 at 2:04 PM, Andy Lee [EMAIL PROTECTED] wrote: On Oct 14, 2008, at 8:11 AM, Martin Redington wrote: On Tue, Oct 14, 2008 at 8:12 AM, Andy Lee [EMAIL PROTECTED] wrote: If it helps with the ick factor, I would say that it's much less hacky to take advantage of one method's

Re: intercepting NSBrowser multiple selection extension with shift down/up arrow

2008-10-13 Thread Martin Redington
On Tue, Oct 14, 2008 at 5:25 AM, Andy Lee [EMAIL PROTECTED] wrote: On Oct 13, 2008, at 11:16 PM, Martin Redington wrote: I've got an NSBrowser, and a secondary view whose value depends on the current selection in the NSBrowser. [...] I seem to be capturing everything so far, except

Re: -[NSBrowser scrollToVisible] not making all of the column

2008-08-07 Thread Martin Redington
To: Cocoa-Dev Mail cocoa-dev@lists.apple.com Message-ID: [EMAIL PROTECTED] Content-Type: text/plain; charset=US-ASCII on 2008-08-07 12:06 PM, Martin Redington at [EMAIL PROTECTED] wrote: [apologies if this is a repost - I sent it a while ago, but didn't see it appear on the list

-[NSBrowser scrollToVisible] not making all of the column visible

2008-08-02 Thread Martin Redington
I've got an app with a NSOutlineView and NSBrowser view of the same data (the file system). I preserve the user's selection between when switching between views. A lot of the time, the NSBrowser scrolls to show the entire selected column. However, sometimes, only a portion of the selected column

NSBrowser redraw issues

2008-08-02 Thread Martin Redington
Here's another NSBrowser issue ... I'm allowing multiple selection in my NSBrowser. When my NSBrowser loses focus, the multiple selected cells correctly change to have a grey background, but when it regains focus, only the last selected cell gets updated correctly to the active selection colour.

NSViewAnimation and setDocumentView

2008-07-23 Thread Martin Redington
I'm swapping views in my app using -[NSScrollView setDocumentView:] I'd like to fade the old view out, and the new one in. NSViewAnimation looks to be exactly what I want, but doesn't seem to be well suited to use with setDocumentView, which handles the view swapping internally. Does anyone have

Re: NSBrower selectedCells lies

2008-05-23 Thread Martin Redington
://5959283 On Fri, May 23, 2008 at 3:30 AM, Graham Cox [EMAIL PROTECTED] wrote: Check whether anything in your delegate is throwing an exception (NSAssert can throw an exception btw). That might be interrupting the update loop. hth, G. On 23 May 2008, at 10:44 am, Martin Redington wrote

Re: NSBrower selectedCells lies

2008-05-22 Thread Martin Redington
delegate methods - I wouldn't have expected them to break this, but then I wouldn't have expected NSFocusRingTypeNone to either. If anyone has any clues as to what might be going on here, that would be great ... On Wed, May 7, 2008 at 4:14 AM, Martin Redington [EMAIL PROTECTED] wrote: more

Setting intercell spacing in NSBrowser

2008-05-06 Thread Martin Redington
Where is the appropriate place to set the intercellSpacing on the (NSMatrices of) an NSBrowser? I would like my browser to show the gap in between multiple selected rows that you see in the Finder et al. I tried subclassing NSMatrix, and over-riding -[NSMatrix initWithFrame:

Setting intercell spacing in NSBrowser

2008-05-06 Thread Martin Redington
Where is the appropriate place to set the intercellSpacing on the (NSMatrices of) an NSBrowser? I would like my browser to show the gap in between multiple selected rows that you see in the Finder et al. I tried subclassing NSMatrix, and over-riding -[NSMatrix initWithFrame:

Re: Setting intercell spacing in NSBrowser

2008-05-06 Thread Martin Redington
); [matrix setIntercellSpacing:intercellSpacing]; } On Tue, May 6, 2008 at 7:13 PM, Corbin Dunn [EMAIL PROTECTED] wrote: On May 6, 2008, at 8:07 AM, Jens Alfke wrote: On 5 May '08, at 11:31 PM, Martin Redington wrote: I tried subclassing NSMatrix, and over-riding -[NSMatrix

NSBrower selectedCells lies

2008-05-06 Thread Martin Redington
more NSBrowser problems (on Leopard, building with Xcode 2.5 for Tiger+). My NSBrowser is set to allow multiple and branch selection. In my custom NSBrowserCell subclass, I over-ride -[NSBrowserCell drawInteriorWithFrame:inView:] to do some custom drawing when the cell is selected (I need to draw

custom dragging destination feedback in an NSTableView

2008-04-11 Thread Martin Redington
I have two NSTableViews, whose items have a parent-child relationship. I would like to be able to drag the children into the parent table view, to change their parent (think dragging mail messages between folders). The standard dragging feedback is rather ugly to start off with, and

Re: custom dragging destination feedback in an NSTableView

2008-04-11 Thread Martin Redington
something more pleasing myself ... On 11 Apr 2008, at 14:05, Jerry Krinock wrote: On 2008 Apr, 11, at 4:15, Martin Redington wrote: The standard dragging feedback is rather ugly to start off with...I could spot any obvious way to customise this feedback I'm not sure what you consider to be ugly

Re: [NSPipe pipe] returning nil (running out of filehandles?)

2008-04-03 Thread Martin Redington
); } unsigned char checksum[MD5_DIGEST_LENGTH]; if(bytes_read == 0) { MD5_Final(checksum, md5_context); } On 2 Apr 2008, at 00:53, Martin Redington wrote: On 2 Apr 2008, at 00:33, Jim Correia wrote: On Apr 1, 2008, at 7:19 PM, Martin Redington wrote: I'm running /sbin/md5

Re: test if another app has hung

2008-04-01 Thread Martin Redington
I went to check the referenced thread, as this is something I wanted to do occasionally, when I noticed that I was the OP for it. The discussion was exhaustive, and veered OT at the end, but I'm not sure that I ever discerned how one would do this efficiently. This was probably the most

Re: [NSPipe pipe] returning nil (running out of filehandles?)

2008-04-01 Thread Martin Redington
On 2 Apr 2008, at 00:46, Jean-Daniel Dupas wrote: Le 2 avr. 08 à 01:36, stephen joseph butler a écrit : On Tue, Apr 1, 2008 at 6:20 PM, Martin Redington [EMAIL PROTECTED] wrote: I'm running /sbin/md5 via an NSTask on a number of files (3,000 or so, with a new NSTask each time

NSToolbar doesn't add default items issue on 10.5.2

2008-03-27 Thread Martin Redington
I've got some NSToolbar code, which seems to have suddenly stopped working on Leopard only. - (void) setupToolbar { NSLog(@Setting up toolbar); //[self removeObsoleteToolbarIdentifiers]; NSToolbar *toolbar = [[MMICleanerToolbar alloc]

Re: Updates in one split view pane causing other pane to redraw (on Tiger): SOLVED

2008-03-24 Thread Martin Redington
:(NSRect)cellFrame inView:(NSView *)controlView { // Some code // Don't do this. [controlView setNeedsDisplay:YES]; // Some more code } On 21 Mar 2008, at 13:52, Martin Redington wrote: In my app I have a split view (actually an RBSplitView). The left hand pane contains

Updates in one split view pane causing other pane to redraw (on Tiger)

2008-03-21 Thread Martin Redington
In my app I have a split view (actually an RBSplitView). The left hand pane contains a table view representing disk volumes, and the right hand split view contains an NSOutlineView listing files and directories. When I update item in the files view, I'm *sometimes* seeing the volume

Re: strange lockFocus sent to a view whose window is deferred error with an NSOutlineView on Tiger

2008-03-17 Thread Martin Redington
On 17 Mar 2008, at 17:07, Michael Nickerson wrote: On Mar 17, 2008, at 9:06 AM, Martin Redington wrote: I'm seeing the following error 2008-03-17 12:42:11.916 MyApp[11155] *** Assertion failure in - [MyOutlineView lockFocus], AppKit.subproj/NSView.m:3248 2008-03-17 12:42:11.917 MyApp

Re: strange lockFocus sent to a view whose window is deferred error with an NSOutlineView on Tiger

2008-03-17 Thread Martin Redington
don't see lockFocus get called at all on -[NSScrollView setDocumentView:] when there's no error, or when my other outline view gets set. Presumably, something in the state of that outline view is kicking off the redraw before the view is ready. On 17 Mar 2008, at 17:45, Martin Redington

Re: strange lockFocus sent to a view whose window is deferred error with an NSOutlineView on Tiger: SOLVED

2008-03-17 Thread Martin Redington
, the view's window seems to have been set. On 17 Mar 2008, at 19:12, Martin Redington wrote: I overrode lockFocus, and stuck a breakpoint on it. #0 0x004f87ea in -[MyOutlineView lockFocus] at MyOutlineView.m:75 #1 0x93310315 in -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect