Re: Mounting AFP Volume using Cocoa

2008-04-17 Thread Jens Alfke
On 17 Apr '08, at 1:19 PM, JanakiRam wrote: Is there any cocoa way to mount a volume silently by passing the user name and password. There is no Objective-C API; you'll have to use either CoreServices or POSIX APIs. I would look at the FSVolumeMount function. —Jens smime.p7s Descripti

Re: @dynamic and Programmatic Access to Setters

2008-04-17 Thread Jens Alfke
I've successfully used @dynamic property implementations with CoreData managed-object subclasses. The only limitation I know of is that it only works with object-valued properties, not scalars. But that's not what you're running into. My guess would be that you're not instantiating the obje

Re: Why is [nil aMessage] a no-op?

2008-04-17 Thread Jens Alfke
On 17 Apr '08, at 9:56 PM, Adam P Jenkins wrote: Can you give an example of where invoking methods on nil objects would make sense in a non-error-path situation? I'm not trying to be argumentative here, I'm really curious to know what Objective-C idioms take advantage of the nil-swallows

Re: Why is [nil aMessage] a no-op?

2008-04-17 Thread Sherm Pendley
On Fri, Apr 18, 2008 at 12:56 AM, Adam P Jenkins <[EMAIL PROTECTED]> wrote: > > Can you give an example of where invoking methods on nil objects would > make sense in a non-error-path situation? I'm not trying to be > argumentative here, I'm really curious to know what Objective-C idioms take >

Re: Why is [nil aMessage] a no-op?

2008-04-17 Thread Bill Bumgarner
On Apr 17, 2008, at 11:56 PM, Adam P Jenkins wrote: Can you give an example of where invoking methods on nil objects would make sense in a non-error-path situation? I'm not trying to be argumentative here, I'm really curious to know what Objective-C idioms take advantage of the nil-swallow

Re: Why is [nil aMessage] a no-op?

