nstextview and inspector bar

2011-11-13 Thread Martin Hewitson
Dear list, I've been exploring the use of the new inspector bar that you can enable on NSTextView with setUsesInspectorBar:. I've discovered two strange behaviours: 1) I tried using this on a text view which appears in a sheet. The bar appears at the top of the sheet, but if the sheet is resiz

NSArray, NSDictionary property attribute issue, retain or copy?

2011-11-13 Thread ico
Hi all, We always use copy attribute on the NSString property declaration because it will figure it out that when you pass a mutable copy, if will copy then make the object to be immutable version and assign it to your property, and it will retain if you pass an immutable version. That's very cool

Re: About iVars declaration and property

2011-11-13 Thread Don Quixote de la Mancha
Explicitly declaring your ivars makes them easier to see in the debugger. Otherwise you have to call the property accessor from gdb's command line to look at it. I feel that it's helpful to declare them in any case, so I can more-easily tell how much memory each of my objects is taking up by look

Re: NSArray, NSDictionary property attribute issue, retain or copy?

2011-11-13 Thread Mike Abdullah
You should indeed declare such properties as copy. Some people seem to assume that the copy will copy the contents of the collection, which certainly isn't true. Of course for NSArray, it's often more appropriate to have a readonly array property, with KVC-compliant methods for inserting and rem

Re: NSArray, NSDictionary property attribute issue, retain or copy?

2011-11-13 Thread Ken Thomases
On Nov 13, 2011, at 2:48 AM, ico wrote: > We always use copy attribute on the NSString property declaration because > it will figure it out that when you pass a mutable copy, if will copy then > make the object to be immutable version and assign it to your property, and > it will retain if you pas

Natural language

2011-11-13 Thread Luca Ciciriello
Hi All. Any one knows how to use the class NSLinguisticTagger in order to decompose a phrase in its grammar components (name, adjective, verb, etc.)? Thanks for any answer. Luca.___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not pos

Re: About iVars declaration and property

2011-11-13 Thread Richard Somers
I find that not having explicit instance variable declarations lets me focus the class interface. I think that focusing on the interface is more helpful in the long run. --Richard On Nov 13, 2011, at 12:16 AM, ico wrote: > If so, is it a better approach that just declare the property and let

Re: NSBitmapImageRep and alpha channel

2011-11-13 Thread James Merkel
On Nov 12, 2011, at 4:34 PM, James Merkel wrote: > > On Nov 12, 2011, at 3:29 PM, Quincey Morris wrote: > >> On Nov 12, 2011, at 14:01 , James Merkel wrote: >> >>> d' = a * s + (1 - a) * d >>> All premultiplication does is precalculate a * s." >>> >>> First question -- what is d' in that equa

Re: About iVars declaration and property

2011-11-13 Thread Dave Fernandes
The synthesized ivars are private to the class that declares them. So you can use them as an ivar in that class's implementation, but not in a subclass implementation. Usually this is not a problem, but if you already have code that passes the ivar's address in a function call, for example, that

Re: About iVars declaration and property

2011-11-13 Thread Dave Fernandes
For some reason, sometimes my synthesized ivars show up in the debugger as ivars, and sometimes they don't. Can anyone explain this? I can't remember whether this is with GDB or LLDB. On 2011-11-13, at 5:24 AM, Don Quixote de la Mancha wrote: > Explicitly declaring your ivars makes them easier

Re: NSBitmapImageRep and alpha channel

2011-11-13 Thread Quincey Morris
On Nov 13, 2011, at 11:11 , James Merkel wrote: > This is kind of interesting -- if I rotate the image in Preview (rather than > Image Capture), then the histogram looks normal. > Looking at the NSBitmapImageRep from Preview image, the order is RGBA and > there is no reported alpha channel. > Fu

Re: Natural language

2011-11-13 Thread Vincent
The "Advanced Text Processing" session from WWDC '11 should be of help. https://developer.apple.com/videos/wwdc/2011/ On Nov 13, 2011, at 4:31 PM, Luca Ciciriello wrote: > Hi All. > Any one knows how to use the class NSLinguisticTagger in order to decompose a > phrase in its grammar components (

Re: NSBitmapImageRep and alpha channel

2011-11-13 Thread James Merkel
On Nov 13, 2011, at 12:34 PM, Quincey Morris wrote: > On Nov 13, 2011, at 11:11 , James Merkel wrote: > >> This is kind of interesting -- if I rotate the image in Preview (rather than >> Image Capture), then the histogram looks normal. >> Looking at the NSBitmapImageRep from Preview image, the

Cannot D&D from an NSTableView

2011-11-13 Thread Koen van der Drift
Hi, I am setting up D&D from an NSTableView, but I cannot drag any items. I have added registerForDraggedTypes and - (BOOL)tableView:(NSTableView *)aTableView writeRowsWithIndexes:(NSIndexSet *)rowIndexes toPasteboard:(NSPasteboard *)pboard to my table view controller, and the controller is bo

