Re: Read PSD-Layers with NSImage

2008-06-16 Thread Marco Masser
[...] any methods which read PSD-Layers. OS X reads psd's natively, so i'm curious where that functions/methods are. [...] I dropped Boris a mail about that directly, but for completeness' sake: QuickTime seems to be the way to go: GraphicsImportSetImageIndex(). A quick Google code search

Re: Interface Builder popularity w/ Cocoa Developers

2008-06-16 Thread Conor
Nobody seemed to mention it, but IB also makes localization easier. As for debugging awakeFromNib: is not the right place as the NIB has already been loaded and the connections done, which the original poster is worried about; – loadNib:withZone: is the right place. The worry about missing

Re: XML-RPC call using Cocoa Frameworks

2008-06-16 Thread Torsten Curdt
I am using a slightly improved version of Eric Czarny's XMLRPC framework http://divisiblebyzero.com/ Reporting the changes back is still on my TODO. But I found it really easy to use. Why do you explicitly are after synchronous? cheers -- Torsten ___

Printing thearguments of obj-c function in DTrace/Instruments (was NSNotifications & background apps?)

2008-06-16 Thread dreamcat7
Hi, I often see in instruments many recurring obj-c method calls. But never able to peek at the data passed into them. Wouldn't it be nice to see the arguments printed out for the obj-c method calls ? I was wondering if we can adapt the following method. This example first is for logging

Strange leak reported by leaks command line tool

