NSButtonCell doesn't visually update during trackMouse:inRect:ofView:untilMouseUp:

2008-03-17 Thread Ben Lachman
I have a few NSButtonCells that I'm using in a custom view. I need them to track the mouse during clicks and do this by calling NSCell's trackMouse:inRect:ofView:untilMouseUp:. This works fine except that the button cells never update their graphical state by highlighting or whatever.

Prevent application activation after dragging items to the Dock icon?

2008-03-17 Thread Peter Maurer
Cocoa applications tend to come to the foreground automatically whenever I drag files to their Dock icon. Sometimes, however, I'd prefer my application to stay in the background and just start working on the file, while giving feedback through the Dock icon. But this isn't supposed to be a

Bitmap fonts in Cocoa apps, line-height bug

2008-03-17 Thread Tobia Conforto
Hello I would like to know what are the best practices and recommended programs for preparing bitmap fonts for use in Cocoa applications. I'm also reporting what is probably a bug in either OS X or the available font editors. If there is a list better suited to this question, please

Re: Distributed Objects NSPortTimeoutException

2008-03-17 Thread John Pannell
Hi there- This may or may not apply to your situation, but I had an incident a few weeks ago in which I could not get DO to work with communication between machines using NSSocketPorts. I was on Leopard and using garbage collection. When I posted to the list, I received a response from

Re: Distributed Objects NSPortTimeoutException

2008-03-17 Thread Mac QA
On Mon, Mar 17, 2008 at 8:15 AM, John Pannell [EMAIL PROTECTED] wrote: I was on Leopard and using garbage collection. Unfortunately this problem is occurring on Tiger. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin

RE: Simple question

2008-03-17 Thread Luca Ciciriello
Yes, you got it. .h stands for header and is the place where you make your declarations, .m stands for module and is where the definitions take place. You can encounter also .mm exetension. In these file you can mix Objective-C an C++ language. Luca.

Return the value to a pop up window

2008-03-17 Thread Cocoa
I am trying to sodosomething more than the tutorial - Objective-C tutorial.pdf It's a Currency Converter application the part of the code is below: float amount; converter = [[Converter alloc]init]; [converter setSourceCurrencyAmount:[dollarField floatValue]];

Re: Simple question

2008-03-17 Thread Scott Thompson
On Mar 17, 2008, at 7:53 AM, Luca Ciciriello wrote: Yes, you got it. .h stands for header and is the place where you make your declarations, .m stands for module and is where the definitions take place. You can encounter also .mm exetension. In these file you can mix Objective-C an

Re: Simple question

2008-03-17 Thread Rob Keniger
On 17/03/2008, at 11:33 PM, Scott Thompson wrote: I would recommend that you find a nice book on C. I would recommend one, but it's been a while since I've surveyed the literature. I highly recommend Programming in Objective-C by Stephen Kochan. IMO it is by far the best introduction to

Re: Simple question

2008-03-17 Thread Kyle Sluder
On Mon, Mar 17, 2008 at 9:33 AM, Scott Thompson [EMAIL PROTECTED] wrote: I would recommend that you find a nice book on C. I would recommend one, but it's been a while since I've surveyed the literature. Get The C Programming Language by Kernighan and Ritchie. It is the gold standard of

Re: Simple question

2008-03-17 Thread Rob Napier
While KR is certainly the gold standard reference, I wouldn't recommend it as the book to learn the language. Kochan's Programming in Objective-C as noted by Rob Keniger is a much better introduction to what you'll need for programming on a Mac. After that one, I recommend Aaron Hillegass's Cocoa

Re: Convert NSString to FSRef

2008-03-17 Thread Kevin Dixon
Thanks for all the feed back, its been most helpful. -Kevin On Mar 15, 2008, at 12:04 PM, Kevin Dixon wrote: I'm trying to write a method that will convert a NSString containing a file system URL to an FSRef with the following code - (FSRef)stringToFSRef: (NSString*)filePath { FSRef