Re: Cannot D&D from an NSTableView

2011-11-13 Thread Jens Alfke
On Nov 13, 2011, at 6:12 PM, Koen van der Drift wrote: > I am setting up D&D from an NSTableView, but I cannot drag any items. I have > added registerForDraggedTypes and - (BOOL)tableView:(NSTableView *)aTableView > writeRowsWithIndexes:(NSIndexSet *)rowIndexes toPasteboard:(NSPasteboard > *)p

Re: Cocoa-dev Digest, Vol 8, Issue 888

2011-11-13 Thread Craig Brewer
Go to sleep guys. Sent from my iPhone On Nov 8, 2011, at 11:53 PM, cocoa-dev-requ...@lists.apple.com wrote: > Send Cocoa-dev mailing list submissions to >cocoa-dev@lists.apple.com > > To subscribe or unsubscribe via the World Wide Web, visit >http://lists.apple.com/mailman/listinfo/coc

NSExceptionHandler - What is a "top-level" vs. "other" exception?

2011-11-13 Thread James Farwell
Hey all, I have an application in which I would like to do special handling of exceptions that are "uncaught" by my code (as in they reach NSApplication's exception handler on the main thread or the uncaught exception handler if not on the main thread). However, if my code catches the exception wi

Troubles with Bold and Italic fonts - Cocoa

2011-11-13 Thread Dany Golubitsky
I am trying to make cocoa application draw bold or/and italic fonts. Here is the code I use: NSFontTraitMask fontStyle = 0; if (m_bBold) fontStyle |= NSBoldFontMask; if (m_bItalic) fontStyle |= NSItalicFontMask; NSFontManager* fontManager = [NSFontManager sharedF

performClickWithFrame draw with offset if coordinates are flipped

2011-11-13 Thread Dany Golubitsky
I am trying to implement a popup control in the Cocoa view. The view coordinates are flipped (function IsFlipped returns YES, the (0,0) coordinates are at the TopLeft corner). Here is the peace of code: NSRect frame = NSMakeRect(x_coordinate, y_coordinate, 32.0f, 32.0f); NSPopUpButtonC

Witch controls to use to implement an Xcode (4.2) like "toolbar view"

2011-11-13 Thread DELHAISE Thierry
Hi All, Just wondering if someone have tried to reproduced the "small toolbar view" (not window) on top of "Project source view" for example witch allow to select "Source Tree View" and other kind of "Source view". It seems to me that this is some sort of NSSegmentedControl ... Any infos ? T

Re: Troubles with Bold and Italic fonts - Cocoa

2011-11-13 Thread Martin Hewitson
Danny, I'm no font expert, but you could try playing with the 'weight' setting. I see you have it set to 5. Try setting it to 0 and see if that makes a difference. Sometimes when choosing a bold font, the resulting font anyway has a given weight. At least this is something I saw only yesterday

Re: Troubles with Bold and Italic fonts - Cocoa

2011-11-13 Thread Steve Steinitz
Hi Dany, I'm not sure what's wrong but, for what its worth, I use: NSFont * aFont = [NSFont fontWithName: @"Cochin" size: 10.0]; aFont = [fontManager convertFont: aFont toHaveTrait: NSBoldFontMask]; Cheers, Steve On 14 Nov 11

Re: NSFileHandle readInBackground vs threading?

2011-11-13 Thread Alexander Bokovikov
On 09.11.2011, at 19:25, Scott Ribe wrote: I'm not arguing the OP isn't seeing data lost, just that it cannot be happening the way he thinks it is if he's using any normal networking calls. Thanks to everybody for your useful comments! My local socket is opened in the client process just a

RE: Troubles with Bold and Italic fonts - Cocoa

2011-11-13 Thread Dany Golubitsky
Well, it did not help, beside the fact that if fontStyle remains 0 the fonts looks small and ugly. Helvetica is still neither bold nor italic. -Original Message- From: Martin Hewitson [mailto:martin.hewit...@aei.mpg.de] Sent: Monday, November 14, 2011 7:44 To: Dany Golubitsky Cc: Martin

Files Drag&Drop - target file icon problems

2011-11-13 Thread Alexander Bokovikov
Hi, Everyone, In my Cocoa app, I use file saving by drag&drop into Finder window (Desktop is one particular case). I'm trying to do it just as docs tell me: I use namesOfPromisedFilesDroppedAtDestination message to create a list of files being saved (one file at least) then I create and w

RE: Troubles with Bold and Italic fonts - Cocoa

2011-11-13 Thread Dany Golubitsky
Sorry, it does not works completely. With any font :( It seems that some fonts just do not work. -Original Message- From: Steve Steinitz [mailto:stevestein...@gmail.com] Sent: Monday, November 14, 2011 7:45 To: cocoa-dev@lists.apple.com Cc: Dany Golubitsky Subject: Re: Troubles with Bo