Extending NSTextStorage

2011-05-11 Thread Дмитрий Николаев
Hello! According to documentation, I try to subclass NSTextStorage and use it in text view: /* NSTextStorage is a semi-abstract subclass of NSMutableAttributedString. It implements change management (beginEditing/endEditing), verification of attributes, delegate handling, and layout management

Re: PDFDocument and CGPDFDocument

2011-05-11 Thread Antonio Nunes
On 11 May 2011, at 03:59, Graham Cox wrote: > Are CGPDFDocument and PDFDocument toll-free bridged? If not, how can I get a > PDFDocument from a CGPDFDocumentRef? They are not toll-free bridged. > I need to use the lower level API to extract graphic entities from a PDF, but > I'd like to use P

Re: Why NSClassFromString(@"CADisplayLink")?

2011-05-11 Thread Brian Bruinewoud
Thanks for the various answers. Hank said: If the class is missing, NSClassFromString(@"CADisplayLink") returns nil. When you say that it "compiles and runs", does that mean that line of code puts a non-nil value in displayLink? My Response: The code functions only because displayLink is non-Ni

Re: PDFDocument and CGPDFDocument

2011-05-11 Thread Graham Cox
On 11/05/2011, at 6:33 PM, Antonio Nunes wrote: > How about opening the document with PDFKit to start with, and then ask the > obtained PDFDocument for its documentRef when you need to get submerged. I > don't think you can go the other way. > > The 'documentRef' is in the PDFDocument header f

Re: PDFDocument and CGPDFDocument

2011-05-11 Thread Graham Cox
On 11/05/2011, at 10:34 PM, Graham Cox wrote: > On a follow-up note, I'm using PDFView and PDFThumbView in a modal dialog to > pick the page to open (since it's part of opening a file I don't yet have a > document to hang a sheet from). The main page view works fine but I notice > that the thu

Re: Call NSView's -drawRect method manually

2011-05-11 Thread Nick
Thanks for a detailed explanation 2011/5/11 Ken Thomases : > On May 10, 2011, at 11:26 AM, Nick wrote: > >> Can someone explain please, when an NSView's call -drawRect >> (being called manually - not by a framework) actually initiates >> redrawing of the frame and displaying everything that it had

QuickTime Player - like application

2011-05-11 Thread Nick
Hi Could you please explain me what frameworks/techniques does a QuickTime Player use to achieve the looks it has now? So far my GUI building experiences were limited with Interface Builder'ed gray "static" windows. How to force the window to make its titlebar/playback control bar disappear, when

prevent multiple instances of a program

2011-05-11 Thread Martin Batholdy
Hi, My program consists of a menu item and is NSUIagent - so it is hidden in the Mac OS app-bar. Now what surprises me is that I am able to open several instances of this program. Every time I click on the app-file a new symbol appears and I have a new instance of my program running. How can

Re: prevent multiple instances of a program

2011-05-11 Thread Dave DeLong
There are a bunch of ways to do this, but the general principle is that when an instance of the app starts, it makes its presence known somehow (touching a file, broadcasting a distributed notification, vending a distributed object, etc). Then when a second instance starts, it tries to find a p

Re: QuickTime Player - like application

2011-05-11 Thread Ken Thomases
On May 11, 2011, at 3:25 PM, Nick wrote: > Could you please explain me what frameworks/techniques does a > QuickTime Player use to achieve the looks it has now? Sadly, Apple sometimes implements GUIs in their own apps that are not easily reproducible with supported APIs. Sometimes that's a prel

Re: Extending NSTextStorage

2011-05-11 Thread Martin Wierschin
> I try to subclass NSTextStorage and use it in text view ... > So I try to use delegate, to handle all needed events with same functionality: Although it might be natural to say that your MyTextStorage class "delegates" storage to an NSMutableAttributedString, it's not a good word to use here,

Re: QuickTime Player - like application

2011-05-11 Thread John Pannell
Hi Nick- These things are all possible, but none of it comes for free... you'll need to draw your window contents yourself. To start with, you'll need a "transparent" window: http://www.google.com/search?q=NSBorderlessWindowMask Also look at Apple's RoundTransparentWindow sample code: http:/

Re: prevent multiple instances of a program

2011-05-11 Thread Tito Ciuro
Hi Martin, One way to do it is via flock(): http://developer.apple.com/library/mac/#documentation/darwin/reference/manpages/man2/flock.2.html -- Tito On May 11, 2011, at 6:04 PM, Dave DeLong wrote: > There are a bunch of ways to do this, but the general principle is that when > an instance of

Re: prevent multiple instances of a program

2011-05-11 Thread Ken Thomases
On May 11, 2011, at 4:02 PM, Martin Batholdy wrote: > My program consists of a menu item and is NSUIagent - so it is hidden in the > Mac OS app-bar. I'm not familiar with "NSUIagent" and search of the docs don't produce any hits. Did you mean LSUIElement? I also assume that "menu item" refers

Cocoaheads Lake Forest meeting TONIGHT, 7pm, El Toro library

2011-05-11 Thread Scott Ellsworth
CocoaHeads Lake Forest will be meeting on the second Wednesday of the month. Please join us TONIGHT from 7pm to 9pm on Wednesday, 5/11. We will be meeting at the Orange County Public Library (El Toro) community room, 24672 Raymond Way, Lake Forest, CA 92630 This will be an informal meeting with

Problem with bound text field in accessory panel

2011-05-11 Thread Gideon King
Hi, I have a text field which is used in a save panel accessory when exporting files from my program. It is bound to the user defaults, and has continuous updating of values turned on so that if the user presses Return to complete the save operation, I still have the current value even though th

Re: Problem with bound text field in accessory panel

2011-05-11 Thread Ken Thomases
On May 11, 2011, at 8:26 PM, Gideon King wrote: > Hi, I have a text field which is used in a save panel accessory when > exporting files from my program. It is bound to the user defaults, and has > continuous updating of values turned on so that if the user presses Return to > complete the save

Re: Problem with bound text field in accessory panel

2011-05-11 Thread Kyle Sluder
On Wed, May 11, 2011 at 6:26 PM, Gideon King wrote: > Hi, I have a text field which is used in a save panel accessory when > exporting files from my program. It is bound to the user defaults, and has > continuous updating of values turned on so that if the user presses Return to > complete the

Re: Problem with bound text field in accessory panel

2011-05-11 Thread Kyle Sluder
On Wed, May 11, 2011 at 7:47 PM, Kyle Sluder wrote: > The better way to do this might be to call -commitEditing on the user > defaults controller in your panel delegate's -windowWillClose: > implementation. Er, I meant -windowShouldClose:. But of course I also forgot that you don't own this panel

Re: Problem with bound text field in accessory panel

2011-05-11 Thread Gideon King
Thanks for the suggestions. I have found a solution. I make my file's owner the text field's delegate, and then implement the following: - (BOOL)control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)command { if (command == @selector(insertNewline:)) {