Re: NSButtonCell doesn't visually update during trackMouse:inRect:ofView:untilMouseUp:

2008-03-17 Thread glenn andreas
On Mar 17, 2008, at 1:42 AM, Ben Lachman wrote: I have a few NSButtonCells that I'm using in a custom view. I need them to track the mouse during clicks and do this by calling NSCell's trackMouse:inRect:ofView:untilMouseUp:. This works fine except that the button cells never update

Re: ScriptingBridgeConcepts problem

2008-03-17 Thread Christopher Nebel
On Mar 15, 2008, at 2:53 AM, Cocoa wrote: I am reading the Scripting Bridge Concepts.pdf, when I doing this in the terminal i got a error sdef /Applications/Mail.app | sdp -fh --basename Mail ( what I type in the Terminal) sdp: unknown type name OLD message editor. (computer responses)

Re: CA: How to wait for an animation to finish?

2008-03-17 Thread Jens Alfke
On 16 Mar '08, at 12:07 PM, John Harper wrote: Implicit animations are useful in many scenarios, but due to the simplicity of the API they don't cover everything. If there are things you'd like to see them extended to support please file bugs. Thanks for your detailed answers, John. The

Re: Prevent application activation after dragging items to the Dock icon?

2008-03-17 Thread Ryan Poling
There should be a delegate method you can implement to prevent this from happening. Perhaps the following one, although it doesn't look quite right to me. applicationShouldHandleReopen:hasVisibleWindows: -Ryan http://www.chimoosoft.com/ On Mar 17, 2008, at 12:36 AM, Peter Maurer wrote:

Re: Modifying glyph storage in NSLayoutManager

2008-03-17 Thread Douglas Davidson
On Mar 17, 2008, at 9:31 AM, Ross Carter wrote: What is the correct approach to take when you need NSLayoutManager to make on-the-fly adjustments to the glyphs Usually the glyph generator is used for default glyph generation, and the typesetter is used to make adjustments to the glyphs

Re: Prevent application activation after dragging items to the Dock icon?

2008-03-17 Thread Jens Alfke
On 17 Mar '08, at 9:26 AM, Ryan Poling wrote: applicationShouldHandleReopen:hasVisibleWindows: No, that delegate call controls what happens if your app is double- clicked when it's already running. Some apps respond to this by opening a new untitled document, for consistency in behavior.

Re: In receiver application, getting file passed in from NSWorkspace openFile:withApplication:

2008-03-17 Thread Jens Alfke
On 17 Mar '08, at 9:56 AM, Ryan Chapman wrote: In MaxPostProcessing.app, how can I determine the file that was the parameter passed to openFile: ?? In your class that's the NSApplication's delegate, implement the method - (BOOL)application:(NSApplication *)sender openFile:(NSString

Re: In receiver application, getting file passed in from NSWorkspace openFile:withApplication:

2008-03-17 Thread Robert Tillyard
If you're looking fot the equivalent of argc/argv you might be looking for... NSProcessInfo *procInfo = [NSProcessInfo processInfo]; NSArray *args = [procInfo arguments]; Regards, Rob. On 17 Mar 2008, at 16:56, Ryan Chapman wrote: Hi all, I have an application that uses NSWorkspace

Re: Distributed Objects NSPortTimeoutException

2008-03-17 Thread Tony Parker
Hello, If you just cut paste the code from 'main' in the chatterd server, I would double-check that your connection and root object are being retained properly in your AppController. For example, make sure 'monitor', 'connection', 'chatterServer', and 'receivePort' are not autoreleased

Re: In receiver application, getting file passed in from NSWorkspace openFile:withApplication:

2008-03-17 Thread Jens Alfke
On 17 Mar '08, at 10:06 AM, Robert Tillyard wrote: If you're looking fot the equivalent of argc/argv you might be looking for... NSProcessInfo *procInfo = [NSProcessInfo processInfo]; NSArray *args = [procInfo arguments]; But documents to be opened are never passed through argv; they're