2008-06-16 Thread Aarno Syvänen
Hi, here is the code (omitting error checks): - (int)udpRecvfrom:(int)s datagram:(NSString **)datagram addr:(NSData **)addr { ... bytes = recvfrom(s, buf, UDP_PACKET_MAX_SIZE, 0, (struct sockaddr *) &sa, &salen); ... addr_s = malloc(salen + 1); memcpy(addr_s, (char *) &

Re: Strange leak reported by leaks command line tool

2008-06-16 Thread Igor Mozolevsky
2008/6/16 Aarno Syvänen <[EMAIL PROTECTED]>: >addr_s = malloc(salen + 1); are you free()ing this anywhere? cheers, Igor ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Co

Passing CGImageSourceRef to IKImageView

2008-06-16 Thread Jonathan Dann
Hi Guys, I was just looking at passing a CGImageSourceRef to an IKImageView, the documentation says you can, but there's not method that accepts it as a parameter. Is this just a feature that isn't present in the release? Are there release notes that this would be in as Image Kit isn't

Requesting Administrator Name and Password

2008-06-16 Thread Glover,David
Hi all, I've created a little app that removes some files from within /Applications. This works fine when logged in as an Administrator, but won't run when logged in as a standard user. I've been spending some time looking into requesting an Adminstrator name and password (hoping that it w

Re: Requesting Administrator Name and Password

2008-06-16 Thread Jonathan del Strother
On Mon, Jun 16, 2008 at 11:35 AM, Glover,David <[EMAIL PROTECTED]> wrote: > Hi all, > > > > I've created a little app that removes some files from within > /Applications. This works fine when logged in as an Administrator, but > won't run when logged in as a standard user. > > > > I've been spendi

Re: argument checks

2008-06-16 Thread Alastair Houghton
On 12 Jun 2008, at 13:01, Graham Cox wrote: On 12 Jun 2008, at 5:47 pm, Chris Suter wrote: Can you give me a counter-example? Let’s say the function your calling uses one of the following: -[NSDictionary setObject:forKey:] -[NSMutableArray addObject:] Raising an exception is a good respon

Re: argument checks

2008-06-16 Thread Alastair Houghton
On 12 Jun 2008, at 15:02, Hamish Allan wrote: On Thu, Jun 12, 2008 at 6:50 AM, Ashley Perrien <[EMAIL PROTECTED]> wrote: NSNumber *myNum; // Lots of code where I've forgotten to actually do anything with myNum results = [myClass someCalculationUsing: myNum]; I'd recommend not declarin

launching finder with optionschi

2008-06-16 Thread Memo Akten
Hi all, i'm not sure if this is relevant to this list but not sure where else to post it. >From my cocoa app (a QC PlugIn), I'm launching apps with the command: [[NSWorkspace sharedWorkspace] launchApplication:currentAppToLaunch]; which is working fine, but I'd like to launch one of the apps

Re: XML-RPC call using Cocoa Frameworks

2008-06-16 Thread Kevin McQuown
I will definitely check out this framework today. Thanks to you and Rick for the suggestions. The interest in a "synchronous" call is more an artifact of getting something working and keeping it simple so that I am testing the actual call and dealing with the return response without adding the co

Re: NSOutlineView threading problem

2008-06-16 Thread David
On Sun, Jun 15, 2008 at 12:03 AM, Jens Alfke <[EMAIL PROTECTED]> wrote > > I don't think that's safe. I have seen no assurances that NSOutlineView is > thread-safe, and in general most AppKit control classes should _not_ be > accessed from background threads. > While I've been investigating this,

"Require password to wake this computer from sleep or screen saver"

2008-06-16 Thread Толя Макаров
HI!!! How programmatically to check the "Require password to wake this computer from sleep or screen saver"? Macarov Anatolii. Вы уже с Yahoo!? Испытайте обновленную и улучшенную. Yahoo! Почту! http://ru.mail.yahoo.com __

Re: NSOutlineView threading problem

2008-06-16 Thread David
On Mon, Jun 16, 2008 at 1:25 AM, Michael Ash <[EMAIL PROTECTED]> wrote: > > I'm not sure how having thread safe arrays would help. If you're > mutating a collection in one thread while you're accessing it from > another then you will have trouble no matter what happens. > > Take this example. The o

Re: NSOutlineView threading problem

2008-06-16 Thread j o a r
On Jun 16, 2008, at 7:44 AM, David wrote: While I've been investigating this, I have found more documentation on thread safety issues in the "Threading Programming Guide". I'd read it before but it helps to re-read. It says that NSView classes ARE thread safe... to an extent. Very interestin

Re: XML-RPC call using Cocoa Frameworks

2008-06-16 Thread Torsten Curdt
The interest in a "synchronous" call is more an artifact of getting something working and keeping it simple so that I am testing the actual call and dealing with the return response without adding the complexity of asynchronous call backs and multiple threads. Asynchronous does not mean mul

Re: NSOutlineView threading problem

2008-06-16 Thread Jens Alfke
On 15 Jun '08, at 8:05 PM, David wrote: Threading is hard for me to comprehend in the objective-c world. In Java, threading is powerful and relatively simple to implement with simple relatively consistent rules and many classes which are thread safe. I used to be the tech lead for Java tool

awakeFromNib

2008-06-16 Thread David Harper
Hello, I am setting up a preferences window, and I would like awakeFromNib: to be invoked earlier than it does. Currently, it only gets invoked when the preferences window is shown / opened. I expected that there might be an option to specify this in the .nib file itself, and I got my hopes u

Re: launching finder with optionschi

2008-06-16 Thread Jens Alfke
On 16 Jun '08, at 6:09 AM, Memo Akten wrote: I'd like to launch one of the apps - Finder - in a specific folder in Cover Flow (app is leopard only). I've been searching how to do this but cannot find any info. You can tell an app to open a specific file (which in the case of Finder can incl

QTMovieLayer never being released?

2008-06-16 Thread Freddie Tilley
I have a simple playlist playing qt movies in coreanimation, playing quicktime movies using the QTMovieLayer class. After I swap the qtmovielayer with another, the replaced layer never gets released. Garbage collection is off, and I'm working with quicktime 7.5 and osx 10.5.3 Every qt mov

Re: awakeFromNib

2008-06-16 Thread Jens Alfke
On 16 Jun '08, at 8:07 AM, David Harper wrote: I am setting up a preferences window, and I would like awakeFromNib: to be invoked earlier than it does. Currently, it only gets invoked when the preferences window is shown / opened. Well, -awakeFromNib won't be called until the nib is loade

Re: Strange leak reported by leaks command line tool

2008-06-16 Thread Jens Alfke
There's nothing inherently strange about this leak. Just because an object was created down inside the Cocoa frameworks doesn't mean that they're responsible for it being leaked. Anything that retains the object might be responsible, if it forgets to release it. You have to consider all the

Re: Passing CGImageSourceRef to IKImageView

2008-06-16 Thread douglas a. welton
Jonathan, I don't think you missed anything. I do believe that documentation is somewhat misleading for this class. I was in the same situation as you, so I simply decided to get a CGImageRef (with the associated CGImageProperties) from my CGImageSourceRef object and use the -(void)setIm

awakeFromNib

2008-06-16 Thread David Harper
Hello, After some exploration into NSWindowController methods, I found that invoking [... window] after initWithWindowNibName had the desired result. +(PreferencesController *) sharedPreferencesController { if (!sharedPreferencesController) { sharedPreferencesController = [[self allo

Re: awakeFromNib

2008-06-16 Thread j o a r
On Jun 16, 2008, at 8:07 AM, David Harper wrote: I am setting up a preferences window, and I would like awakeFromNib: to be invoked earlier than it does. Currently, it only gets invoked when the preferences window is shown / opened. You can call: -[NSWindowController loadWindow

Re: NSButton checkbox reports reverse state

2008-06-16 Thread Jens Alfke
On 15 Jun '08, at 10:50 PM, mirage_3d wrote: when i check the buttons' states in my action however, the buttons report the inverse state to what they really should. i used NSOffButton and NSOnButton constants to set and check, and the values are correct. but when i check the buttons' states

Re: awakeFromNib

2008-06-16 Thread Jens Alfke
On 16 Jun '08, at 8:27 AM, David Harper wrote: After some exploration into NSWindowController methods, I found that invoking [... window] after initWithWindowNibName had the desired result. Oh, I see what you mean now. Yes, NSWindowController loads the nib lazily. -initWithWindowNibName:

Re: NSOutlineView threading problem

2008-06-16 Thread Adam R. Maxwell
On Jun 16, 2008, at 11:17 AM, j o a r wrote: On Jun 16, 2008, at 7:44 AM, David wrote: While I've been investigating this, I have found more documentation on thread safety issues in the "Threading Programming Guide". I'd read it before but it helps to re-read. It says that NSView classes

Re: How to create Custom Knobs with Sprite animation ?

2008-06-16 Thread Jens Alfke
My Question was : How to achieve that via Cocoa . Rather in Code i just need a Guidline or a Plan what i should look for , where to start , general things , what Concepts i should look for. Read the conceptual documentation on event handling, specifically on how to handle mouse events in

Re: launching finder with optionschi

2008-06-16 Thread Memo Akten
Hi thanks, I ended up creating an AppleScript like you mention (below) and then just creating an app out of it, and launching that app instead of finder... works quite well... cheers, Memo. tell application "Finder" activate if not (exists Finder window 1) then

Re: NSOutlineView threading problem

2008-06-16 Thread j o a r
On Jun 16, 2008, at 9:05 AM, Adam R. Maxwell wrote: This level of vagueness is persistent throughout the framework docs, though, and gives them an absolute value |v| < 0 with respect to threading (my opinion, of course). And yes, I know the "file a bug report" mantra, but a) I don't get p

Re: launching finder with optionschi

2008-06-16 Thread Kyle Sluder
On Mon, Jun 16, 2008 at 12:36 PM, Memo Akten <[EMAIL PROTECTED]> wrote: > I ended up creating an AppleScript like you mention (below) and then just > creating an app out of it, and launching that app instead of finder... > works quite well... It may work, but it is unnecessarily complicated. Sinc

Re: Prevent Asynchronous operation of beginSheetModalForWindow

2008-06-16 Thread John Love
Hello, Graham ... Because I have multiple calls to show a sheet, from various parts of my FileController, and because I wanted to make my sheet calls as general as possible, I really .. really .. wanted to have a distinct SheetController. As a result, I made calls from FileController to look like:

Re: launching finder with optionschi

2008-06-16 Thread Jens Alfke
On 16 Jun '08, at 9:36 AM, Memo Akten wrote: I ended up creating an AppleScript like you mention (below) and then just creating an app out of it, and launching that app instead of finder... works quite well... It'd be faster and more lightweight to add the compiled script to your app as a

Re: How can an object know when another object has gone away?

2008-06-16 Thread Jens Alfke
On 15 Jun '08, at 5:39 PM, James W. Walker wrote: No, the controller does not keep a reference to the task. Why would it need to do that in order to "keep it alive"? Because objects only exist if they have references (i.e. a refcount > 0), and it generally makes your code cleaner if those

Re: looking for a crc code

2008-06-16 Thread Jens Alfke
On 15 Jun '08, at 2:09 PM, Ilan Volow wrote: Python's zlib module has crc32 Thanks, but we've already had at least a dozen redundant answers to this question. How many references to CRC32 implementations and zlib do we need? In any case I'm pretty sure the OP was looking for native code

FULLTIME Santa Monica COCOA gig.....

2008-06-16 Thread Kristan Kennedy
PLEASE SEND REFERRALS AND RESUMES TO [EMAIL PROTECTED] Am generously paying for referrals as well Mac Developers, our time has come! With the ascent of Apple, the long years of standing in the shadows of web and PC programmers, and surviving on shareware is coming to an end. If your re

Re: Strange leak reported by leaks command line tool

2008-06-16 Thread Hamish Allan
On Mon, Jun 16, 2008 at 4:51 PM, Jens Alfke <[EMAIL PROTECTED]> wrote: > or your code is running on a background thread that doesn't have an > autorelease pool. Or it has an autorelease pool, but never drains it. Maybe the OP is running a select() loop with an autorelease pool around it rather t

Re: launching finder with optionschi

2008-06-16 Thread Memo Akten
"t may work, but it is unnecessarily complicated. Since AppleScript is just a user-friendly representation of Apple Events, you can use either raw Apple Events (AEDesc and friends) or the Scripting Bridge (Leopard only) to do the exact same thing without the overhead of launching another applicat

Re: How does an instance variable in the ObjC code get connected to an interface element in the NIB file? BACK ON TRACK

2008-06-16 Thread Paul Archibald
Okay, I see them now. I was missing them in the rather long list of outlets (over 130!) for the main controller. I wanted to understand this better because I want to re-factor the code so that there are NOT 135 outlets for one controller. Currently we have two windows that handle different

Agent tutorial help needed.

2008-06-16 Thread christian giacomi
Hi all,I am new to Cocoa and Objective-C so I hope you will forgive my question if it sounds stupid. I am looking for some tutorials or demos on Cocoa Agents. I do not have to write a daemon, and I have found a few articles discussing the differences between daemons and agents on a Mac, but no rea

Re: Agent tutorial help needed.

2008-06-16 Thread Jason Coco
Have you read this Technical Article yet? http://developer.apple.com/technotes/tn2005/tn2083.html It's very good and has some code examples as well as many references to other material... On Jun 16, 2008, at 15:40 , christian giacomi wrote: Hi all,I am new to Cocoa and Objective-C so I hop

Re: How can an object know when another object has gone away?

2008-06-16 Thread Hamish Allan
On Mon, Jun 16, 2008 at 1:39 AM, James W. Walker <[EMAIL PROTECTED]> wrote: > No, the controller does not keep a reference to the task. Why would it need > to do that in order to "keep it alive"? Because that's how memory management works. *Something* needs to keep a reference to your NSTask, ot

Re: CoreAnimation removeFromSuperlayer flicker

2008-06-16 Thread Brian Christensen
On Jun 14, 2008, at 2:29 , Milen Dzhumerov wrote: I've got a root layer which has got a solid background and I've got one sublayer. If I call removeFromSuperlayer on the sublayer when the root layer is small in size, it removes itself with animation and there are no problems. But if I incre

Re: launching finder with optionschi

2008-06-16 Thread Kyle Sluder
On Mon, Jun 16, 2008 at 3:20 PM, Memo Akten <[EMAIL PROTECTED]> wrote: > Thanks guys, yea there is a momentary bounce in the dock. I did it this way > because my app loads an XML and there are a number of apps that it can > launch depending on what you choose and the app name in the XML. I just > w

Re: How can an object know when another object has gone away?

2008-06-16 Thread Christopher Nebel
On Jun 15, 2008, at 3:53 PM, James W. Walker wrote: On Jun 15, 2008, at 3:25 PM, Andreas Monitzer wrote: On Jun 16, 2008, at 00:20, James W. Walker wrote: Is there a standard Cocoa design pattern or idiom to have an object find out when another object has been destroyed? In PowerPlant, I

Re: How can an object know when another object has gone away?

2008-06-16 Thread James Walker
Hamish Allan wrote: On Mon, Jun 16, 2008 at 1:39 AM, James W. Walker <[EMAIL PROTECTED]> wrote: No, the controller does not keep a reference to the task. Why would it need to do that in order to "keep it alive"? Because that's how memory management works. *Something* needs to keep a referenc

[MODERATOR] Re: FULLTIME Santa Monica COCOA gig.....

2008-06-16 Thread Scott Anguish
Job postings should not be made directly to the group without first having them approved by the moderators. send them to [EMAIL PROTECTED] As well, positions advertising for iPhone developers are not appropriate for this list. ___ Cocoa-dev mailin

Cocoa, C++, Keyboard input and Timers

2008-06-16 Thread Josh de Lioncourt
Hello, An explanation of what I'm working on in brief, to avoid questions as to why things are being done the way they are. My company www.DraconisEntertainment.com develops audio-only computer games for the blind and visually impaired. Most of the games on our roster at present are game

Re: Cocoa, C++, Keyboard input and Timers

2008-06-16 Thread Brian Christensen
On Jun 16, 2008, at 5:47 , Josh de Lioncourt wrote: Next, I need to be able to keep track of real-time during the game. In Windows, we'd use something like GetTickCount to accomplish this. Is there an equivalent on the Mac side? Again, pointing me in the right direction would be tremendo

Re: Cocoa, C++, Keyboard input and Timers

2008-06-16 Thread Andreas Monitzer
On Jun 16, 2008, at 23:47, Josh de Lioncourt wrote: To that end, we're redeveloping many old titles, primarily in C++ for the bulk of the coding to make porting between Mac and Windows simpler. The games have no graphical interface to speak of, only an audio one. First off, Cocoa program

Re: Cocoa, C++, Keyboard input and Timers

2008-06-16 Thread Brian Christensen
On Jun 16, 2008, at 6:43 , Brian Christensen wrote: (I do not know what the difference is, if any, between using mach_absolute_time() and UpTime().) Apparently, the answer is that there isn't really a difference: .

Re: NSOutlineView threading problem

2008-06-16 Thread Adam R. Maxwell
On Jun 16, 2008, at 12:47 PM, j o a r wrote: On Jun 16, 2008, at 9:05 AM, Adam R. Maxwell wrote: This level of vagueness is persistent throughout the framework docs, though, and gives them an absolute value |v| < 0 with respect to threading (my opinion, of course). And yes, I know the "fi

Re: NSOutlineView threading problem

2008-06-16 Thread j o a r
On Jun 16, 2008, at 3:59 PM, Adam R. Maxwell wrote: The confusion between "thread safe" and "main thread only" on this list hasn't helped, either... From a documentation perspective there is no single or simple definition of "thread safe", it all depends on the context. Some objects are

Newbie interface questions - multiple "modal" windows

2008-06-16 Thread Matthew Youney
I am creating an application that requires multiple “modal” windows. There is a “main” window, and there are multiple other windows that can be displayed from the main window (using a toolbar, buttons, etc.). These “other” windows need to be modal, that is these windows must receive all user inpu

NSSound thread-safety?

2008-06-16 Thread Jens Alfke
Speaking of AppKit on background threads … I've been using a background thread to load and play NSSounds, because the +soundNamed: and -play methods often block for significant amounts of time (half a second or more), which was stalling other time-critical actions. This has mostly been work

Re: NSSound thread-safety?

2008-06-16 Thread j o a r
On Jun 16, 2008, at 5:07 PM, Jens Alfke wrote: Is NSSound thread-safe? Now that I look, I can't find any documentation; the Cocoa thread safety docs don't refer to NSSound at all. That would indicate that it isn't thread safe. I think that you can use QTKit to load and play sound files

Re: NSSound thread-safety?

2008-06-16 Thread Brett Powley
As far as I'm aware, "not thread safe" means "it's not safe to do this on multiple threads", not "it's not safe to do this on a background thread". Is there any chance you're trying to play more than one sound at the same time? You don't seem to have any locking there to ensure this. And

Re: NSSound thread-safety?

2008-06-16 Thread Jens Alfke
On 16 Jun '08, at 5:15 PM, j o a r wrote: I think that you can use QTKit to load and play sound files asynchronously. QuickTime is pretty non-thread-safe too. NSSound already plays the sound asynchronously. It's apparently loading the sound that blocks for a long time (although it's lazy

Re: Cocoa, C++, Keyboard input and Timers

2008-06-16 Thread Josh de Lioncourt
On Jun 16, 2008, at 3:45 PM, Andreas Monitzer wrote: First off, Cocoa programs have to be written in Objective C. However, when using the file extension .mm instead of .m, you can mix Objective C and C++ in the same file (you can't subclass across programming languages, though). Yes, this

Re: Newbie interface questions - multiple "modal" windows

2008-06-16 Thread Jens Alfke
On 16 Jun '08, at 4:38 PM, Matthew Youney wrote: I am creating an application that requires multiple “modal” windows. There is a “main” window, and there are multiple other windows that can be displayed from the main window (using a toolbar, buttons, etc.). These “other” windows need to b

Re: NSSound thread-safety?

2008-06-16 Thread Ricky Sharp
On Jun 16, 2008, at 7:07 PM, Jens Alfke wrote: This has mostly been working fine, but now I'm occasionally getting crashes. Is NSSound thread-safe? Now that I look, I can't find any documentation; the Cocoa thread safety docs don't refer to NSSound at all. It's been the practice such th

Re: NSSound thread-safety?

2008-06-16 Thread Adam R. Maxwell
On Jun 16, 2008, at 8:28 PM, Jens Alfke wrote: On 16 Jun '08, at 5:15 PM, j o a r wrote: I think that you can use QTKit to load and play sound files asynchronously. QuickTime is pretty non-thread-safe too. And there we're using the definition as "non-thread-safe"=="requires the main th

First Responder and taborder?

2008-06-16 Thread William Squires
Dumb question expecting a dumb answer here... 1) I know the First Responder sets which control in a window gets the focus, but what about if you app has multiple windows, each of which has several controls which could get the focus (when the window is frontmost)? How is this handled if there

nib and xib

2008-06-16 Thread William Squires
What's the difference? (assuming 'xib's aren't under NDA here...) ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Re: nib and xib

2008-06-16 Thread Kevin Grant
A xib is new in IB 3.0 and is "compiled" by Xcode into a 3.x NIB. (I don't think it's possible to create a 2.x NIB this way.) You don't have to use it unless you want to. The idea is to make the xib your "source", as it is friendlier to revision control (e.g. Subversion) than the binary blob tha

Re: NDA on Apple Sites, Was: Interface Builder popularity w/ Cocoa Developers

2008-06-16 Thread William Squires
So that other companies (like Microsoft) won't jump the gun and release their own iPhone SDK, then turn around and claim Apple infringed on 'their' copyright because they released first, I'm guessing... On Jun 16, 2008, at 12:20 PM, Alexander von Below wrote: (sorry, last email sent by mi

Custom field editor on NSSecureTextField?

2008-06-16 Thread John Stiles
I've got some code which subclasses NSTextView in order to provide a custom field editor for NSTextFields. It doesn't do anything too extraordinary, just allows for filtering out some characters, watching for certain events (like deleting characters or changing the selection), etc. It all works qui

(no subject)

2008-06-16 Thread Angelo Chen
Hi, I have following action, two NSButtons are linked to it, I'd like to test which button trigger the action in the code, any way to do this? thanks. - (IBAction)doCopying:(id)sender { // how to determine which NSButton is clicked? } Angelo Yahoo! Mail具備一流的網上安全保護功能,請前往 http://hk.an

Re: Custom field editor on NSSecureTextField?

2008-06-16 Thread Nick Zitzmann
On Jun 16, 2008, at 7:16 PM, John Stiles wrote: I've got some code which subclasses NSTextView in order to provide a custom field editor for NSTextFields. It doesn't do anything too extraordinary, just allows for filtering out some characters, watching for certain events (like deleting cha

Re: (no subject)

2008-06-16 Thread Nick Zitzmann
On Jun 16, 2008, at 7:27 PM, Angelo Chen wrote: I have following action, two NSButtons are linked to it, I'd like to test which button trigger the action in the code, any way to do this? thanks. - (IBAction)doCopying:(id)sender { // how to determine which NSButton is clicked? } if (s

Re: (no subject)

2008-06-16 Thread Jeff LaMarche
On Jun 16, 2008, at 9:27 PM, Angelo Chen wrote: - (IBAction)doCopying:(id)sender { // how to determine which NSButton is clicked? } There are several ways. If this button was called because a button was pushed, sender will contain a pointer to the button. You can compare the tag value

Re: (no subject)

2008-06-16 Thread Graham Cox
You can set a different tag value for each button (in IB), then in the action method use -[sender tag] to get the value. Tags are just an integer number that most controls support and their use is entirely decided by the programmer - Cocoa doesn't use them. Alternatively you can of course j

Re: Newbie interface questions - multiple "modal" windows

2008-06-16 Thread Graham Cox
On 17 Jun 2008, at 10:39 am, Jens Alfke wrote: I would think that this is a common application architecture (it is to me) You may be coming from another platform? I can't think of any Mac apps that do this, and frankly, I wouldn't want to use one that did. It does sort of sound like a w

Re: Custom field editor on NSSecureTextField?

2008-06-16 Thread John Stiles
I had previously done everything with a formatter and there were some limitations. I don't remember the exact details now, because it was several months ago. I do remember that it was a lot better overall when I just used my own field editor for everything. (If nothing else, it was simpler because

Re: Prevent Asynchronous operation of beginSheetModalForWindow

2008-06-16 Thread Graham Cox
Hi John, Did you even read my last email? I hope so because I really spent a long time writing it. It may not have been clear, but I did my best! A separate SheetController *is* the right way to do it, but the way you are partitioning the responsibilities between your various controllers

Re: (no subject)

2008-06-16 Thread Graham Cox
This assumes you do have an outlet to each of course - if the buttons otherwise don't need any programmatic access there's no reason to have an outlet, so it's overkill (in my view) to add outlets just to tell two buttons apart. Having separate action methods is usually the best approach.

Re: First Responder and taborder?

2008-06-16 Thread Ken Thomases
On Jun 16, 2008, at 7:52 PM, William Squires wrote: Dumb question expecting a dumb answer here... 1) I know the First Responder sets which control in a window gets the focus, but what about if you app has multiple windows, each of which has several controls which could get the focus (when th

Re: nib and xib

2008-06-16 Thread Omar Qazi
On Jun 16, 2008, at 5:54 PM, William Squires wrote: What's the difference? (assuming 'xib's aren't under NDA here...) A xib is an XML file that is ostensibly the same thing as a NIB file. It opens in interface builder and opens and edits just like a nib would. When you compile your projec

Making conceptual documentation

2008-06-16 Thread Nick Zitzmann
I've already tried searching Google and Cocoabuilder and found nothing relevant, at least on the OS X side of things. We all know about HeaderDoc, which is used to create HTML documentation for code taken from comments in the header files. I've used HeaderDoc before to make API documentatio

Re: Newbie interface questions - multiple "modal" windows

2008-06-16 Thread Omar Qazi
On Jun 16, 2008, at 4:38 PM, Matthew Youney wrote: 1. What is the best way to instantiate the “other” windows? In this application, all of the windows are quite unique, and there will never be more than one instance of each. Should this be done in the “main” controller by loading the N

opening default email and browser from the code

2008-06-16 Thread Angelo Chen
Hi, I got two questions: 1) I have an email address in the code, I'd like to open default mailing program from the code with the email address as the recipient. 2) I have a NSImageView, when mouse move over it, the cursor should be changed to a hand, and when it is clicked, it will open a URL

Re: Agent tutorial help needed.

2008-06-16 Thread Jens Alfke
On 16 Jun '08, at 12:40 PM, christian giacomi wrote: Hi all,I am new to Cocoa and Objective-C so I hope you will forgive my question if it sounds stupid. I am looking for some tutorials or demos on Cocoa Agents. No offense, but IMHO writing an agent is not a good newbie project ... you'll p

Re: opening default email and browser from the code

2008-06-16 Thread Stephen J. Butler
2008/6/16 Angelo Chen <[EMAIL PROTECTED]>: > Hi, > > I got two questions: > > 1) I have an email address in the code, I'd like to open default mailing > program from the code with the email address as the recipient. > > > 2) I have a NSImageView, when mouse move over it, the cursor should be > ch

Re: Strange leak reported by leaks command line tool

2008-06-16 Thread Jens Alfke
On 16 Jun '08, at 12:14 PM, Hamish Allan wrote: Or it has an autorelease pool, but never drains it. Maybe the OP is running a select() loop with an autorelease pool around it rather than within it? It wouldn't be reported as a leak then, because the autorelease pool, which is a per-thread g

NSXMLDocument and XSD substitutionGroup

2008-06-16 Thread Thomas Castiglione
Hi all, I've been trying to use NSXMLDocument to validate stuff with an XML Schema rather than a DTD, and have run into a problem. It doesn't seem to be correctly implementing the substitutionGroup 'polymorphism' aspect of XSD. The pattern goes like this: -- in schema

Re: Convert CGImageRef from BGR to RGB

2008-06-16 Thread Michael Vannorsdel
If you get your image data into a bitmap form you can use vImage's (Accelerate Framework) permute functions to quickly rearrange the channel ordering. There might be another way using color spaces, but none that I know off hand. On Jun 16, 2008, at 5:09 PM, Rodrigo Gutierrez wrote: I'm p

Re: How does an instance variable in the ObjC code get connected to an interface element in the NIB file? BACK ON TRACK

2008-06-16 Thread Erik Buck
Over 130 outlets! Holy Sassafras Tea! That is ten to fifteen times more outlets than I have ever seen in a single class in 20 years of Objective-C programming! I suspect you are doing something very wrong. First, use the Model-View-Controller pattern. Don’t store application state