TIFFRepresentation, different TIFF format under Snow Leopard

2009-10-12 Thread Peter C
I just stumble into a feature (or a bug ?), NSImage TIFFRepresentation produce RGB TIFF with a layer (when open under Photoshop). Previously it produce plain RGB TIFF under OS 10.5 and below. This cause some part of my programs interpret wrong RGB data, expecting 3 bytes instead of 4 bytes

Re: TIFFRepresentation, different TIFF format under Snow Leopard

2009-10-13 Thread Peter C
oftware". A tiff file has tags in the header identifying the number of colour planes and their arangement within the file. Any half decent tiff importer will simply skip the alpha channel, if it has no use for it, and only read the RGB data. On Oct 12, 2009, at 5:07 PM, Ken Ferry wrote: On M

Program crashed after edit values at NSTableView

2010-05-07 Thread Peter C
crashed, from crashed log, it seems the window is still trying to update NSTableView even though the window is already closed. How do I prevent windows or NSTableView updating after window is close ? Peter C Here is the snippet of the codes, - (IBAction)editButtonAction:(id)sender

Re: Program crashed after edit values at NSTableView

2010-05-08 Thread Peter C
Graham, after setDataSource to nil, seems do the trick. No more crashing. Thanks. Peter C On 8 May 2010, at 1:10 PM, Graham Cox wrote: > > On 08/05/2010, at 2:21 PM, Peter C wrote: > >> How do I prevent [] or NSTableView updating after window is close ? > > > Look

NSStream and NSRunModalForWindow

2011-05-24 Thread Peter C
I have a window sending data via NSStream to another app. Whenever I invoke another modal window, the data stops. Somehow NSStream is block by NSRunModalForWindow. The code is pretty standard, a snippet of the code, [NSStream getStreamsToHost:host port:portNumber

Re: NSStream and NSRunModalForWindow

2011-05-25 Thread Peter C
I replaced NSDefaultRunLoopMode with NSModalPanelRunLoopMode, it is running fine now. Open another modal window won't stop network process. Thanks Graham. On 24 May 2011, at 8:12 PM, Graham Cox wrote: > > On 24/05/2011, at 8:03 PM, Peter C wrote: > >> [iStream schedule

Writing global preferences file into /Library/Preferences (OS X Lion)

2011-07-20 Thread Peter C
file, not global. Peter C ___ 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 Subscri

Re: Writing global preferences file into /Library/Preferences (OS X Lion)

2011-07-20 Thread Peter C
Graham, I used to store serial number codes for all users, in this directory. Looks like I have change it to save it user library directory. Peter C. On 21 Jul 2011, at 10:25 AM, Graham Cox wrote: > Check the release notes - a number of system folders have different > permi

Re: Writing global preferences file into /Library/Preferences (OS X Lion)

2011-07-20 Thread Peter C
I have think of authorization code but it seems now Apple does not want others to write into this directory. Better to change code to adapt to new settings. Peter C On 21 Jul 2011, at 10:30 AM, Stephen J. Butler wrote: > On Wed, Jul 20, 2011 at 8:31 PM, Peter C wrote: >> Some of the

Re: Writing global preferences file into /Library/Preferences (OS X Lion)

2011-07-20 Thread Peter C
Vincent, I meant changing to write to ~/Library/Preferences, user directory. Peter C On 21 Jul 2011, at 12:35 PM, vincent habchi wrote: >> I have think of authorization code but it seems now Apple does not want >> others to write into this directory. Better to change code to

10.6 : Class xxx does not implement the 'NSWindowDelegate' protocol

2010-01-27 Thread Peter C
I try to compile this code (snippet) for 10.6, ends up with error message, "Class SomeWinController does not implement the 'NSWindowDelegate' protocol" @interface SomeWinController : NSWindowController - (void) windowDidLoad { [[self window] setDelegate:self]; } At the moment target is set to

Re: 10.6 : Class xxx does not implement the 'NSWindowDelegate' protocol

2010-01-28 Thread Peter C
On 28 Jan, 2010, at 7:39 PM, Graham Cox wrote: > > On 28/01/2010, at 9:56 PM, Gustavo Pizano wrote: > >> Well Im not expert , but I just wanted to say that I have many >> NSWindowControllers in my app build on 10.6 and I have no such a warnings, >> and I hadn't have the need to implement NSWin

CoreText & NSMutableParagraphStyle maximumLineHeight

2013-08-19 Thread Peter C
Hi, I am attempting to create text control something similar like MS Word "line spacing" feature. A user complain my App paragraph text lines space is too much, this is because it is done by using NSString drawInRect:withAttributes:, not much of any adjustment. CoreText seems to able to do so b

Re: CoreText & NSMutableParagraphStyle maximumLineHeight

2013-08-19 Thread Peter C
On 20 Aug, 2013, at 1:50 PM, Graham Cox wrote: > On 20/08/2013, at 6:08 AM, Peter C wrote: > >> A user complain my App paragraph text lines space is too much, this is >> because it is done by using NSString drawInRect:withAttributes:, not much of >> any adjustment.

Re: CoreText & NSMutableParagraphStyle maximumLineHeight

2013-08-20 Thread Peter C
On 20 Aug, 2013, at 4:09 PM, Kyle Sluder wrote: > The default line height of Helvetica is 14.0. That information is > encoded in the font. You can discover this for yourself by asking your > NSLayoutManager for its defaultLineHeightForFont:. This line height will > be used for text layout if the

Re: CoreText & NSMutableParagraphStyle maximumLineHeight

2013-08-20 Thread Peter C
On 20 Aug, 2013, at 4:23 PM, Graham Cox wrote: > On 20/08/2013, at 8:38 AM, Peter C wrote: > >> Yes, it is possible to pass values with NSParagraphStyleAttributeName for >> NSString drawInRect:withAttributes. However by default line spacing or gap >> between lines

Re: CoreText & NSMutableParagraphStyle maximumLineHeight

2013-08-20 Thread Peter C
Just tested NSParagraphStyle lineHeightMultiple, the line space expands only. It is similar to NSParagraphStyle lineSpacing, no negative value possible. Below is the method what I intended to do, // lspace - 0.0 neutral , negative value the line height contracts and positive value line height