NSPanel mimic menu behavior

2008-03-17 Thread cai qin
Hi All, I'm using a NSPanel to mimic menu in Tiger these days. I think most of the job has been done except one small problem. What I want to do is that implementing something just behaves like a popUpButton. OK let's get into the point. I got a popUpButton, and I override its cell

Re: strange lockFocus sent to a view whose window is deferred error with an NSOutlineView on Tiger

2008-03-17 Thread Martin Redington
On 17 Mar 2008, at 17:07, Michael Nickerson wrote: On Mar 17, 2008, at 9:06 AM, Martin Redington wrote: I'm seeing the following error 2008-03-17 12:42:11.916 MyApp[11155] *** Assertion failure in - [MyOutlineView lockFocus], AppKit.subproj/NSView.m:3248 2008-03-17 12:42:11.917

Apple Events and automatic AutoReleasePool managment

2008-03-17 Thread Andy Klepack
The Memory Management Programming Guide (http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/Concepts/AutoreleasePools.html#//apple_ref/doc/uid/2047) states The Application Kit automatically creates a pool at the beginning of an event cycle (or event-loop iteration), such

Re: Best Way To Lookup From a Huge Table

2008-03-17 Thread James Hober
To me, best large table lookup comes down to a tradeoff: 1) If I can load all the data into memory, using say a hash table, then the initial load time will be somewhat significant but the lookups will be near instantaneous. 2) If I can look up the data from an ordered persistent store, the

Re: Python/Ruby for Cocoa (was: Simple question)

2008-03-17 Thread Paul Sargent
On 17 Mar 2008, at 17:46, Hamish Allan wrote: If you're cutting your programming teeth on Cocoa, you might find that Python or Ruby is gentler. I'm not sure I agree. Two problems for me. * Cocoa isn't a seamless fit with either python or ruby, so there are little corner cases around that

Re: In receiver application, getting file passed in from NSWorkspace openFile:withApplication:

2008-03-17 Thread Ryan Chapman
Is there any way to get this information from within a command-line utility? In my case, I have a command-line utility wrapped up in an application bundle, so I really don't need any GUI stuff, but I thought I could use the Cocoa classes to get the filename sent without launching a GUI.

Re: strange lockFocus sent to a view whose window is deferred error with an NSOutlineView on Tiger

2008-03-17 Thread Martin Redington
I overrode lockFocus, and stuck a breakpoint on it. #0 0x004f87ea in -[MyOutlineView lockFocus] at MyOutlineView.m:75 #1 0x93310315 in -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] #2 0x9332238f in _recursiveDisplayInRect2 #3 0x9083eac0 in CFArrayApplyFunction #4

Re: Prevent application activation after dragging items to the Dock icon?

2008-03-17 Thread Jens Alfke
On 17 Mar '08, at 10:42 AM, Jean-Daniel Dupas wrote: Why no? The documentation says: «These events are sent whenever the Finder reactivates an already running application because someone double-clicked it again or used the dock to activate it.» That means clicked on its icon in the

Re: Python/Ruby for Cocoa (was: Simple question)

2008-03-17 Thread Sherm Pendley
On Mon, Mar 17, 2008 at 2:39 PM, Paul Sargent [EMAIL PROTECTED] wrote: On 17 Mar 2008, at 17:46, Hamish Allan wrote: If you're cutting your programming teeth on Cocoa, you might find that Python or Ruby is gentler. I'm not sure I agree. Two problems for me. * Cocoa isn't a seamless fit

Re: Apple Events and automatic AutoReleasePool managment

2008-03-17 Thread Jens Alfke
On 17 Mar '08, at 11:38 AM, Andy Klepack wrote: Does an 'event cycle' then include anything dispatched from a run loop source? For instance, if I was to create a kqueue, create a run loop source for it, and add that to the main run loop, does an AutoReleasePool automatically get created

