Re: alloc/release confusion

2009-02-14 Thread mmalc Crawford
On Feb 13, 2009, at 4:55 PM, Boon Chew wrote: Is there a way in Cocoa to find out the reference count of an object (for debugging purposes)?

Re: Can anyone suggest a way to do this?

2009-02-14 Thread Benjamin Dobson
On 14 Feb 2009, at 03:52:11, Graham Cox wrote: This may be more appropriate for the Quartz mailing list, which I'm not on, so I'll ask here first... When stroking a path, I can clip to the inside or the outside of the path to get a stroke inside or outside of the path's edge. But if the

Re: Where to declare/initialise an NSOperationQueue

2009-02-14 Thread Peter Blazejewicz
hi Jacob, Mike Ash has just posted blog entry on subject: http://www.mikeash.com/?page=pyblog/friday-qa-2009-02-13-operations-based-parallelization.html The answer depends on your code objectives, Do you really need NSOperation instances and to queue them? Maybe your task can be executed as single

NSTextView inside NSScrollView resize fade and flicker

2009-02-14 Thread Alejandro Rodriguez
Hello, I hope you all are doing fine. After searching far and wide I didn't find an answer to my problem and I was hoping someone could guide me on the right path. I have a layer-backed content view which parents, among other things, a NSTextView. If I understand correctly when a NSView i

NSTableView table contets Deletion problem

2009-02-14 Thread Arun
Hi All, I have a screen in my app which is similar to system preferences -> Network -> Ethernet -> Advanced -> 802.1x screen. Where in i have a table and "+" and "-" buttons to add contents into table. Also I have few text fields like username, passwd etc for each entries in the table. I have as

Re: [Q] detecting when a NSTextField begins editing

2009-02-14 Thread Kevin Gessner
Maybe you could listen for the window's delegate to receive windowWillReturnFieldEditor:toObject: for the text field? I've no experience with it, but the docs indicate that it should be called at the beginning of an editing session. HTH -- Kevin Kevin Gessner http://kevingessner.com ke...@

Re: Programatically Uncheck "Change Picture" In Desktop Settings?

2009-02-14 Thread I. Savant
On Feb 13, 2009, at 11:21 PM, Ken Thomases wrote: I believe that's only for internally-generated changes. There are a couple of methods of NSUserDefaults which are explicitly documented as posting that notification, and no mention of other circumstances under which it would be posted. B

Re: Programatically Uncheck "Change Picture" In Desktop Settings?

2009-02-14 Thread has
Chunk 1978 wrote: when running my apple script i get this error: -=-=-=- System Events got an error: Access for assistive devices is disabled. -=-=-=- so if i goto system prefs and check "Enable access for assistive devices", then running the script i get this error: -=-=-=- System Events got

Re: Where to declare/initialise an NSOperationQueue

2009-02-14 Thread Michael Ash
On Sat, Feb 14, 2009 at 1:49 AM, Jacob Rhoden wrote: > Hi Guys, > > I have been starting to use NSOperationQueue. I have ended up with one put > in each controller (ie see below), but now I have one in too many > controllers. How does it work? Should I just have one global variable for > the opera

Re: NSTableView table contets Deletion problem

2009-02-14 Thread Luca Pazzerello
The easier way to do it is to assign the shortcut to a menu item, wich invokes your method. Obviously, when the method is called, you'll have to check the selected index(es) of the table view by calling - selectedRowIndexes or -selectedRow. --Luca C. 2009/2/14 Arun > Hi All, > > I have a scree

Re: alloc/release confusion

2009-02-14 Thread Luca Pazzerello
As the documentation reports, be careful: the -retainCount unfortunately doesn't usually return values useful to the debugging. --Luca C. 2009/2/14 mmalc Crawford > > On Feb 13, 2009, at 4:55 PM, Boon Chew wrote: > > Is there a way in Cocoa to find out the reference count of an object (for >> d

NSTextField's subclass...

2009-02-14 Thread Jean-Nicolas Jolivet
Hi there! I'm working on an NSTextField subclass (basically I need to change the TextField's appearance so it fits with an HUD style window) So far I've subclass it and overrode drawRect: so that I can draw my custom background... it's working well, however my problem is that when the te

NSRulerView custom labels

2009-02-14 Thread Richard Bannister
Folks I'm working on an app that will be using timestamps in a NSRulerView - in the format 0:01, 0:02, et al. As far as I can determine I can't do this directly by registering a special unit as there does not appear to be any support for two part units of this form. The header file for

Re: NSTextField's subclass...

2009-02-14 Thread Kyle Sluder
On Sat, Feb 14, 2009 at 2:02 PM, Jean-Nicolas Jolivet wrote: > I'm working on an NSTextField subclass (basically I need to change the > TextField's appearance so it fits with an HUD style window) You shouldn't need to re-implement the text drawing. Just set the appropriate attributes and let NST

Re: NSTreeController - Remove Children

2009-02-14 Thread Kyle Sluder
On Fri, Feb 13, 2009 at 6:49 PM, none given wrote: > I cannot seem to find how to do this by code, that is, for example, remove > from the tree all of Node2 children... NSTreeNode has a -childNodes method. I'd use that to recursively determine if each node has children, and then add those child

