Re: I don't understand why this is leaking...

2008-08-10 Thread Jean-Daniel Dupas
Le 10 août 08 à 00:48, Cate Tony a écrit : This code is leaking: - (void)saveItemExtensions:(id)sender { NSMutableString* itemExtensionsFilePath = [NSMutableString stringWithString:@"~/Library/Preferences/MyApp/extensions.abc"]; NSDictionary* extensions = [NSDictionary dictionaryWithDi

Re: CGImage masking via CGCreateImageWithMask getting odd results

2008-08-10 Thread Jean-Daniel Dupas
Le 10 août 08 à 06:08, Nick Veys a écrit : I'm getting some interesting results with an image mask I'm trying to apply. I'm trying to vignette away the edges of some small images and instead of getting transparency behind them, I'm getting the black (presumably from the mask). I'm simply call

Re: Non-NSObject object and garbage collection

2008-08-11 Thread Jean-Daniel Dupas
Le 11 août 08 à 14:25, Antonio Nunes a écrit : On 11 Aug 2008, at 13:14, Antonio Nunes wrote: Will it cause a memory leak if I treat the Quartz object in the same way as I do to all my NSObject descendants, i.e. no retains and rely only on garbage collection? You either take care of the obj

Re: How to check the capital letter?

2008-08-11 Thread Jean-Daniel Dupas
Le 11 août 08 à 15:29, Ron Fleckner a écrit : On 11/08/2008, at 10:52 PM, Macarov Anatoli wrote: HI! Cocoa, Obj-C. How to check the capital letter? Hi, I don't remember if there is a Cocoa solution, but of course you can use plain C: NSString *str = @"Aa"; char first =

Re: Use of AppKit in command-line app on headless node

2008-08-11 Thread Jean-Daniel Dupas
Le 11 août 08 à 22:26, Ken Ferry a écrit : Hi Rick, I think you might be misreading that technote.. what it says is that trying to guess which methods are and are not safe doesn't work, because a method that does not happen to require the windowserver in one release may require it in another.

Re: Accessing memory of another application?

2008-08-12 Thread Jean-Daniel Dupas
In practice, it's perfectly possible to access other processes memory using public functions (it require some privileges since 10.4 intel). But to do it you have to use the low-level mach API and that's off topic here. And no, code injection is not used only by virus. (see http://rentzsch.c

Re: Generate back trace programmatically?

2008-08-12 Thread Jean-Daniel Dupas
Le 13 août 08 à 01:34, Nick Zitzmann a écrit : On Aug 12, 2008, at 5:28 PM, Joseph Kelly wrote: is there a known reliable way to generate a back trace from the current point in a given thread's call stack? Yes. (Hint: See the NSException documentation in Leopard, and the ExceptionHandl

Re: Accessing memory of another application?

2008-08-13 Thread Jean-Daniel Dupas
Le 13 août 08 à 15:27, Kyle Sluder a écrit : On Tue, Aug 12, 2008 at 10:14 PM, Steve Byan <[EMAIL PROTECTED]> wrote: Actually, the man-page is incomplete and doesn't tell you how to read and write another process's memory. The manpage also fails to mention the undocumented PT_DENY_ATTACH

Re: @try @catch

2008-08-14 Thread Jean-Daniel Dupas
Le 14 août 08 à 13:53, Devon Ferns a écrit : On 14-Aug-08, at 7:21 AM, Graham Cox wrote: On 14 Aug 2008, at 8:58 pm, Georg Seifert wrote: is it recommended to use @try .. @catch blocks as flow control like it is used in Python. They say explicitly to use it rather than do a lot of test

Re: Clearing a Memory Buffer?

2008-08-18 Thread Jean-Daniel Dupas
Le 18 août 08 à 15:19, Dave a écrit : Hi All, I'm fairly new to Cocoa and was wondering if there are OS functions to Copy and Clear/Fill Memory available? I've tried searching for obvious names like MemoryZero, ZeroMemory, CopyMemory etc. but can't seem to find anything. Thanks a lot A

Re: Tiger Compatible OpenGL Screenshot Code

2008-08-20 Thread Jean-Daniel Dupas
Le 20 août 08 à 19:54, David Duncan a écrit : On Aug 20, 2008, at 10:39 AM, Eric Hoaglin wrote: http://developer.apple.com/samplecode/OpenGLScreenSnapshot/index.html (Leopard+) The basic technique from this sample should work on 10.4 (the previous version of this sample did) but it wasn'

Re: Control-Click vs Right-Click in NSTableView

2008-08-20 Thread Jean-Daniel Dupas
Le 21 août 08 à 00:02, Matthew Mashyna a écrit : I have an NSTableView subclass whose only override method is rightMouseDown. I override it so I can have it select the table row before validating and presenting the context menu (by then passing it up to [super rightMouseDown]). This work

Re: !foo vs foo == nil

2008-08-21 Thread Jean-Daniel Dupas
haha gros malin why free (func) does this test? arf sorry your trusting scale is going to zero Not sure what you're trying to say. According to the C standard, given a variable (foo) the following are identical: if(foo == 0) if(foo == nil) if(foo == NULL) if(!foo) if(foo == '0') and any oth

Re: !foo vs foo == nil

2008-08-21 Thread Jean-Daniel Dupas
Le 21 août 08 à 10:06, Clark Cox a écrit : On Thu, Aug 21, 2008 at 12:21 AM, Thomas Davie <[EMAIL PROTECTED]> wrote: On 21 Aug 2008, at 09:06, Jules Colding wrote: On 21/08/2008, at 01.56, John C. Randolph wrote: On Aug 20, 2008, at 4:15 PM, Torsten Curdt wrote: There was a common pe

Re: [Q] SFPreferenceView and authorize as admin?

2008-08-21 Thread Jean-Daniel Dupas
Most of the authorizations question on this list have the same answer. It's not and will never be possible to increase the rights of a running process (for obvious security reasons). System Preferences (your host process) run as the current user, so it cannot access protected locations. Ha

Re: !foo vs foo == nil

2008-08-21 Thread Jean-Daniel Dupas
Le 21 août 08 à 19:06, Scott Ribe a écrit : Wow, don't check the list for a few days and look what happens! After all, that's why nil (and Nil) exist at all, rather than just reusing NULL. Actually nil exists at all because Objective-C was created *before* NULL was in such standard use! (

Re: Implementing isEqual: and hash

2008-08-23 Thread Jean-Daniel Dupas
Le 23 août 08 à 13:41, Graham Cox a écrit : I have a class for which equality can be defined as having the same internal string value (which happens to be a UUID-turned-string). I can easily implement isEqual: based on that but the docs say I also need to implement -hash. Any pointers on w

Re: Implementing isEqual: and hash

2008-08-23 Thread Jean-Daniel Dupas
Le 23 août 08 à 15:39, Graham Cox a écrit : On 23 Aug 2008, at 9:52 pm, Jean-Daniel Dupas wrote: Le 23 août 08 à 13:41, Graham Cox a écrit : I have a class for which equality can be defined as having the same internal string value (which happens to be a UUID-turned- string). I can

Re: How to read pixel values of monochrome images

2008-08-24 Thread Jean-Daniel Dupas
Le 24 août 08 à 05:55, John C. Randolph a écrit : On Aug 23, 2008, at 2:51 PM, Shawn Erickson wrote: On Fri, Aug 22, 2008 at 2:54 AM, Eduardo Areitio <[EMAIL PROTECTED]> wrote: I'm trying to read individual pixel values in a monochrome image using NSReadPixel, but I haven't been able to.

Re: Reading from Streams - Convenience methods

2008-08-24 Thread Jean-Daniel Dupas
Le 24 août 08 à 09:29, Ananda Bollu a écrit : Hi, What is the best way to read and write data to a Stream. In Java, DataInputStream and DataOutputStream classes provide various serialization methods such as, readInt(), readLong(), readBoolean() etc. Is there anything equivalent for serializi

Re: Modal window

2008-08-25 Thread Jean-Daniel Dupas
Le 25 août 08 à 12:04, Marcus a écrit : 25 aug 2008 kl. 11.03 skrev Macarov Anatoli: When modal window is started up the application stops carrying out other processes. How to work out this issue? Cod: - (void)showCustomDialog: (NSWindow *)window widi:(NSPanel *)windowDialog { if (!

Re: 64-bit => Objc 2.0????

2008-08-25 Thread Jean-Daniel Dupas
Le 25 août 08 à 15:18, Stéphane Sudre a écrit : Probably a stupid question but I don't see anything in the objc headers or in some old slides corroborating this. When you build a project for a 64-bit architecture (such as x86_64), does this imply the Objective-C version for this architectu

Re: Accessing Audio Samples in Cocoa

2008-08-25 Thread Jean-Daniel Dupas
Le 25 août 08 à 16:02, Joseph Ayers a écrit : I am interested in doing some signal processing on the audio channels of a QuickTime Movie. I can retrieve the buffer using MovieAudioExtractionFillBuffer, but the available examples specify the buffer as type Byte*. I am interested in decomposi

Re: Accessing Audio Samples in Cocoa

2008-08-25 Thread Jean-Daniel Dupas
annel and the next sample being the subsequent left sample. Thanks, Joseph Jean-Daniel Dupas wrote: Le 25 août 08 à 16:02, Joseph Ayers a écrit : I am interested in doing some signal processing on the audio channels of a QuickTime Movie. I can retrieve the buffer

Re: is LSEnvironment working with Leopard?

2008-08-26 Thread Jean-Daniel Dupas
It' works on Leopard, but only as the documentation states: “These environment variables are set only for applications launched through Launch Services. If you run your executable directly from the command line, these environment variables are not set.” And unfortunately, Xcode does not use

Re: Creating Interface

2008-08-28 Thread Jean-Daniel Dupas
Le 28 août 08 à 13:24, Christian Giordano a écrit : Protocols seems definitely the way to go and seems to work, I'm only getting some warnings. Basically what I did, I pass the instance implementing the protocol with this syntax: - (void) addListener:(id *) listener and I get "invalid receive

Re: CFBundleIconFile: heiß or hot?

2008-08-28 Thread Jean-Daniel Dupas
Le 28 août 08 à 08:15, Gerriet M. Denkmann a écrit : // this shows the application default icon if CFBundleIconFile = "heiß" // works ok for CFBundleIconFile = "hot" - (IBAction)iconForFileN: sender; { NSBundle *mainBundle = [ NSBundle mainBundle ]; NSString *bundlePat

Re: CFBundleIconFile: heiß or hot?

2008-08-28 Thread Jean-Daniel Dupas
I did test with an UTF-8 one (the default encoding). Le 28 août 08 à 17:44, Shawn Erickson a écrit : On Thu, Aug 28, 2008 at 8:32 AM, Jean-Daniel Dupas <[EMAIL PROTECTED]> wrote: Probably the good one, as the Cocoa framework managed to retreive the icon properly. (the About Box d

Re: Quitting all active applications

2008-08-28 Thread Jean-Daniel Dupas
Cocoa Application expects a Quit AppleEvent, not a sigterm. SIGTERM will kill the app and it will not have any chance to save the edited document. Try with TextEdit if you don't belive it ;-) Actually no, since the default kill signal is TERM, apps will be allowed to prompt to save if nece

Re: global key bindings

2008-08-28 Thread Jean-Daniel Dupas
Le 28 août 08 à 14:21, David Reitter a écrit : On 28 Aug 2008, at 00:27, Eric Schlegel wrote: Menus contained in NSStatusItems (and displayed on the right side of the menubar) don't currently respond to command keys at all. This is already reported in Radar. Thanks, I'll stop looking t

Re: CFBundleIconFile: heiß or hot?

2008-08-28 Thread Jean-Daniel Dupas
Le 28 août 08 à 17:10, Shawn Erickson a écrit : On Thu, Aug 28, 2008 at 5:38 AM, Gerriet M. Denkmann <[EMAIL PROTECTED]> wrote: But, another problem: when I run my app with CFBundleIconFile = "heiß" the picture in the dock is just the default app icon. What encoding is being used for your

Re: CFBundleIconFile: heiß or hot?

2008-08-28 Thread Jean-Daniel Dupas
Le 28 août 08 à 23:00, Kyle Sluder a écrit : On Thu, Aug 28, 2008 at 12:50 PM, Gerriet M. Denkmann <[EMAIL PROTECTED]> wrote: It starts with: Just because it *says* it's encoded in UTF-8 doesn't mean it *is*. For all you know it was saved in MacRoman. --Kyle Sluder So, why the Cocoa fra

Re: NSArray as a static

2008-09-01 Thread Jean-Daniel Dupas
Unlike java, Obj-C does not have the concept of class variable. Your static variable is a classic C variable, and C variable are not automatically initialized to NULL. The first time you call init, relationshipMatch may contains anything and may not be NULL, and so it will never be properly in

Re: NSArray as a static

2008-09-01 Thread Jean-Daniel Dupas
Le 1 sept. 08 à 21:18, Kyle Sluder a écrit : On Mon, Sep 1, 2008 at 2:29 PM, Richard Good <[EMAIL PROTECTED]> wrote: What I want is how to use the Java idea of a class static variable in Objective C Because Objective-C doesn't have class variables (as Jean-Daniel noted), you have to use

Re: NSArray as a static

2008-09-02 Thread Jean-Daniel Dupas
Le 2 sept. 08 à 00:13, Steven Noyes a écrit : On Sep 1, 2008, at 1:38 PM, Jean-Daniel Dupas wrote: Unlike java, Obj-C does not have the concept of class variable. Your static variable is a classic C variable, and C variable are not automatically initialized to NULL. The first time you

Re: NSArray as a static

2008-09-02 Thread Jean-Daniel Dupas
Le 2 sept. 08 à 16:29, Clark Cox a écrit : On Tue, Sep 2, 2008 at 12:33 AM, Jean-Daniel Dupas <[EMAIL PROTECTED]> wrote: Le 2 sept. 08 à 00:13, Steven Noyes a écrit : On Sep 1, 2008, at 1:38 PM, Jean-Daniel Dupas wrote: Unlike java, Obj-C does not have the concept of class va

Re: nibless applications

2008-09-03 Thread Jean-Daniel Dupas
Absolutly, Setting up the main menu is not an easy task as there is no API to do it, and for people that want to do it correctly, your article is like the "Holy Grail" ;-) Le 3 sept. 08 à 15:26, Jeff Johnson a écrit : Filip, All you have to do is create a menu? With all due respect, did

Re: Font Color In CTLineDraw?

2008-09-03 Thread Jean-Daniel Dupas
Le 3 sept. 08 à 17:17, Mike Rossetti a écrit : Thanks for clearing that up David. Apparently one cannot open an NSGraphicsContext within a CGContext, but I will experiment more this evening. I'm discovering that drawing attributed text via CTLineDraw has significant limitation, but for m

Re: NSDate autorelease problem

2008-09-03 Thread Jean-Daniel Dupas
Le 3 sept. 08 à 19:02, [EMAIL PROTECTED] a écrit : Hi, I'm trying to calculate the elapsed time by calling this twice and getting the difference. double Seconds() { return [[NSDate date] timeIntervalSince1970]; } This is being called from an audio play back proc which is being called

Re: Can I get a FILE* from Cocoa (NSFileHandle )?

2008-09-04 Thread Jean-Daniel Dupas
Le 4 sept. 08 à 19:09, Paul Archibald a écrit : I have gotten some suggestions on a problem which require access to standard C calls. In particular, one poster suggested that I use some calls which require a FILE*, when all I have at this point are NSTask, NSPipe, and NSFileHandle objects.

Re: Oracle and Objective C++

2008-09-05 Thread Jean-Daniel Dupas
Le 5 sept. 08 à 17:13, Bradley Randy a écrit : But I get the following errors when I try to compile it. Line Location occiAQ.h:280: error: 'oracle::occi::aq::Subscription::Protocol' has a previous declaration here Line Location occiAQ.h:280: error: 'oracle::occi::aq::Subscription::Protoco

Re: Keyboard accelerators

2008-09-05 Thread Jean-Daniel Dupas
Le 5 sept. 08 à 21:40, Peter Hudson a écrit : I need to set the combination of option + command + up / down arrow in the main menu. It does not seem to be possible to do this in interface builder. Any suggestions ? Peter Yes, doing it in Interface Builder . What do you mea

Re: Posting Keyboard Events

2008-09-06 Thread Jean-Daniel Dupas
Le 6 sept. 08 à 14:00, Peter N Lewis a écrit : At 20:15 -0600 5/9/08, Dave DeLong wrote: How on earth can I post system keyboard events (without getting a beep)? As Ken mentioned, first off make sure the key has somewhere to go. After that, this is roughly the code I use in Keyboard Maestr

Re: Forcing finalization on the main thread?

2008-09-07 Thread Jean-Daniel Dupas
Le 8 sept. 08 à 00:25, Nick Zitzmann a écrit : I've got a C data structure in a GC-enabled app. I'm deallocating the structure when the parent object is finished, in -dealloc and - finalize. I've found out the hard way that the data structure is not thread-safe, and eventually causes a cras

Re: BOOL array

2008-09-09 Thread Jean-Daniel Dupas
Le 9 sept. 08 à 12:24, Alex Reynolds a écrit : I am currently putting 320 to 480 character long NSString * instances into an NSMutableArray. The characters are 0 or 1. I guess I could use an int array, but I'm looking to speed up my app and reduce storage. Is it possible to create a BOOL ar

Re: Cocoa application running very slow under 64 bit

2008-09-11 Thread Jean-Daniel Dupas
Le 11 sept. 08 à 10:44, Frank Illenberger a écrit : Hi there, I migrated an existing cocoa application to run under x86_64 with Xcode 3.1 / Mac OS 10.5.4. The app still runs fine under 32 bit but when started in x86_64 mode, it runs about 3-4 times slower. A shark profile reveals the foll

Re: Cocoa application running very slow under 64 bit

2008-09-11 Thread Jean-Daniel Dupas
Le 11 sept. 08 à 13:01, Frank Illenberger a écrit : Hi there, I migrated an existing cocoa application to run under x86_64 with Xcode 3.1 / Mac OS 10.5.4. The app still runs fine under 32 bit but when started in x86_64 mode, it runs about 3-4 times slower. A shark profile reveals the fo

Re: BOOL array

2008-09-11 Thread Jean-Daniel Dupas
Le 11 sept. 08 à 13:32, dreamcat7 a écrit : Yes the NSMutableData needs this category method then it work. @interface NSMutableData (charArray) - (char*)char; @end @implementation NSMutableData (charArray) - (char*)char { char * foo = self.mutableBytes; return foo; } @end

Re: Getting NSTimeZone for a given NSDate

2008-09-15 Thread Jean-Daniel Dupas
Le 15 sept. 08 à 09:56, Jason Coco a écrit : On Sep 15, 2008, at 03:49 , Markus Spoettl wrote: Hi List, I just know it must be there but I can't see it. How can I get to the NSTimeZone for a given NSDate. When using -description: the date got a time zone, so it's stored in there but how

Re: Existence of Network

2008-09-18 Thread Jean-Daniel Dupas
Le 18 sept. 08 à 21:14, kiran Sanka a écrit : Hi all In my cocoa application i want to find out if there is a network connection exists or not ? -The Coneection or disconnection of the network should be notified to my cocoa application Any suggestions? Use the SystemConfiguration Fr

Re: Modal dialog without NSApplication

2008-09-18 Thread Jean-Daniel Dupas
Le 18 sept. 08 à 15:12, brodhage a écrit : Hi, I am developing application software for Mac and Windows. Most of the code is developed using ObjectC - this way most of the code can be used for both OS. Only the OS depending stuff - like showing dialogs, menus... - is separated. The probl

Re: Modal dialog without NSApplication

2008-09-18 Thread Jean-Daniel Dupas
Le 18 sept. 08 à 16:15, brodhage a écrit : Hi, thank you very much for your quick answer, Jean-Daniel. > If you want a complexe dialog... Yes. So I guess CFUserNotification does not help. > I don't understand why using NSApp for this kind of works will have an impact on the remaining of y

Re: how to set Document type and its icon programatically

2008-09-20 Thread Jean-Daniel Dupas
Le 19 sept. 08 à 11:22, Nick Rogers a écrit : Hi, My cocoa app is not a document based app, but saves a binary file to the disk. I can set this file's name and extension and icon by going to the Target properties and adding a new document type there. It was working fine and the resulting

Re: fullscreen quicktime across multiple monitors

2008-09-21 Thread Jean-Daniel Dupas
You are free to setup a window yourself , add a QTMovieView in it, and display it as you need. NSRect contents = [aScreen frame]; contents.origin = NSZeroPoint; NSWindow *window = [super initWithContentRect:contents styleMask:NSBorderlessWindowMas

Re: CGLayer questions

2008-09-24 Thread Jean-Daniel Dupas
Le 24 sept. 08 à 06:04, Alex Reynolds a écrit : Is it possible to take a CGLayer and turn it into a bitmap representation? Create a CGBitmapContext and draw you layer into it. Also, is it possible to grab a CGRect "subset" of a CGLayer and append that to a new CGLayer, so that it isn't

Re: How to set up a thread listening to performSelector: messages?

2008-09-25 Thread Jean-Daniel Dupas
Le 25 sept. 08 à 17:53, Oleg Krupnov a écrit : I actually have tried this. My code looks like this (is it correct?): @implementation Worker - (void)threadMain:(id)data { runLoop = [NSRunLoop currentRunLoop]; [runLoop addPort:[NSMachPort port] forMode:NSDefaultRunLoopMode]; while(true) {

Re: How can I fix an error in a XIB file?

2008-03-03 Thread Jean-Daniel Dupas
This is a know bug. I'have already fill a bug report about it was mark as duplicate. In my case, it was due to an NSPathControl when I was using the "Popup" style. It's probably an element that serializes icns image (as the AppKit is not able to create NSImage from icns without CGSWindow.

Re: Relaunching an application

2008-03-03 Thread Jean-Daniel Dupas
Le 3 mars 08 à 18:18, Mattias Arrelid a écrit : On 3 mar 2008, at 18.14, Nir Soffer wrote: On Mar 3, 2008, at 18:24, Mattias Arrelid wrote: I have an application that I need to restart. Why do you want to do that? A scenario could be that the entire contents of the .app bundle has been

Re: localizable strings file with macro

2008-03-04 Thread Jean-Daniel Dupas
Le 4 mars 08 à 11:21, Stephane Sudre a écrit : On 4 mars 08, at 10:28, Julien Jalon wrote: 1) Might not be a good idea to use CFStringGetCStringPtr as it might return NULL2) kCFStringEncodingMacRoman is likely not a good choice as the encoding, especially for localized strings If I were y

Re: how to write on disk

2008-03-04 Thread Jean-Daniel Dupas
Le 4 mars 08 à 15:50, norio a écrit : Hi, I think I understand how to write data on a disk using archive and serialization mechanism, but how about this case? I just want to write a short value, a long value and a double value in this order. I don't want to write anything but them. And I

Re: Tabless NSTabView IB3 Bug

2008-03-04 Thread Jean-Daniel Dupas
Le 4 mars 08 à 17:05, Ben Einstein a écrit : I'm trying to use a tabless NSTabView in IB3. Before Leopard, you could double-click the space towards the top of the view and select the tabs, even though there was no visible tab. I also believe there was a control in the inspector to specify

Re: SCT classes

2008-03-04 Thread Jean-Daniel Dupas
Le 4 mars 08 à 21:10, Georg Tuparev a écrit : Folks, I am playing with dynamic class loading... When my test apps starts, I am creating a list of all classes (about 1700 for my ultra simple example). After a while I am recreating the same list. This time the list is longer (about 1800 cl

Re: Triggering GUI login session from daemon? And reboot.

2008-03-05 Thread Jean-Daniel Dupas
google: launchd-dev. First result => http://lists.macosforge.org/mailman/listinfo/launchd-dev Le 5 mars 08 à 11:52, Mike Fischer a écrit : Am 04.03.2008 um 22:18 schrieb "Hamish Allan" <[EMAIL PROTECTED]>: I'd look to launchd-dev, as those are the guys that deal with login sessions and name

Re: Cocoa - Not loading any window at startup ...

2008-03-06 Thread Jean-Daniel Dupas
Hi, To prevent your window to open at startup, uncheck the 'Visible At Launch' box in your window settings (in Interface Builder). I don't know a supported way to create an application that appears in the Dock but has the same behaviour than a LSUIElement. Le 6 mars 08 à 12:55, [EMAIL P

Re: Cocoa - Not loading any window at startup ...

2008-03-06 Thread Jean-Daniel Dupas
ple, which is probably why I couldn't find any reference for it on Google :-) Will check this when I get home. If this is the case, how does one then go about opening and closing the window, from say a menu item attached to an action ?? Thanks -Mic On Mar 6 2008, Jean-Daniel Dupas

Re: Interface to shut down cores and/or processors?

2008-03-06 Thread Jean-Daniel Dupas
Install the CHUD tools, and the in /Developers/Extra/PreferencePanes you can find the processor pref pane that do what you want. I remeber there is also some CHUD header that allow you to do it programatically, but don't remeber where. Le 6 mars 08 à 19:12, Jay Reynolds Freeman a écrit : I

Re: [SOLVED] Re: Getting the "iCal" window style?

2008-03-08 Thread Jean-Daniel Dupas
What did you don't understand in this moderator post ? http://www.cocoabuilder.com/archive/message/cocoa/2008/3/8/200765 "Reposting this just to be crystal clear. iPhone 2.0 SDK is entirely covered by NDA, including the documentation. All of it requires login to access it at the iPhone Dev C

Re: How to get this bundle with identifier

2008-03-09 Thread Jean-Daniel Dupas
I don't think you really want to access the content of a private kernel extension. If your drive is mounted use -[NSWorkspace iconForFile:], else you should use Icon Manager functions to retreive the disk icon IconRef iconRef; OSStatus err = GetIconRef(kOnSystemDisk, kSystemIconsCreator,

Re: How to get this bundle with identifier

2008-03-09 Thread Jean-Daniel Dupas
Le 9 mars 08 à 13:23, Jean-Daniel Dupas a écrit : I don't think you really want to access the content of a private kernel extension. If your drive is mounted use -[NSWorkspace iconForFile:], else you should use Icon Manager functions to retreive the disk icon IconRef iconRef; OSS

Re: How to get the name of a method at runtime?

2008-03-09 Thread Jean-Daniel Dupas
ObjectAlloc and other Apple developement tools already record memory calls (retain, release, alloc, ...) full trace. You really doesn't need to reinvent the wheel to find leaks. Le 9 mars 08 à 23:17, Tony Becker a écrit : Agreed, I forgot to add that warning. I was using it to put fingerpr

Re: How to get the name of a method at runtime?

2008-03-10 Thread Jean-Daniel Dupas
Le 10 mars 08 à 00:29, Stuart Malin a écrit : Interesting approach, Tony. However, __builtin_return_address isn't an object, so stringWithFormat throws an exception when given the %@ token. It should be %u (or %U ?? - I'm not sure of the difference). You should use %p for pointer value

Re: Raw pixel data <-> jpeg

2008-03-10 Thread Jean-Daniel Dupas
Le 10 mars 08 à 09:18, Trygve Inda a écrit : I have raw pixel data in a block of memory of the form ARGB. I need to convert this to a jpg and write it to disk. I can obviously provide the width and height which match the amount of pixel data. I also need to go the other way... Reading a jpg f

Re: No track index in iTunes SB?

2008-03-10 Thread Jean-Daniel Dupas
Le 10 mars 08 à 15:17, [EMAIL PROTECTED] a écrit : Followup... I tried two workarounds, both however return an incorrect result: // Try #1 iTunesPlaylist *currentPlaylist = [ iTunes currentPlaylist ] ; SBElementArray *currentTracks = [currentPlaylist tracks]; int index = [currentTracks index

Re: [iPhone] xml parsing

2008-03-10 Thread Jean-Daniel Dupas
If you find a function/method/class declaration in a public header (an header that is not in PrivateHeader folder) you can problably considere it as public. Le 10 mars 08 à 23:49, Simon Fell a écrit : The iPhone docs point you in the direction of libXML2 for parsing XML, yet the headers f

Re: Button on a button

2008-03-10 Thread Jean-Daniel Dupas
NSButton is a view. Every view accept subviews. So you can probably adding an other button in an existing button. I don't know if Interface Builder support it, but if it does not, you can do it programmaticaly. Le 11 mars 08 à 00:23, Niklas Saers a écrit : Hi, I'm fairly new to Cocoa so

Re: Creating an NSSocketPort on an available port?

2008-03-11 Thread Jean-Daniel Dupas
Addind those lines after your port creation should alow you to reuse it after a quick restart: int yes = 1; setsockopt([receivePort socket], SOL_SOCKET, SO_REUSEADDR, (void *)&yes, sizeof(yes)); else you will have to get the socket adress after it's creation and extract port from it. You

Re: Cocoa way to get list of user accounts?

2008-03-11 Thread Jean-Daniel Dupas
As far as I know, the only reliable way to get users accounts is to use DirectoryServices but Apple do not provide Obj-C API for Directory Services. There is an obj-C wrapper in the DSTools project of Darwin (http://www.opensource.apple.com/darwinsource/ ), so you may have a look at it. Anyway

Re: Cocoa way to get list of user accounts?

2008-03-11 Thread Jean-Daniel Dupas
Le 11 mars 08 à 09:51, Andrew Farmer a écrit : On 11 Mar 08, at 01:01, Mac QA wrote: On 3/11/08, Jean-Daniel Dupas <[EMAIL PROTECTED]> wrote: As far as I know, the only reliable way to get users accounts is to use DirectoryServices ... you also have to be aware that the local use

Re: shared NSImage from bundle

2008-03-11 Thread Jean-Daniel Dupas
The method your looking for is + (void)initialize { } Warning: This method can be called more than once (if a subclass does not override it) so you should do something like this. @implementation Foo + (void)initialize { if ([Foo class] == self) { // load your images

Re: Creating an NSSocketPort on an available port?

2008-03-11 Thread Jean-Daniel Dupas
Le 11 mars 08 à 17:30, Mac QA a écrit : On 3/11/08, Jean-Daniel Dupas <[EMAIL PROTECTED]> wrote: struct sockaddr_in* addr4; NSData *data = [receivePort address]; if (data) { addr4 = (struct sockaddr_in *)[data bytes]; port = ntohs(addr4->sin_port); } Any clue why somet

Re: Working with large files and Memory

2008-03-11 Thread Jean-Daniel Dupas
Le 11 mars 08 à 17:54, Carl E. McIntosh a écrit : Can you please give advice about handling large data files with memory management techniques? I am attempting to read three large files (1 GB, 208 MB, 725 MB) sequentially and place the data into arrays for processing. Here is my psuedocode:

Re: Mute System

2008-03-12 Thread Jean-Daniel Dupas
The easiest way is to use AppleScript (there is a get volume settings' and a 'set volume' command in StandardAdditions). The other way is to use CoreAudio. Le 12 mars 08 à 19:49, Herr Thomas Bartelmess a écrit : Hi everyone, does somebody know, what i have to do to control the system Aduio Vo

Re: Deleting a folder

2008-03-12 Thread Jean-Daniel Dupas
Le 12 mars 08 à 23:12, Mr. Gecko a écrit : I was going to do that but it is not internal I used NSFileManager - removeFileAtPath:handler: instead [[NSFileManager defaultManager] removeFileAtPath:@"/folder/" handler:nil]; On Mar 12, 2008, at 3:45 PM, Herr Thomas Bartelmess wrote: unix command

Re: Custom View drawn twice?

2008-03-14 Thread Jean-Daniel Dupas
Le 14 mars 08 à 13:54, Uli Kusterer a écrit : On 14.03.2008, at 13:11, Uli Kusterer wrote: On 14.03.2008, at 09:11, Ben Lachman wrote: I think I finally solved this while chatting with Wil Shipley earlier this evening. Wil mentioned sometimes needing to display from the opaque ancestor wh

Re: ScriptingBridgeConcepts problem

2008-03-15 Thread Jean-Daniel Dupas
that command line again? On 16/03/2008, at 12:12 AM, Jean-Daniel Dupas wrote: The sdef file in Mail has some error (like almost all Apple sdef file in fact). You can use this one if you need. Le15 mars 08 à 10:53, Cocoa a écrit : I am reading the Scripting Bridge Concepts.pdf, when I

Re: XCode3 & NSLog & Tiger compatibility

2008-03-15 Thread Jean-Daniel Dupas
Le 15 mars 08 à 19:08, Steve Cronin a écrit : Folks; I've finally begun to use XCode3 and I know I need to learn my way around the new world. I have an existing Tiger project that I will be shipping under Tiger but I need to ensure Leopard compatibility. So I can't convert it to the new w

Re: Convert NSString to FSRef

2008-03-15 Thread Jean-Daniel Dupas
Le 15 mars 08 à 20:04, Kevin Dixon a écrit : 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 output; CFStringRef cfFilePath = CFStringCreateWithCString

Re: Convert NSString to FSRef

2008-03-16 Thread Jean-Daniel Dupas
Le 16 mars 08 à 07:49, Stuart Malin a écrit : Kevin, Here's two variants that you can start to work with. Use the first one if it works. The second one is a more roundabout way of getting the NSString to bytes. Two disclaimers: 1: I have never worked with CF functions before, but have b

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

2008-03-17 Thread Jean-Daniel Dupas
Le 17 mars 08 à 18:01, Jens Alfke a écrit : 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 un

Re: NSAppleScript returning wrong error info

2008-03-18 Thread Jean-Daniel Dupas
Le 18 mars 08 à 10:47, Vinay Prabhu a écrit : I am trying to create a NSAppleScript object using a applescript file. The code is as follows, NSDictionary* errorInfo; NSAppleScript *script = [[NSAppleScriptalloc] initWithContentsOfURL: scriptURL error: &errorInfo]; As per the documentation,

Re: Setting Web Proxy programmatically

2008-03-18 Thread Jean-Daniel Dupas
As already said by Basavaraj, all proxy settings are accessible using the "SystemConfiguration" Framework. Le 18 mars 08 à 13:37, parag vibhute a écrit : My requirement is to set proxy via selecting "Using a PAC file" in Configure proxy drop-down button of Network pane of system preference

Re: Setting Web Proxy programmatically

2008-03-18 Thread Jean-Daniel Dupas
search, I think they are only readable or for getting notification. But my requirement is to change it. Thanks, Palav On Tue, Mar 18, 2008 at 6:29 PM, Jean-Daniel Dupas <[EMAIL PROTECTED] > wrote: As already said by Basavaraj, all proxy settings are accessible using the "SystemCo

Re: Setting Web Proxy programmatically

2008-03-18 Thread Jean-Daniel Dupas
you said, they are accessible but are they writable? Through search, I think they are only readable or for getting notification. But my requirement is to change it. Thanks, Palav On Tue, Mar 18, 2008 at 6:29 PM, Jean-Daniel Dupas <[EMAIL PROTECTED] > wrote: As already said by Basavaraj

Re: XCode3 errors on startup

2008-03-18 Thread Jean-Daniel Dupas
Yes, Xcode love to tell you what it does, but it's not really important. All those warning are a side effect of garbage collection in software that use to leak nad should be ignored. Le 18 mars 08 à 18:29, Steve Cronin a écrit : Folks; When I start XCode3 in Leopard I am seeing the follow

Re: Best way to execute a shell script from a cocoa application

2008-03-18 Thread Jean-Daniel Dupas
Le 18 mars 08 à 19:14, Ryan Chapman a écrit : What is the best way to execute a shell script from a Cocoa application? I need to be able to specify arguments, like what execv() provides. -Ryan NSTask is able to launch an executable with arguments. ___

Re: Downloading via FTP and loading images in a NSTableView

2008-03-19 Thread Jean-Daniel Dupas
Le 19 mars 08 à 14:50, Valentin Dan a écrit : Hi, I'd like to know how can I get a file from a server that requires user & password ? What classes should I look at ? Also, is it possible to load an image in a NSTableView cell ? And to sum up both questions, can a

Re: Where's the buffer overrun?

2008-03-19 Thread Jean-Daniel Dupas
Le 20 mars 08 à 06:26, Michael Ash a écrit : On Thu, Mar 20, 2008 at 12:56 AM, Jens Alfke <[EMAIL PROTECTED]> wrote: It's never a good idea to make assumptions about where a Foundation object is putting its data; if you need to access the current bytes of an NSData, call -bytes on it. Thi

Re: Setting Web Proxy programmatically

2008-03-20 Thread Jean-Daniel Dupas
Le 20 mars 08 à 13:26, parag vibhute a écrit : I am glad to say that I am able to write the code which can set all four keys releated to PAC file URL. As suggested, I used System Configuration framework. But I think System Configuartion framework (& scutil command) only accesses the dynami

Re: memcpy strange behavior

2008-03-20 Thread Jean-Daniel Dupas
Le 20 mars 08 à 16:04, Dave Carrigan a écrit : On Mar 20, 2008, at 6:48 AM, Sherm Pendley wrote: On Thu, Mar 20, 2008 at 9:25 AM, Nick Rogers <[EMAIL PROTECTED]> wrote: Hi I'm using memcpy to copy a file's sector to my struct. But its skipping one UInt16 in between and copying the next va

Re: Convert kernel AbsoluteTime to a NSDate

2008-03-25 Thread Jean-Daniel Dupas
I think this is an absolute time. Don't know if it may help you, but have a look at http://developer.apple.com/qa/qa2004/qa1398.html I think absolute time 0 corresponds to machine boot time. Le 25 mars 08 à 10:32, Matt Burnett a écrit : Thanks for your reply, but im not sure if this is going

<    2   3   4   5   6   7   8   9   10   11   >