Re: In receiver application, getting file passed in from NSWorkspace openFile:withApplication:

2008-03-17 Thread Jens Alfke
On 17 Mar '08, at 12:00 PM, Ryan Chapman wrote: Is there any way to get this information from within a command-line utility? In my case, I have a command-line utility wrapped up in an application bundle, so I really don't need any GUI stuff, but I thought I could use the Cocoa classes to

CoreData: Incompatible model configuration problem...

2008-03-17 Thread Martin Linklater
Hi. My Core Data Application is producing 'Incompatible model configuration' errors which don't make sense to me Anyone got any ideas ...? My Application contains 4 data models - OptDataDump, Market, Local and EVEAPI. Each of the entities in the data models are set to have the

Re: strange lockFocus sent to a view whose window is deferred error with an NSOutlineView on Tiger: SOLVED

2008-03-17 Thread Martin Redington
I overrode -[NSTableView setFrameSize:] in my outline view class, so that it only calls super if the size has really changed. This seems to fix the issue - setFrameSize: gets called a few times as I add the view - the first few times the values haven't changed. By the time they do

Equivalent to Carbon's TransitionWindow(); using genie when opening an NSWindow

2008-03-17 Thread Sean McBride
Hi all, I'd like to use the genie effect (or similar) when opening and closing an NSWindow. Carbon has an API named TransitionWindow() for this task, but it's 32-bit only. I've searched the archives and it seems there is no Cocoa equivalent? Is this still so, even in 10.5? Could Core

Re: NSButtonCell doesn't visually update during trackMouse:inRect:ofView:untilMouseUp:

2008-03-17 Thread Ken Ferry
On Mon, Mar 17, 2008 at 8:49 AM, glenn andreas [EMAIL PROTECTED] wrote: On Mar 17, 2008, at 1:42 AM, Ben Lachman wrote: I have a few NSButtonCells that I'm using in a custom view. I need them to track the mouse during clicks and do this by calling NSCell's

Re: make a window not draggable in spaces

2008-03-17 Thread Michael Watson
Why do you want to do this? I would be pretty annoyed if I couldn't drag a window from space to space if it appeared in my zoomed-out spaces. -- m-s On 17 Mar, 2008, at 06:28, Cocoa Developer wrote: Hi, How to make a window not draggable in spaces. I used to set NSBorderlessWindowMask

NSView enterFullScreenMode:withOptions: woes; window levels

2008-03-17 Thread Sean McBride
Hi all, Is anyone using the new NSView full screen methods in 10.5? I have a window which contains a 'group view', it is basically an NSView that contains two subviews: a button, and an custom NSView that draws pretty pictures. The button displays a floating palette (NSPanel). My ultimate goal

Re: Creating Custom Views in Interface Builder

2008-03-17 Thread Sean McBride
On 3/15/08 12:48 PM, Rob Keniger said: There's a trap for young players in the docs: watch out if you are creating a GC-only app. Classes instantiated via IB3 plugins MUST be compliant with the traditional retain/release mechanism, you can't create a plugin for a class that relies on Garbage

NSDate from xsd:dateTime / ISO 8601

2008-03-17 Thread Nathan Vander Wilt
I'm trying to convert a date formatted as a valid xsd:dateTime format, which is a subset of ISO 8601. I though I had it when I saw that that -[NSDate dateWithString:] takes an international string representation format. But when I feed it a string like @2007-07-01T01:33:01Z, I get back nil. Does

Re: Apple Events and automatic AutoReleasePool managment

2008-03-17 Thread Jens Alfke
On 17 Mar '08, at 2:25 PM, Andy Klepack wrote: In the case of C callbacks wouldn't it be the case that an autorelease pool would exist (that of the main thread) but that it would not be emptied once the callback completes? You wouldn't see any warnings if that were the case. You're

Re: NSDate from xsd:dateTime / ISO 8601

