Re: Optimizing NSRectFill

2008-12-19 Thread Stéphane Sudre
On Dec 19, 2008, at 4:37 PM, Oleg Krupnov wrote: I'm developing a custom view and noticed that drawRect is becoming increasingly slow. The Shark has pointed out that the bottleneck is the NSRectFill function (that calls CGContextFillRect under the hood) that I use to draw the background of the

Re: Pressable Button

2008-12-16 Thread Stéphane Sudre
On Dec 16, 2008, at 4:02 PM, Gerriet M. Denkmann wrote: I am trying to build a pressable button: an on-off button (subclass of NSButton), which, if pressed for more than 0.3 seconds, displays a context menu. My idea was: Start a non-repeating timer in mouseDown: and schedule it with

Re: Blunt edges to Window

2008-12-11 Thread Stéphane Sudre
On Dec 11, 2008, at 7:12 PM, Arun wrote: The example i have in my mind is Finder, iTunes etc. These have a blunt corned window. There's an API in the AppKit (NSWindow) to have rounded or square corners. Is this what you're referring to? ___

Re: PackageMaker installing into /Applications or ~/Applications depending on admin or not?

2008-12-08 Thread Stéphane Sudre
On Dec 8, 2008, at 6:48 AM, Chris Markle wrote: We have an installer for our current app that use Vise. We'd like to switch maybe to PackageMaker and its artifacts. One thing that the Vise-created install does is get installed to /Applications if you're and admin and to ~/Applications if

[NSButtonCell] How to ask for refresh when a window resigns from being the key window

2008-12-04 Thread Stéphane Sudre
I have a subclass of NSButtonCell that uses a customized version of: - (void) drawImage:(NSImage*) inImage withFrame:(NSRect) inFrame inView:(NSView*) inControlView; for radio buttons. The issue I have is when the window that contains the cell resigns from being the key window: - If the

Re: getting username of authenticated volume

2008-10-02 Thread Stéphane Sudre
On Oct 2, 2008, at 6:30 PM, Mark McCray wrote: Hey there,Is there a way to figure out what username was used to log on to a mounted volume by knowing the volume name Yes. With statfs: uid_t f_owner;/* user that mounted the file system */ you then just need to transform the uid to

Re: To determine if the application is running from a network volume?

2008-09-30 Thread Stéphane Sudre
On Sep 30, 2008, at 2:20 PM, Nethan Aryan wrote: Need Help... I have written a helper tool in Cocoa, which other than it's main task, performs a file permission change operation on the parent application folder. This tool is invoked by the parent application via a menu item. I don't

Re: lauchd and svnserve

2008-09-24 Thread Stéphane Sudre
On Sep 24, 2008, at 10:24 AM, René v Amerongen wrote: [...] 1.)While svnserve is running, in my Subversion_SVNserve.log log I see. svnserve: Root path '/Volumes/Development_Current/_CodeRepository' does not exist or is not a directory. svnserve: Root path

Re: NSTableView works in 10.5 but not in 10.4

2008-09-08 Thread Stéphane Sudre
On Sep 8, 2008, at 12:58 PM, Ellen Chou wrote: I have a tree view window that uses NSTableView and NSOutlineView lists out all the sub folders under user's home directory. For some reason, this window shows the folder contents correctly in Mac OS 10.5.2, but not in Mac OS 10.4.x running

Re: [NSTableView] Drag and Drop issues with NSButton in Leopard

2008-09-04 Thread Stéphane Sudre
On Sep 3, 2008, at 12:27 AM, Corbin Dunn wrote: On Sep 2, 2008, at 1:59 PM, Stéphane Sudre wrote: I have some code that works OK on Tiger but does not on Leopard. I have a NSTableView with a column whose data cell is a NSButtonCell subclass. The NSButtonCell is set to be a checkbox

[NSCursor] White Arrow?

2008-09-02 Thread Stéphane Sudre
In Apple Remote Desktop, when you are in observe mode, the cursor is set to a white arrow. This is pretty nice to show that you can't click somewhere you're usually able to. As far as I can tell, this cursor is not set from a picture. Is the white arrow cursor a system cursor not documented

[NSTableView] Drag and Drop issues with NSButton in Leopard

2008-09-02 Thread Stéphane Sudre
I have some code that works OK on Tiger but does not on Leopard. I have a NSTableView with a column whose data cell is a NSButtonCell subclass. The NSButtonCell is set to be a checkbox/switchbox. The subclass implements the following method: - (BOOL) trackMouse:(NSEvent *)theEvent

Re: programatically quit a program

2008-08-29 Thread Stéphane Sudre
On Aug 28, 2008, at 10:45 PM, Robert Claeson wrote: On 28 Aug 2008, at 22:38, Wayne Shao wrote: What is the correct way to quit a cocoa app? I could use C exit() but that would loose the chance to invoke the right callbacks for clean up. What is the call that would be equivalent to user

[NSWindow] Is it a bug in Cocoa or a task for the developer?

2008-08-27 Thread Stéphane Sudre
If you have a Window miniaturized in the Dock and you send it a orderOut: message, the window is not removed from the Dock. Is it a bug in Cocoa or is it the responsibility of the developer to deminiaturize: the window - if needed - before calling orderOut:? Easily reproducible in IB

64-bit = Objc 2.0????

2008-08-25 Thread Stéphane Sudre
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 architecture is going to be 2.0?

Re: [NSTextStorage/NSAttributedString] How can we know the height of a rendered string?