2008-04-17 Thread Michael Vannorsdel
A common place I see nil swallowing is pulling arrays from a dictionary or hash table. NSArray * theArray = get_next(table); int i, count = [theArray count]; for(i = 0;i < count;i++) { //do stuff } If the array is nil count is zero and the for loop is not entered. Avoided adding a

Re: Why is [nil aMessage] a no-op?

2008-04-17 Thread Graham Cox
On 18 Apr 2008, at 3:01 pm, Adam P Jenkins wrote: I don't understand how the nil-swallows-messages behavior relieves you of having to check for errors. I never said it did. But there are plenty situations where getting nil isn't an error, it's just reflective of a particular state. The wa

Re: @dynamic and Programmatic Access to Setters

2008-04-17 Thread Paul Goracke
On Apr 17, 2008, at 8:47 PM, Mike Rossetti wrote: Yes, that's my understanding. But according to the comments I mentioned in my earlier message, Core Data provides the implementations. And clearly it does since I can edit, save and restore the document. But you're doing all that via bin

Re: @dynamic and Programmatic Access to Setters

2008-04-17 Thread Quincey Morris
On Apr 17, 2008, at 20:15, Mike Rossetti wrote: Then I add a class method that creates a new Tip and tries the following assignment (two approaches shown): newTip.tipName = @"FUBAR"; [newTip setTipName:@"FUBAR"]; It would be interesting to know if, at the point of the error, the gett

Re: Unregistering KVO observers

2008-04-17 Thread Steve Nicholson
On Apr 17, 2008, at 9:01 PM, Hal Mueller wrote: Look at Malcolm Crawford's Graphics Bindings example, which contains among other things two methods on GraphicsView to start and stop observation when an object of that class is created or destroyed. http://homepage.mac.com/mmalc/CocoaExample

Re: Why is [nil aMessage] a no-op?

2008-04-17 Thread Adam P Jenkins
On Apr 17, 2008, at 9:19 PM, Graham Cox wrote: On 18 Apr 2008, at 8:42 am, Adam P Jenkins wrote: trying to invoke a method on whatever their equivalent of nil is produces a runtime error of some sort. Actually in C++ it produces a solid, good old fashioned crash (I don't know about the

Re: Why is [nil aMessage] a no-op?

2008-04-17 Thread Adam P Jenkins
On Apr 18, 2008, at 12:47 AM, Bill Bumgarner wrote: On Apr 17, 2008, at 11:20 PM, Adam P Jenkins wrote: Exactly. And now that the convention of methods returning self no longer exists, it seems like there's no longer any advantage to this behavior. There are 10s of thousands invocations

Re: Why is [nil aMessage] a no-op?

2008-04-17 Thread Bill Bumgarner
On Apr 17, 2008, at 11:20 PM, Adam P Jenkins wrote: Exactly. And now that the convention of methods returning self no longer exists, it seems like there's no longer any advantage to this behavior. There are 10s of thousands invocations of methods on nil objects during the normal, non-erro

Re: Determining which sheet closed with panels in separate nibs

2008-04-17 Thread Michael Watson
I don't know why this didn't occur to me originally, but it's exactly what I need. Thanks for the help, guys. -- m-s On 17 Apr, 2008, at 17:12, Jean-Daniel Dupas wrote: Le 17 avr. 08 à 22:44, Sherm Pendley a écrit : On Thu, Apr 17, 2008 at 3:49 PM, Michael Watson [EMAIL PROTECTED]> wrote:

Re: Why is [nil aMessage] a no-op?

2008-04-17 Thread Adam P Jenkins
On Apr 17, 2008, at 7:07 PM, Bill Bumgarner wrote: (1) And many Java programmers find the constant need to check for nulls or null pointer exceptions to be ugly and inconvenient I would agree that this was a problem if I thought it was common to encounter situations where invoking meth

Re: 1-bit NSBitmapImageRep?

2008-04-17 Thread Graham Cox
Thanks for this, and to others who suggested the same thing - it works GREAT, and was a trivial change to make in my app. It also allowed me to cut out a whole bunch of stuff having to do with maintaining the bitmap cache - I do love it when I can chop lots of code out and things work bette

Re: @dynamic and Programmatic Access to Setters

2008-04-17 Thread Mike Rossetti
On Apr 17, 2008, at 10:12 PM, Jack Repenning wrote: On Apr 17, 2008, at 8:47 PM, Mike Rossetti wrote: Yes, that's my understanding. But according to the comments I mentioned in my earlier message, Core Data provides the implementations. And clearly it does since I can edit, save and resto

Re: @dynamic and Programmatic Access to Setters

2008-04-17 Thread Jack Repenning
On Apr 17, 2008, at 8:47 PM, Mike Rossetti wrote: Yes, that's my understanding. But according to the comments I mentioned in my earlier message, Core Data provides the implementations. And clearly it does since I can edit, save and restore the document. I'm just missing the 'magic' that

Re: Unregistering KVO observers

2008-04-17 Thread Hal Mueller
Look at Malcolm Crawford's Graphics Bindings example, which contains among other things two methods on GraphicsView to start and stop observation when an object of that class is created or destroyed. http://homepage.mac.com/mmalc/CocoaExamples/controllers.html I use -removeObserver:forKeyPath

Re: @dynamic and Programmatic Access to Setters

2008-04-17 Thread Mike Rossetti
Hi Jack, Thanks for the reply! On Apr 17, 2008, at 9:26 PM, Jack Repenning wrote: On Apr 17, 2008, at 8:15 PM, Mike Rossetti wrote: Bindings clearly work so I'm surprised the setTipName isn't synthesized and available for my use. You haven't given us enough info to be sure that tipName work

Re: @dynamic and Programmatic Access to Setters

2008-04-17 Thread Jack Repenning
On Apr 17, 2008, at 8:15 PM, Mike Rossetti wrote: Bindings clearly work so I'm surprised the setTipName isn't synthesized and available for my use. You haven't given us enough info to be sure that tipName works in any sense, prior to your added class method that you mention. So when you

@dynamic and Programmatic Access to Setters

2008-04-17 Thread Mike Rossetti
I'm a bit confused by @dynamic and hoping there's a simple explanation. My little project has a data model and a custom class (Tip) for one of the classes in the model. The Tip interface defines the attributes, one of which is: @property (retain) NSString *tipName; Tip's implementation

Re: Why is [nil aMessage] a no-op?

2008-04-17 Thread Michael Ash
On Thu, Apr 17, 2008 at 9:51 PM, David Wilson <[EMAIL PROTECTED]> wrote: > I think the question that arises, and a primary reason for preferring > one over the other, is how much of a risk one thinks that scenario is. > Personally, I prefer (even as an end user) that the program simply die > an

Re: Quartz.framework Catch-22 on Panther

2008-04-17 Thread Michael Ash
On Thu, Apr 17, 2008 at 10:13 AM, Nick Nallick <[EMAIL PROTECTED]> wrote: > I've been able to solve my problem by taking Quartz.framework out of my > project and loading QuartzComposer.framework directly at runtime with > NSBundle. For example: > > Instead of: > > QCRenderer* renderer = [

Re: 1-bit NSBitmapImageRep?

2008-04-17 Thread Michael Ash
On Thu, Apr 17, 2008 at 8:41 PM, Graham Cox <[EMAIL PROTECTED]> wrote: > If only life were that simple... > > The requirement is to hit-test a stroked or filled path to pixel-perfect > accuracy. Yes there is containsPoint: and that other one in CG for > hit-testing a stroke, but these are blunt in

Re: Why is [nil aMessage] a no-op?

2008-04-17 Thread David Wilson
On Thu, Apr 17, 2008 at 9:19 PM, Graham Cox <[EMAIL PROTECTED]> wrote: > Actually in C++ it produces a solid, good old fashioned crash (I don't know > about the others). > > This isn't good - it means you have to check every single return value and > pointer for nil before you can use it - code

Re: Why is [nil aMessage] a no-op?

2008-04-17 Thread Graham Cox
On 18 Apr 2008, at 8:42 am, Adam P Jenkins wrote: trying to invoke a method on whatever their equivalent of nil is produces a runtime error of some sort. Actually in C++ it produces a solid, good old fashioned crash (I don't know about the others). This isn't good - it means you have to

Re: Cannot Remove Observer Error [The Quest Continues]

2008-04-17 Thread Thaddeus Cooper
So I have done more digging to try and understand what is going on with this problem. I added addObserver and removeObserver methods to the array controller and the wine object to see what was being set and removed. It turns out that the array controller is telling the wine object to remove

Re: Why is [nil aMessage] a no-op?

2008-04-17 Thread Jeff
I find it very useful, since messages to nil are valid, a whole lot of exception handling can be avoided (since it's done for you). Generating a run-time error would imply that you shouldn't send a message to nil, which would mean that you ought to do nil checks each time you change/set a pointer.

Re: 1-bit NSBitmapImageRep?

2008-04-17 Thread Graham Cox
If only life were that simple... The requirement is to hit-test a stroked or filled path to pixel- perfect accuracy. Yes there is containsPoint: and that other one in CG for hit-testing a stroke, but these are blunt instruments when it comes to all the possible stylistic variations that can

PageView with NSTextView?

2008-04-17 Thread Lincoln Green
I can't find anything on implementing this. I think I should be looking at NSTextStorage, but can't figure out anything from that either. Any general tips/links/tutorials/word of advice are welcome. Thanks! -LG ___ Cocoa-dev mailing list (

Re: Weird build error

2008-04-17 Thread Chris Suter
On 18/04/2008, at 9:54 AM, Kyle Sluder wrote: GCC is alerting you to the fact that the switch at the end of the statement is unnecessary. That's not what GCC is trying to do; GCC is trying to alert you to the fact that it's invalid syntax. As I just said in my earlier e-mail, labels must

Re: Weird build error

2008-04-17 Thread Shawn Erickson
On Thu, Apr 17, 2008 at 4:54 PM, Kyle Sluder <[EMAIL PROTECTED]> wrote: > GCC is alerting you to the fact that the switch at the end of the > statement is unnecessary. If you really want to do something for all > cases, use default. Otherwise just omit it. Using the empty > statement (; by it

Re: Weird build error

2008-04-17 Thread Kyle Sluder
GCC is alerting you to the fact that the switch at the end of the statement is unnecessary. If you really want to do something for all cases, use default. Otherwise just omit it. Using the empty statement (; by itself) will fool GCC, but an empty default case is useless. --Kyle Sluder _

Re: Weird build error

2008-04-17 Thread Chris Suter
On 18/04/2008, at 9:15 AM, Michael Vannorsdel wrote: Change it to: - (void)TestFunction { switch (1) { case 1: { NSMutableArray *myArray=[[NSMutableArray alloc] init]; break;

Re: Weird build error

2008-04-17 Thread Don Arnel
Ah, that did the trick! I love mailing lists! Many thanks to all who responded. On Apr 17, 2008, at 7:15 PM, Michael Vannorsdel wrote: Change it to: - (void)TestFunction { switch (1) { case 1: { NSMutableArray *my

Re: Weird build error

2008-04-17 Thread Michael Vannorsdel
Change it to: - (void)TestFunction { switch (1) { case 1: { NSMutableArray *myArray=[[NSMutableArray alloc] init]; break; } } } No need to declare defa

Re: Weird build error

2008-04-17 Thread Wayne Packard
The break isn't required, but something is. You could put NSLog(@"defaulting"); after default:. Or you could put a semicolon; or a lovely set of empty braces. To fix the other problem, try this: switch (1) { case 1: { NSMutableArray *myArray=[[NSMutableArray a

Re: Weird build error

2008-04-17 Thread Keary Suska
on 4/17/08 4:56 PM, [EMAIL PROTECTED] purportedly said: > A break; is not required, but it does cause the compound statement > error to go away. Even with the break; inserted the other error still > occurs if the comments are removed. > > On Apr 17, 2008, at 6:50 PM, Robert Kukuchka wrote: > >>

Re: Why is [nil aMessage] a no-op?

2008-04-17 Thread Bill Bumgarner
On Apr 17, 2008, at 5:42 PM, Adam P Jenkins wrote: I'm curious if anyone knows the rationale behind the decision to make sending messages to nil be a no-op in ObjC. I've used a number of other OO languages, including C++, Java, Python, Ruby, Smalltalk, and Javascript, and in all of them, t

Re: Why is [nil aMessage] a no-op?

2008-04-17 Thread Nick Zitzmann
On Apr 17, 2008, at 4:42 PM, Adam P Jenkins wrote: I'm curious if anyone knows the rationale behind the decision to make sending messages to nil be a no-op in ObjC. I've used a number of other OO languages, including C++, Java, Python, Ruby, Smalltalk, and Javascript, and in all of them,

Re: Weird build error

2008-04-17 Thread Jonathan del Strother
On Thu, Apr 17, 2008 at 11:47 PM, Don Arnel <[EMAIL PROTECTED]> wrote: > I've been working on a project for a few weeks now and suddenly today I get > this error while building (see below). I was getting this same error in one > of my real classes so after commenting out almost every bit of code an

Re: Weird build error

2008-04-17 Thread Don Arnel
A break; is not required, but it does cause the compound statement error to go away. Even with the break; inserted the other error still occurs if the comments are removed. On Apr 17, 2008, at 6:50 PM, Robert Kukuchka wrote: you forgot the break; ___

Re: Weird build error

2008-04-17 Thread Hamish Allan
On Fri, Apr 18, 2008 at 12:47 AM, Don Arnel <[EMAIL PROTECTED]> wrote: > switch (1) { > default: > } > (x)(error: label at end of compound statement) You need a statement to execute for the default case. The code you have written is equivalent to: - (vo

Re: Weird build error

2008-04-17 Thread Robert Kukuchka
you forgot the break; On 17-Apr-08, at 3:47 PM, Don Arnel wrote: I've been working on a project for a few weeks now and suddenly today I get this error while building (see below). I was getting this same error in one of my real classes so after commenting out almost every bit of code and st

Re: Using Properties at Outlets

2008-04-17 Thread Adam P Jenkins
The only potential problem I can see with this is whether IB will use the generated accessor methods to set the outlets, or if it will just access the ivars directly. If it does the latter, then no property change notifications will be sent to observers when IB sets the outlet. If that's

Weird build error

2008-04-17 Thread Don Arnel
I've been working on a project for a few weeks now and suddenly today I get this error while building (see below). I was getting this same error in one of my real classes so after commenting out almost every bit of code and still seeing the error, I decided to just create a new TestClass an

Why is [nil aMessage] a no-op?

2008-04-17 Thread Adam P Jenkins
I'm curious if anyone knows the rationale behind the decision to make sending messages to nil be a no-op in ObjC. I've used a number of other OO languages, including C++, Java, Python, Ruby, Smalltalk, and Javascript, and in all of them, trying to invoke a method on whatever their equival

Re: NSValue value:withObjCType:

2008-04-17 Thread Gerriet M. Denkmann
On 17 Apr 2008, at 17:56, Keary Suska wrote: on 4/17/08 9:31 AM, [EMAIL PROTECTED] purportedly said: NSValue has two methods: value:withObjCType: and valueWithBytes:objCType: . What is the difference between these two methods? When do I have to use the first, when the second? I am rather conf

Re: Determining which sheet closed with panels in separate nibs

2008-04-17 Thread Jean-Daniel Dupas
Le 17 avr. 08 à 22:44, Sherm Pendley a écrit : On Thu, Apr 17, 2008 at 3:49 PM, Michael Watson <[EMAIL PROTECTED]> wrote: Inside of MainMenu.nib, I have my application's main window. Also in MainMenu.nib is an NSObject subclass instance that is the main window's delegate. In another nib, I

Re: -charactersIgnoringModifiers and the shift key

2008-04-17 Thread John Stiles
Here's what I ended up with. It's really not pretty but I think it should handle everything. I derived this from code on Carbon-dev (see "iGetKeys sample code problems in Tiger") so I think it's only fair to give back :) BTW, word to the wise, the Carbon-dev code looks like it has an endian bug,

Re: Determining which sheet closed with panels in separate nibs

2008-04-17 Thread Sherm Pendley
On Thu, Apr 17, 2008 at 3:49 PM, Michael Watson <[EMAIL PROTECTED]> wrote: > Inside of MainMenu.nib, I have my application's main window. Also in > MainMenu.nib is an NSObject subclass instance that is the main window's > delegate. > > In another nib, I have a panel and an NSObject subclass instan

Re: -charactersIgnoringModifiers and the shift key

2008-04-17 Thread John Stiles
Hmm, OK. I guess there's no harm in leaving in the KCHR handling code. I was hoping to simplify things (this routine is already big and yucky) but I guess that's just not in the cards. Nothing about this whole hotkey ordeal has been simple! Ken Thomases wrote: On Apr 17, 2008, at 11:38 AM, J

Re: adding Quicklook preview to my app

2008-04-17 Thread Brandon Walkin
On 17-Apr-08, at 4:07 PM, Victor Bovio wrote: Hi, I have a document based Cocoa app (CAD-like), to which I like to add the Leopard quicklook plugin feature. I tried first looking at the Documentation, but looks overwhelming to me, is there a simple tutorial or examples somewhere I can look

Mounting AFP Volume using Cocoa

2008-04-17 Thread JanakiRam
Hi All, I'm working on a cocoa application which needs to mount a afp volume. I've found a way to mount a volume using AppleScript with Finder object. Example using mount volume command. Is there any cocoa way to mount a volume silently by passing the user name and password. Please h

adding Quicklook preview to my app

2008-04-17 Thread Victor Bovio
Hi, I have a document based Cocoa app (CAD-like), to which I like to add the Leopard quicklook plugin feature. I tried first looking at the Documentation, but looks overwhelming to me, is there a simple tutorial or examples somewhere I can look at ?? Basically I just want to embed a snapshot

Unregistering KVO observers

2008-04-17 Thread Steve Nicholson
I'm using NSDocument/NSWindowController with bindings in the NSWindowController subclass set up in Interface Builder. When I close the window, I get the message "An instance 0x306860 of class Problem is being deallocated while key value observers are still registered with it." I'd like to u

Re: -charactersIgnoringModifiers and the shift key

2008-04-17 Thread Ken Thomases
On Apr 17, 2008, at 11:38 AM, John Stiles wrote: Quick question: in Leopard, are there any keyboards left which don't have a uchr? I found some sample code which includes a fallback case for if no 'uchr' resource is found (it uses plain KeyTranslate in this case) and I'm wondering whether

Determining which sheet closed with panels in separate nibs

2008-04-17 Thread Michael Watson
Inside of MainMenu.nib, I have my application's main window. Also in MainMenu.nib is an NSObject subclass instance that is the main window's delegate. In another nib, I have a panel and an NSObject subclass instance that is the panel's delegate. The panel is opened attached as a sheet to

Re: Vended Object Setters

2008-04-17 Thread Ken Thomases
On Apr 17, 2008, at 11:19 AM, Justin Giboney wrote: Actually that didn't work... it appears to be setting it as I go through the set method, but when I go to get it it is almost as if it is calling an object in a different memory set. Sounds like you're getting the memory management wrong.

OpenGL in a Visual iTunes Plugin

2008-04-17 Thread J. Todd Slack
Hi All, I wish to create a UI using OpenGL for use in an ITunes Visualizer Plugin. Can anyone tell me how to get started? I have the Visualizer SDK already. Is there anything OpenGL wise that I have to download? Is there a tool, like Interface Builder, that I can drag and drop the interf

Re: NSArrayController bound to @unionOfArrays not updating

2008-04-17 Thread Quincey Morris
On Apr 17, 2008, at 10:31, mmalc crawford wrote: On Apr 17, 2008, at 9:36 AM, Quincey Morris wrote: Just so I understand, should I surround calls to any of the standard KVC method calls (in my case, insertObject:atIndex:) with [self willChangeValueForKey:@"affectedKey"]; and [self didChan

Re: Core Animation/Layers and Borderless Windows

2008-04-17 Thread David Duncan
On Apr 16, 2008, at 6:49 PM, Karl Goiser wrote: I'm creating a borderless window whose content view uses Core Animation... When I do this, the window is drawn without any shadow no matter the alpha of the content. - a borderless window with a normal view draws the window's shadow. - a no

Implementing NSHUDWindowMask on NSDrawer

2008-04-17 Thread Sam Krishna
Just for fun, I'm trying to implement an NSDrawer object with a HUD- style look'n'feel to it. As it turns out, it is not a subclass of NSWindow that lets me do what I need to do. If NSDrawer was that, it would be easy, otherwise, not so much. SO, here's my Q: (1) *Can* I implement a subcl

Re: printing in Cocoa

2008-04-17 Thread Chris Hanson
On Apr 16, 2008, at 9:03 AM, Victor Bovio wrote: Does anyone knows a good book or tutorial that covers printing (in- depth) in Cocoa apps ??, I have Hillegass book but just covers the minimal steps for printing.. When I was learning how printing worked in Cocoa, I read the parts of Aaron's

Re: Cannot Remove Observer Error

2008-04-17 Thread mmalc crawford
On Apr 17, 2008, at 10:45 AM, Thaddeus Cooper wrote: As far as I know these are correct. But I'm sure someone will tell me if they aren't ;-) Just for reassurance, they look OK to me. I can't remember if you're targeting 10.5+? If so, you should try to avoid writing your own accessor meth

Re: NSTextField vertical sizeToFit

2008-04-17 Thread Rob Napier
On Apr 13, 2008, at 4:38 AM, Jeff wrote: Any way to take an NSTextField containing some amount of text, and resize it vertically so all the text fits within the frame? The sizeToFit message seems to do this, except on the horizontal axis. Thank you! It's a little easier to do this with an N

Re: Simulating menu bar blink in Cocoa

2008-04-17 Thread Randall Meadows
On Apr 17, 2008, at 12:05 PM, John Stiles wrote: Randall Meadows wrote: On Apr 17, 2008, at 11:54 AM, John Stiles wrote: As previously explained here, I'm handling hotkeys in my app via custom code in order to work around some AppKit bugs. How can I simulate the menu-title blink effect using

Re: Simulating menu bar blink in Cocoa

2008-04-17 Thread John Stiles
John Stiles wrote: Randall Meadows wrote: On Apr 17, 2008, at 11:54 AM, John Stiles wrote: As previously explained here, I'm handling hotkeys in my app via custom code in order to work around some AppKit bugs. How can I simulate the menu-title blink effect using Cocoa? In Carbon, it's FlashM

Re: Simulating menu bar blink in Cocoa

2008-04-17 Thread John Stiles
Randall Meadows wrote: On Apr 17, 2008, at 11:54 AM, John Stiles wrote: As previously explained here, I'm handling hotkeys in my app via custom code in order to work around some AppKit bugs. How can I simulate the menu-title blink effect using Cocoa? In Carbon, it's FlashMenuBar(menuID) but I

Re: Simulating menu bar blink in Cocoa

2008-04-17 Thread Randall Meadows
On Apr 17, 2008, at 11:54 AM, John Stiles wrote: As previously explained here, I'm handling hotkeys in my app via custom code in order to work around some AppKit bugs. How can I simulate the menu-title blink effect using Cocoa? In Carbon, it's FlashMenuBar(menuID) but I don't see a Cocoa equ

Simulating menu bar blink in Cocoa

2008-04-17 Thread John Stiles
As previously explained here, I'm handling hotkeys in my app via custom code in order to work around some AppKit bugs. How can I simulate the menu-title blink effect using Cocoa? In Carbon, it's FlashMenuBar(menuID) but I don't see a Cocoa equivalent. _

Re: to make NSOutlineView faster

2008-04-17 Thread Corbin Dunn
On Apr 17, 2008, at 7:48 AM, Nick Rogers wrote: Hi, I have NSOutlineView display a tree of files and folders in the root "/" filesystem. I also have checkboxes in the first column. whenever a item is clicked, say first time, then this item and all its children are also marked internally. so

Re: Cannot Remove Observer Error

2008-04-17 Thread Thaddeus Cooper
Mark -- Thanks for the input. The code for the accessor methods are shown below: - (NSManagedObject *)wineType { id tmpObject; DebugMessage(@"entering"); [self willAccessValueForKey: @"wineType"]; tmpObject = [self primitiveValueForKey: @"wineType"]; [self didAccessValu

Re: NSArrayController bound to @unionOfArrays not updating

2008-04-17 Thread mmalc crawford
On Apr 17, 2008, at 9:36 AM, Quincey Morris wrote: Just so I understand, should I surround calls to any of the standard KVC method calls (in my case, insertObject:atIndex:) with [self willChangeValueForKey:@"affectedKey"]; and [self didChangeValueForKey:@"affectedKey"] if the standard KVC

Re: -charactersIgnoringModifiers and the shift key

2008-04-17 Thread Jean-Daniel Dupas
Now that you say it, "[" is produced using "alt + shift + (" on french keyboard, and "alt + (" output "{". So "cmd + [" is actualy on french keyboard "cmd + alt + shift + (" shortcut are really not good candidate for internationalization. Le 17 avr. 08 à 19:11, Hank Heijink (Mailinglists) a

Re: Setting the value of an array element

2008-04-17 Thread Sherm Pendley
On Thu, Apr 17, 2008 at 12:15 PM, Johnny Lundy <[EMAIL PROTECTED]> wrote: > I imagine this is a very dumb question, but I am perplexed. > > NSArray says you can change the values of elements, but not > add/subtract/replace elements. > > Let's say I have an NSArray @"Tom", @"Dick", @"Harry", nil

Re: -charactersIgnoringModifiers and the shift key

2008-04-17 Thread John Stiles
I think you missed the part where I explained about how the user can customize the hotkeys to whatever they want :) Right now the UI is set up so that they pick a key, then they pick what modifiers they want. It makes way more sense from an end-user perspective to choose the "1" key and then c

Re: -charactersIgnoringModifiers and the shift key

2008-04-17 Thread Hank Heijink (Mailinglists)
I assume you picked cmd-shift-[ because the curly brace makes sense, in which case you really are looking for cmd-{. If someone has a keyboard where the shifted version of [ is @ (no idea if such a keyboard actually exists), you might not want your shortcut to be cmd- shift-[. So, I think

Re: -charactersIgnoringModifiers and the shift key

2008-04-17 Thread Jean-Daniel Dupas
I don't think so. The API to retreive KCHR is deprecated and does not exists on 64 bits, so it would mean that a kchr keyboard cannot be used with 64 bits software. Le 17 avr. 08 à 18:38, John Stiles a écrit : Quick question: in Leopard, are there any keyboards left which don't have a u

Re: -charactersIgnoringModifiers and the shift key

2008-04-17 Thread John Stiles
OK, I've got this implemented. Good news: it seems to work great for punctuation and letters. Bad news: it doesn't seem to work for other keys, like F-keys or arrow keys. Or rather, it generates a result, but not the same values as NSF1FunctionKey or NSUpArrowFunctionKey. It's coming up with low

RE: -charactersIgnoringModifiers and the shift key

2008-04-17 Thread John Stiles
I'm currently cribbing from here: http://lists.apple.com/archives/carbon-dev/2005/May/msg01062.html And I got rid of the non-uchr section. I can require Leopard in this case. From: Jean-Daniel Dupas [mailto:[EMAIL PROTECTED] Sent: Thursday, April 17, 2008 9:37 AM To: John Stiles Cc: co

Re: Setting the value of an array element

2008-04-17 Thread Gregory Weston
Johnny Lundy wrote: I imagine this is a very dumb question, but I am perplexed. NSArray says you can change the values of elements, but not add/ subtract/replace elements. Right. Meaning if a contained object it mutable, you can mutate it and the NSArray won't care. Let's say I have an N

Re: Setting the value of an array element

2008-04-17 Thread Jens Alfke
On 17 Apr '08, at 9:15 AM, Johnny Lundy wrote: NSArray says you can change the values of elements, but not add/ subtract/replace elements. Nope; NSArrays are completely immutable. To make any modifications you first have to make a mutable copy, and then modify that. (The same goes for NSD

Re: -charactersIgnoringModifiers and the shift key

2008-04-17 Thread John Stiles
Quick question: in Leopard, are there any keyboards left which don't have a uchr? I found some sample code which includes a fallback case for if no 'uchr' resource is found (it uses plain KeyTranslate in this case) and I'm wondering whether this is still relevant in the Leopard-and-above timef

Re: -charactersIgnoringModifiers and the shift key

2008-04-17 Thread Jean-Daniel Dupas
Le 17 avr. 08 à 18:18, John Stiles a écrit : Sweet, I will take a look at this and post back when I have results or questions. Thanks! Greg Titus wrote: I think you'd ask the NSEvent for its -keyCode, then pass that key code to UCKeyTranslate() with all the modifier key state (including

Re: NSArrayController bound to @unionOfArrays not updating

2008-04-17 Thread Quincey Morris
On Apr 17, 2008, at 01:42, William Towe wrote: Yep, that took care of it. Just so I understand, should I surround calls to any of the standard KVC method calls (in my case, insertObject:atIndex:) with [self willChangeValueForKey:@"affectedKey"]; and [self didChangeValueForKey:@"affected

Re: WebKit+AppleScript+JavaScript

2008-04-17 Thread Jens Alfke
On 17 Apr '08, at 9:08 AM, Praveen Kumar wrote: I created a sample cocoa+webkit application and added apple scriptability. I execute the script on this application from script editor. The application opened the given url successfully, but i can't able to quit the application from the dock

Re: Capsule-Style Toolbar Controls

2008-04-17 Thread Stefan Hafeneger
Hi Peter, I uploaded two screenshots from Mail (in the background) and a demo app (in the foreground) designed just in Interface Builder. The size of the segmented control is exactly the same but there is a difference in the baseline. http://homepage.mac.com/stefan.hafeneger/.cv/stefan.ha

Re: Vended Object Setters

2008-04-17 Thread Justin Giboney
Actually that didn't work... it appears to be setting it as I go through the set method, but when I go to get it it is almost as if it is calling an object in a different memory set. I set up the protocol, and I am using bycopy. Thanks, Justin Giboney On Apr 17, 2008, at 9:25 AM, Ken Thom

Re: -charactersIgnoringModifiers and the shift key

2008-04-17 Thread John Stiles
Sweet, I will take a look at this and post back when I have results or questions. Thanks! Greg Titus wrote: I think you'd ask the NSEvent for its -keyCode, then pass that key code to UCKeyTranslate() with all the modifier key state (including shift) turned off in order to get a unicode string

Setting the value of an array element

2008-04-17 Thread Johnny Lundy
I imagine this is a very dumb question, but I am perplexed. NSArray says you can change the values of elements, but not add/ subtract/replace elements. Let's say I have an NSArray @"Tom", @"Dick", @"Harry", nil And I want to change Tom and Dick to Mutt and Jeff. Is my only option to make it

Re: -charactersIgnoringModifiers and the shift key

2008-04-17 Thread Greg Titus
I think you'd ask the NSEvent for its -keyCode, then pass that key code to UCKeyTranslate() with all the modifier key state (including shift) turned off in order to get a unicode string for what that key would mean if the user hadn't been pressing any modifiers. Hope that helps, - G

Re: WebKit+AppleScript+JavaScript

2008-04-17 Thread Praveen Kumar
I used that one Jean-Daniel Dupas specified. -[NSWorkspace openURLs:withAppBundleIdentifier:options:additionalEventParamDescriptor:launchIdentifiers :]; where i gave nil for last two arguments. I created a sample cocoa+webkit application and added apple scriptability. I execute the script

-charactersIgnoringModifiers and the shift key

2008-04-17 Thread John Stiles
I have an NSEvent and I need to know what key the user has pressed, minus any of the modifiers. NSEvent -charactersIgnoringModifiers seems like a good place to start, but it has one serious flaw—it does not ignore the Shift key. So, for instance, it won't change ~ to `, ! to 1 or { to [. I ne

Re: NSValue value:withObjCType:

2008-04-17 Thread Keary Suska
on 4/17/08 9:31 AM, [EMAIL PROTECTED] purportedly said: >> NSValue has two methods: value:withObjCType: and >> valueWithBytes:objCType: . >> >> What is the difference between these two methods? When do I have to >> use the first, when the second? >> I am rather confused. > > Read the documentati

Re: How does bind:toObject:withKeyPath:options: work?

2008-04-17 Thread Keary Suska
on 4/17/08 4:50 AM, [EMAIL PROTECTED] purportedly said: >> I think you can use of a class that inherits from NSArrayController > > Thanks for your reply. Subclassing and caching did occur to me (which > I should have mentioned), but having to do that sort of thing rather > defeats the purpose of

Re: NSValue value:withObjCType:

2008-04-17 Thread Jens Alfke
On 16 Apr '08, at 1:46 AM, Gerriet M. Denkmann wrote: NSValue has two methods: value:withObjCType: and valueWithBytes:objCType: . What is the difference between these two methods? When do I have to use the first, when the second? I am rather confused. Read the documentation. For the fir

Re: Vended Object Setters

2008-04-17 Thread Ken Thomases
On Apr 17, 2008, at 10:01 AM, Justin Giboney wrote: bycopy worked, thank you. Uh, OK. Glad it helped, but your original problem is still mysterious. I don't know about you, but I don't like blindly fixing things without understanding them. Does this mean though that I need to duplicate

Re: Vended Object Setters

2008-04-17 Thread Jean-Daniel Dupas
To declare a vended object, you should first declare a protocol that contains the methods you want to expose and that defines the methods behaviors (bycopy, byref, in, out, etc...) Then, you create a class that conforms to this protocol. You may omit the bycopy, byref and other modifiers in y

  1   2   >