2008-03-17 Thread Jens Alfke
On 17 Mar '08, at 3:20 PM, Nathan Vander Wilt wrote: Does -dateWithString: really not support the international [standard!] string representation of ISO 8601?? What's the right way to convert such an xsd:dateTime to an NSDate? +[NSDate dateWithString:] is, I think, configured to recognize

How to track all keyboard event?

2008-03-17 Thread frank.gongpengjun
Hi, I am porting a game onto Mac OS X, I need to track all keyboard event even it is not for me. How can I achieve that goal? Regards Frank Gong (Pengjun Gong) ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin

Re: reading data from a UDP port - questions

2008-03-17 Thread Benjamin Stiglitz
(2) But in any case, NSString doesn't mind embedded null bytes. (It's not null-terminated like a C string; the string object remembers the length separately.) That doesn't mean you should store binary data in an NSString, though. NSData is better for that. NSString isn’t really too happy

Re: Prevent application activation after dragging items to the Dock icon?

2008-03-17 Thread Ken Thomases
On Mar 17, 2008, at 2:36 AM, Peter Maurer wrote: Cocoa applications tend to come to the foreground automatically whenever I drag files to their Dock icon. Sometimes, however, I'd prefer my application to stay in the background and just start working on the file, while giving feedback

Re: Apple Events and automatic AutoReleasePool managment

2008-03-17 Thread Ken Thomases
On Mar 17, 2008, at 4:25 PM, Andy Klepack wrote: I'm seeing this problem in some AE handlers installed via AEInstallEventHandler. There are no warnings about a pool not existing, but the app memory usage grows and grows. Wrapping the handler in a pool creation and release appears to solve

Re: NSDate from xsd:dateTime / ISO 8601

2008-03-17 Thread Nathan Vander Wilt
Does -dateWithString: really not support the international [standard!] string representation of ISO 8601?? What's the right way to convert such an xsd:dateTime to an NSDate? +[NSDate dateWithString:] is, I think, configured to recognize one particular date format, which depends on your system

Re: How to track all keyboard event?

2008-03-17 Thread Ken Thomases
On Mar 17, 2008, at 6:05 PM, frank.gongpengjun wrote: I am porting a game onto Mac OS X, I need to track all keyboard event even it is not for me. How can I achieve that goal? I'm not sure what you mean by it is not for me. If you need to see all keyboard events sent to your application,

Re: NSDate from xsd:dateTime / ISO 8601

2008-03-17 Thread Jens Alfke
On 17 Mar '08, at 4:30 PM, Nathan Vander Wilt wrote: This works, BUT...I had to edit the format a bit because my time strings (in this sample!) did not have the decimal seconds. However, I wouldn't be surprised to see input with sub-second precision. How can I specify optional format

interface builder 3 question

2008-03-17 Thread Jeff LaMarche
So, as I said in an earlier post, I'm getting back into Cocoa development after a little hiatus. I was working in IB today. Boy, it's changed, and for the better, but I can't figure out how to do something I used to do in Interface Builder. I want to create an instance of a custom NSObject

Confused about CFRunLoop

2008-03-17 Thread Brian Greenstone
I'm trying to convert some old Carbon code over to Cocoa, and one of the things I'm doing is converting my old run-loop timers. I used to use the following code: InstallEventLoopTimer(..); RunApplicationEventLoop(); .. QuitApplicationEventLoop(); That

Re: interface builder 3 question

2008-03-17 Thread Kyle Sluder
On Mon, Mar 17, 2008 at 10:45 PM, Jeff LaMarche [EMAIL PROTECTED] wrote: So, as I said in an earlier post, I'm getting back into Cocoa development after a little hiatus. I was working in IB today. Boy, it's changed, and for the better, but I can't figure out how to do something I used to do

Re: Confused about CFRunLoop