2008-07-08 Thread Stéphane Sudre
On Jul 8, 2008, at 1:26 AM, Jean-Daniel Dupas wrote: Le 7 juil. 08 à 23:54, Stéphane Sudre a écrit : On Jul 6, 2008, at 11:26 PM, Jean-Daniel Dupas wrote: Le 6 juil. 08 à 21:25, Stéphane Sudre a écrit : Problem: I would like/need to know the height that would be required

Re: [NSTextStorage/NSAttributedString] How can we know the height of a rendered string?

2008-07-08 Thread Stéphane Sudre
On Jul 6, 2008, at 11:26 PM, Jean-Daniel Dupas wrote: Le 6 juil. 08 à 21:25, Stéphane Sudre a écrit : Problem: I would like/need to know the height that would be required to render a string inside a fixed width box. Solution that does not work: So

Re: [NSTextStorage/NSAttributedString] How can we know the height of a rendered string?

2008-07-08 Thread Stéphane Sudre
On Jul 9, 2008, at 12:53 AM, Douglas Davidson wrote: On Jul 8, 2008, at 3:44 PM, Stéphane Sudre wrote: What I mean by incorrect value is that if I draw the string inside a rectangle whose width is inMaxWidth and height is the value obtained from the rect returned

[NSTextStorage/NSAttributedString] How can we know the height of a rendered string?

2008-07-06 Thread Stéphane Sudre
Problem: I would like/need to know the height that would be required to render a string inside a fixed width box. Solution that does not work: So far, I've been using a solution found from a google search and which looks like this: - (float)

[TEST] Test with an orange.com address

2008-07-01 Thread Stéphane Sudre
Test ___ 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 Help/Unsubscribe/Update your Subscription:

Re: [NSMutableAttributedString] How is NSBaseURLDocumentOption supposed to work?

2008-06-28 Thread Stéphane Sudre
On Jun 26, 2008, at 12:38 AM, Stéphane Sudre wrote: When reading a html document into a NSMutableAttributedString (or NSTextStorage) using - (BOOL)readFromURL:(NSURL *)url options:(NSDictionary *)options documentAttributes:(NSDictionary **)dict, what value are you supposed to set

[NSOutlineView] Saving/Restoring the hierarchy disclosure state (Reloaded)

2008-06-26 Thread Stéphane Sudre
I'm beginning to wonder if it's possible to save and restore the current disclosure state of the hierarchy of a NSOutlineView. - Iterating the hierarchy does not save the state of hidden children. - the persistentObject API is not useful in my case as I have multiple instances of the same

Re: [NSOutlineView] Saving/Restoring the hierarchy disclosure state (Reloaded)

2008-06-26 Thread Stéphane Sudre
On Jun 26, 2008, at 10:30 AM, Manfred Schwind wrote: I'm beginning to wonder if it's possible to save and restore the current disclosure state of the hierarchy of a NSOutlineView. I solved this a while ago. Here is what I am doing: I am saving in my model if an item is expanded or

Re: Creating Installer Package from Cocoa

2008-06-25 Thread Stéphane Sudre
On Jun 25, 2008, at 10:59 PM, Ryan Harter wrote: That sounds like exactly what I would like to do, but I'm not quite sure how to copy the plist into the package. I was looking at using pax, but since I'm targeting Leopard, and developing on Leopard, package maker keeps making

[NSMutableAttributedString] How is NSBaseURLDocumentOption supposed to work?

2008-06-25 Thread Stéphane Sudre
When reading a html document into a NSMutableAttributedString (or NSTextStorage) using - (BOOL)readFromURL:(NSURL *)url options:(NSDictionary *)options documentAttributes:(NSDictionary **)dict, what value are you supposed to set for NSBaseURLDocumentOption? When I test this with HTML

Re: Did I reinvent the wheel?

2008-05-10 Thread Stéphane Sudre
On May 9, 2008, at 10:34 PM, Western Botanicals wrote: [...] PS: I didn't look in detail at all your classes, but I did notice that the UUID methods in BusinessObject have leaks. That is wierd, because Xcode hasn't given me any warnings. There's no reason for Xcode to do this. You would

Re: -draggingEntered: never gets called

2008-05-05 Thread Stéphane Sudre
On May 5, 2008, at 11:02 PM, Michael Gardner wrote: I'm trying to implement drag drop in an NSView subclass. I made sure that the source returns NSDragOperationMove in - draggingSourceOperationMaskForLocal:, and that the destination calls -registerForDraggedTypes: with the same (custom)

Re: Programmatic Size To Fit

2008-05-01 Thread Stéphane Sudre
On May 1, 2008, at 7:39 PM, Randall Meadows wrote: I am creating a bunch of controls (at least NSTextfield, NSPopupButton, NSSlider, and perhaps others) programmatically (that will eventually be shown in an NSTableView), and would like to apply the Size To Fit feature that IB provides.

Re: How to get this bundle with identifier

2008-03-09 Thread Stéphane Sudre
On Mar 9, 2008, at 12:48 PM, Nick Rogers wrote: Hi, In my app I need to get the icon for my HDD. For this I need to get the bundle with identifier com.apple.iokit.IOStorageFamily. How can i get this bundle? Since this kernel extension won't probably change its name and location:

Re: 10.5.2 release notes?

2008-03-08 Thread Stéphane Sudre
On Mar 8, 2008, at 10:38 PM, Jonathan Dann wrote: However, there often are no developer release note updates for software updates. If there are bugfixes, why is this the case? Because there's no bugfixes. It just happens that in certain OS releases, engineering is not able to

[NSOutlineView] How to know an item is expanded if its parent item is not?

2008-03-01 Thread Stéphane Sudre
There seems to be a missing method in NSOutlineView. You can know an item is expanded only if its parent is expanded (so that the item itself is visible). This is problematic if you want to cache the current list of expanded items. Instead of just iterating through the item hierarchy when