Re: Can anyone suggest a way to do this?

2009-02-14 Thread Kyle Sluder
On Fri, Feb 13, 2009 at 10:52 PM, Graham Cox wrote: > When stroking a path, I can clip to the inside or the outside of the path to > get a stroke inside or outside of the path's edge. But if the path is > open-ended, this doesn't work. Instead what I need is clipping to the "left" > or "right" of

CALayers Lost After Switching Window's ContentView

2009-02-14 Thread Bridger Maxwell
Hey, I have an application which must switch in and out of full screen mode. Going full screen is fine, but when I exit full-screen, my Core Animation components disappear! Some debugging shows that the CALayer that backs the view is still there and hasn't changed, but all of its sublayers have bee

Raw keyboard events under Cocoa

2009-02-14 Thread Shayne Wissler
Hello, Is there a way in cocoa to get the raw key press/release events? Let's say you were making a game that wanted to know when the control or caps lock key was down or up, how would you do that in Cocoa? Thanks, Shayne Wissler ___ Cocoa-dev mailin

Re: Raw keyboard events under Cocoa

2009-02-14 Thread Ken Thomases
On Feb 14, 2009, at 5:22 PM, Shayne Wissler wrote: Is there a way in cocoa to get the raw key press/release events? Let's say you were making a game that wanted to know when the control or caps lock key was down or up, how would you do that in Cocoa? For modifier keys, you get an NSFlagsChange

Fwd: [Bug 68083] [Help Wanted][Variant] Add support for Objective-C

2009-02-14 Thread Lars Sonchocky-Helldorf
Some of you might be interested in this. regards, Lars Anfang der weitergeleiteten E-Mail: Von: bugzilla-dae...@eclipse.org Datum: 14. Februar 2009 21:06:55 MEZ An: lars.sonchocky-helld...@hamburg.de Betreff: [Bug 68083] [Help Wanted][Variant] Add support for Objective-C https://

Re: Can anyone suggest a way to do this?

2009-02-14 Thread Graham Cox
On 15 Feb 2009, at 9:18 am, Kyle Sluder wrote: I'd either use NSShadow like Benjamin said, or if that doesn't work I'd clip a translated version of the path, draw the stroke, and then pop the graphics context and draw the original path with no stroke. Wlll... thanks, but this doesn't do

Re: Can anyone suggest a way to do this?

2009-02-14 Thread Graham Cox
To make clear what I mean, this screenshot shows the difference between clipping as is currently possible, and the effect that I need: http://apptree.net/images/line_clipping.png The upper path is clipped to the "outside" and obviously is not very useful. The lower path is clipped to the "r

Re: Line spacing in NSTextView

2009-02-14 Thread Slava Pestov
Is there a way to compute what the default leading would be for a font? This is for a Mac OS backend of a cross-platform GUI toolkit, so I can't really just use NSTextView here. Slava On Fri, Feb 13, 2009 at 9:16 PM, Graham Cox wrote: > Line spacing (or to be more precise, leading) is an attribu

Re: Line spacing in NSTextView

2009-02-14 Thread Aki Inoue
Slava, Calculating an optimal vertical layout is pretty involved. At least, the Cocoa Text System has sophisticated logic to determine the ideal layout because of the numerous and varying design target for different fonts. For example, as you found out, many fonts designed in 80s have pr

Re: Where to declare/initialise an NSOperationQueue

2009-02-14 Thread Jerry Krinock
On 2009 Feb 14, at 08:36, Michael Ash wrote: http://www.mikeash.com/?page=pyblog/dont-use-nsoperationqueue.html If you read all the way to the end you'll see that NSOperationQueue can be induced to crash even when using only *one* queue in the entire program, so you can't save yourself by shar

Re: alloc/release confusion

2009-02-14 Thread mmalc Crawford
On Feb 14, 2009, at 10:56 AM, Luca Pazzerello wrote: As the documentation reports, be careful: the -retainCount unfortunately doesn't usually return values useful to the debugging. Umm, yes, that was the point of providing the link -- I'm expecting people to follow it and read... The docum

Re: Line spacing in NSTextView

2009-02-14 Thread Slava Pestov
On Sat, Feb 14, 2009 at 9:58 PM, Aki Inoue wrote: > The Text System encapsulates the logic to determine the ideal layout. It's > not just queried from a font instance. It requires the context of an entire > line. What if the line is rendered with a single font? Which font attributes are involve

Re: Line spacing in NSTextView

2009-02-14 Thread Aki Inoue
On Sat, Feb 14, 2009 at 9:58 PM, Aki Inoue wrote: The Text System encapsulates the logic to determine the ideal layout. It's not just queried from a font instance. It requires the context of an entire line. What if the line is rendered with a single font? Which font attributes are invo

Re: Line spacing in NSTextView

2009-02-14 Thread Slava Pestov
On Sun, Feb 15, 2009 at 12:26 AM, Aki Inoue wrote: > The most simple logic for getting the default line height can be accessible > via -[NSLayoutManager defaultLineHeightForFont:]. > AppKit puts descent + leading below the baseline, so you should be able to > calculate the line spacing delta on to