2008-03-17 Thread Kyle Sluder
On Mon, Mar 17, 2008 at 10:53 PM, Brian Greenstone [EMAIL PROTECTED] wrote: I'm trying to convert some old Carbon code over to Cocoa, and one of the things I'm doing is converting my old run-loop timers. I used to use the following code: Are you sure you want to be creating your own run

Re: interface builder 3 question

2008-03-17 Thread Jeff LaMarche
On Mar 17, 2008, at 10:55 PM, Kyle Sluder wrote: I assume you mean you want to specify the class of the instance, because specifying the NSObject's superclass is a nonsensical statement. The field you're looking for is on the Identity pane of the Inspector LOL. Sorry, I shouldn't try and do

Re: NSButtonCell doesn't visually update during trackMouse:inRect:ofView:untilMouseUp:

2008-03-17 Thread Ben Lachman
So my view is a NSControl subclass and after playing with this some it seems you have to do one more thing. If you're going to have a control handle multiple cells (in my case button cells) you have to call setCell: for the correct cell in mouseDown: and then let super handle the mouse

Re: Modifying glyph storage in NSLayoutManager

2008-03-17 Thread Martin Wierschin
I have some text items whose glyphs cannot be determined until layout. The text string might contain a marker to draw the current page number, or to sequentially number paragraphs, etc. The glyphs can be determined only by the layout manager; different layout managers for the same text

Re: Confused about CFRunLoop

2008-03-17 Thread Kyle Sluder
On Mon, Mar 17, 2008 at 11:26 PM, Brian Greenstone [EMAIL PROTECTED] wrote: I was using NSTimer originally, but I was having the exact same problem since NSTimer is really just a CFRunLoopTimerRef according to the docs. As far as I can tell, using NS calls to do this is just a more

Re: interface builder 3 question

2008-03-17 Thread Kyle Sluder
On Mon, Mar 17, 2008 at 11:01 PM, Jeff LaMarche [EMAIL PROTECTED] wrote: LOL. Sorry, I shouldn't try and do this stuff so late at night! I meant specifying the new class' superclass. Oh. You don't. IB3 is a different beast. Instead, you write your code in Xcode and then switch to IB and

Re: Confused about CFRunLoop

2008-03-17 Thread Rob Keniger
On 18/03/2008, at 1:26 PM, Brian Greenstone wrote: I was using NSTimer originally, but I was having the exact same problem since NSTimer is really just a CFRunLoopTimerRef according to the docs. As far as I can tell, using NS calls to do this is just a more complicated way than simply

Re: NSView enterFullScreenMode:withOptions: woes; window levels

2008-03-17 Thread Brian Christensen
On Mar 17, 2008, at 4:51 , Sean McBride wrote: Hi all, Is anyone using the new NSView full screen methods in 10.5? I have a window which contains a 'group view', it is basically an NSView that contains two subviews: a button, and an custom NSView that draws pretty pictures. The button

Re: Confused about CFRunLoop

2008-03-17 Thread Rob Keniger
On 18/03/2008, at 2:04 PM, Rob Keniger wrote: Works great and it sounds like it will do what you want. The trick is to set the run loop mode correctly, you can probably do something equivalent with the CF calls if you like. I like my Obj-C gibberish so I avoid CF if possible ;-) I

Re: Confused about CFRunLoop

2008-03-17 Thread Kyle Sluder
On Tue, Mar 18, 2008 at 12:01 AM, Brian Greenstone [EMAIL PROTECTED] wrote: Cocoa is really only necessary for GUI based apps We seem to have not made any progress. Until you change that misconception, this is going to be rather difficult. Back when this OS was known as NEXTSTEP and Core

Re: Confused about CFRunLoop

2008-03-17 Thread Eric Schlegel
On Mar 17, 2008, at 7:53 PM, Brian Greenstone wrote: [[NSApplication sharedApplication] run]; That actually works! My timer fires off like it should, yet everything else works too. I can still access the menus, and window still receive click events. Unfortunately, there's no