Re: Intersection of CGPath and CGRect

2009-06-29 Thread Martin Hewitson
Graham, thanks a lot for your thoughts on this. The 1x1 bitmap is a nice idea; I'll have a go at that. I've grabbed the drawkit source and will have a look at how you got that working. Thanks again, Martin On 29 Jun 2009, at 01:07, Graham Cox wrote: On 28/06/2009, at 4:43 AM, Martin Hewi

Re: NSRuleEditor

2009-06-29 Thread Ashley Clark
On Jun 28, 2009, at 8:29 PM, Loukas Kalenderidis wrote: There's no sample code for NSRuleEditor, right? Or am I missing something? I saw someone ask this on a list last year and the answer was "no, but I've got a sample I can send you" - does anyone have anything they're willing to share?

Re: GC pros and cons

2009-06-29 Thread James Gregurich
you're right. I do make the assumption that only sane exceptions are thrown...meaning subclasses of NSException & std::exception. Certainly any code that I control only throws proper exceptions. For C++ functions, I use exception specifiers. so, if any function throws the wrong type of ex

Re: Force NSTextField to update (and transform)

2009-06-29 Thread Michał Glenc
Hi, Thanks for the advice. I was using bindings just to create a simple application. I found a simple workaround for this problem. I added an IBAction in controller, which handles value change in ComboBox. When user picks up a currency, a message to the transformer is sent in order to set th

Columns widths specified programmatically seem to be wider.

2009-06-29 Thread norio ota
Although total of the widths should be the same as the width in- between the left edge of the scrollview and the right edge minus the width of the vertical scroller, so although it should see all columns fully, the most right column can't see it whole content unless mouse-wheeling right. Th

Dock refuses dropped files

2009-06-29 Thread Keith Duncan
I'm trying to figure out how to inform launch services that my application can handle all file types. Dragging files to the application icon in the Finder works as expected, but the Dock icon refuses to accept drops(!) I've added the following to the info.plist (the actual document type has b

Re: Dispose pattern (was: Re: GC pros and cons)

2009-06-29 Thread Konrad Neitzel
Hi Stephen, thank you very much for taking the time to look at the given link and writing this very nice response to me. Think I was little confused so I mixed a few things that simply should stay seperate. (Managing resources in close() has simply nothing to do GarbageCollection. Some activit

External Drives Questions

2009-06-29 Thread Ammar Ibrahim
How can I do the following in Cocoa: 1- Get the list of mounted drives? 2- Get the serial number of the mounted drive/disk I would assume when you plugin a disk drive that was already configured to use Time Machine. Time machine would check the serial number, and start backing up if it's already "

Disabling buttons in NSSavePanel

2009-06-29 Thread Michael Domino
Hi, I use an NSSavePanel to select a file, enter and confirm a password, encrypt it and save a copy with a new extension. There is an accessory view for entering and confirming a password. I would like the OK button to be disabled while there is no file selection, and if the password/confirm passw

Columns widths specified programmatically seem to be wider.

2009-06-29 Thread Nor
Although total of the widths should be the same as the width in-between the left edge of the scrollview and the right edge minus the width of the vertical scroller, so although it should see all columns fully, the most right column can't see it whole content unless mouse-wheeling right. The follo

Re: Objective C Compiler Settings

2009-06-29 Thread Michael Ash
On Sun, Jun 28, 2009 at 8:08 PM, Graham Cox wrote: > > On 29/06/2009, at 9:18 AM, Michael Ash wrote: > >> Not an exception, but you can get the runtime to log any replaced >> methods by setting the OBJC_PRINT_REPLACED_METHODS environment >> variable when running your app. This and other environment

Question about font managing (NSFont).

2009-06-29 Thread Anders Lassen
Hi, I am working on a project that uses a lot of fonts. To be more precise. I have an object tree consisting of many small objects that draw themselves to a view. Each object can either use a default font setup or make local variations to the default font setup. By local variations, I mean

Re: Disabling buttons in NSSavePanel

2009-06-29 Thread Steve Christensen
A question about disabling the Save button was just asked on this list a few days ago. The thread is archived here: . Google is your friend... steve On Jun 29, 2009, at 6:45 AM, Michael Domino wrote: I use an NSSavePane

Re: External Drives Questions

2009-06-29 Thread Gregory Weston
Ammar Ibrahim wrote: How can I do the following in Cocoa: 1- Get the list of mounted drives? [[NSWorkspace sharedWorkspace] mountedLocalVolumePaths] 2- Get the serial number of the mounted drive/disk Don't know about serial number, but for UUID you use the Disk Arbitration framework. Cre

NSURL URLWithString:relativeToURL: generates an extra /

2009-06-29 Thread Fritz Anderson
I've worked around this by simply building my URL string completely by hand, but I'd like to learn... iPhone OS 3.0. At +initialize time, my class sets up a static NSURL object: sBaseURL = [[NSURL alloc] initWithScheme: @"http" host: @"www.example.com:8080"

Re: External Drives Questions

2009-06-29 Thread Fred Baker
On Jun 29, 2009, at 5:17 AM, Ammar Ibrahim wrote: How can I do the following in Cocoa: 1- Get the list of mounted drives? 2- Get the serial number of the mounted drive/disk Since serial numbers tend to be associated more with devices rather than volumes, your best bet would be to use IOKit t

Re: How to get a fully transparent hit-testable window?

2009-06-29 Thread Michael Ash
On Fri, Jun 26, 2009 at 4:14 PM, Pranav Goel wrote: > Hi > I am writing a Cocoa application which has a WebView in a NSWindow. I want to > be able to put this window onscreen and have it be completely transparent > i.e. nothing should be drawn on the screen. But I still want the WebView to > res

Finding objects in a NSDocument

2009-06-29 Thread Jeff Schriebman
I have a NSDocument class that has a large number of NSTextField objects in it. I would like to get at each of the tag fields in the NSTextField objects using the tag instance. Is there a simple way to iterate over the top level objects in the NSDocument and find all of the NSTextField obje

Web cam: "Camera used by another application"

2009-06-29 Thread Deepa
Hi, I am using QTKit APIs for streaming from webcam. I get the error message 'Camera used by another application' for some of the webcams. But, no other application was using this webcam. The applications like Photobooth, iChat can stream properly from this webcam Following are the steps

Re: display Mac id

2009-06-29 Thread Kiran Kumar
thanks for reply And one more thing that ,i want to display MACID first two characters in one textfield,and next two characters in next textfield . The maximum length of textfield should be 2 characters,and then focus to next textfield. Can u help me plz... thanks, kiran On 24-Jun-09, at 12:2

Two threads, two managed object contexts. Do I need locking?

2009-06-29 Thread Michael Greiner
My application uses a Core Data model on two threads - the main UI thread and a worker thread. Each thread has its own private managed object context as per Apple's recommendation. The managed object contexts share a single persistent store coordinator. Only my worker thread modifies the manag

NSApp problem outside of bundle

2009-06-29 Thread Peter Mulholland
Hello, I've made a program that handles doing a registration dialog for our protected apps. The protection works by encrypting the original Mach-O executable and attaching a stub. This stub attempts to load a licence file. If it's not present, it vfork()/execve()'s this app. A typical protecte

Load File Faster.

2009-06-29 Thread Philip Juel Borges
Hi! I have an app that where a toolbar button loads a property list file into 3 tableviews, which in turn updates a webview. The file is 6,3MB. Whenever I press the button it takes roughly 2 seconds. How can I make the application load that 6,3MB property list file faster? /Philip

Re: Columns widths specified programmatically seem to be wider.

2009-06-29 Thread Laurent Etiemble
Hello, Take a look at "setIntercellSpacing:" in NSTableView Class Reference. The default intercell spacing is (3.0, 2.0), so it may explains the delta you see. Regards, Laurent Etiemble. Monobjc : A .NET/Objective-C Bridge More info at http://www.monobjc.net/ 2009/6/29 Nor : > Although total of

Question on generating mouse events with modifier keys

2009-06-29 Thread Andrew Wu
Hello, I'm interested in creating a utility that can generate mouse clicks with modifier keys (e.g. Ctrl + Primary button), ideally in python (taking advantage of the python-cocoa bridge). This would first be for machines running Leopard, and ideally later with Snow Leopard. I've looked at some

Re: Load File Faster.

2009-06-29 Thread Nick Zitzmann
On Jun 29, 2009, at 9:35 AM, Philip Juel Borges wrote: I have an app that where a toolbar button loads a property list file into 3 tableviews, which in turn updates a webview. The file is 6,3MB. Whenever I press the button it takes roughly 2 seconds. How can I make the application load t

Re: NSApp problem outside of bundle

2009-06-29 Thread Peter Mulholland
Hello, > What's going on? What is NSApp trying to do that falls over when it's not in > a bundle, or in another apps bundle on 10.4? I've solved it. The problem was that [NSApplication sharedApplication] did not add the app to the Dock for some reason. The following code solves that: P

Re: NSApp problem outside of bundle

2009-06-29 Thread Kyle Sluder
On Mon, Jun 29, 2009 at 8:21 AM, Peter Mulholland wrote: > A typical protected app bundle looks like so: Woah... this is kinda nuts. 1) Applications need to be in their own app bundle. 2) Don't fork/exec to launch an application. Use LaunchServices instead. 3) Your "protection" will be easy to b

Re: Two threads, two managed object contexts. Do I need locking?

2009-06-29 Thread Adam Swift
On Jun 29, 2009, at 6:24 AM, Michael Greiner wrote: My application uses a Core Data model on two threads - the main UI thread and a worker thread. Each thread has its own private managed object context as per Apple's recommendation. The managed object contexts share a single persistent sto

Re: Two threads, two managed object contexts. Do I need locking?

2009-06-29 Thread Adam Swift
On Jun 29, 2009, at 1:18 PM, Adam Swift wrote: No, if the only time/place you access the persistent store coordinator is when you create it and then pass it into [[NSManagedObjectContext alloc] initWithPersistentStoreCoordinator:psc], then you should be fine without any additional lockin

Re: NSApp problem outside of bundle

2009-06-29 Thread Stephen J. Butler
On Mon, Jun 29, 2009 at 10:21 AM, Peter Mulholland wrote: > I am not using NSApplicationMain() as this would attempt to load the original > app's nib. Instead I do this: > > int main(int argc, char *argv[]) > { >[[NSAutoreleasePool alloc] init]; >[NSApplication sharedApplication];

Re[2]: NSApp problem outside of bundle

2009-06-29 Thread Peter Mulholland
Hello Kyle, Monday, June 29, 2009, 9:17:35 PM, you wrote: > Woah... this is kinda nuts. How exactly? > 1) Applications need to be in their own app bundle. Really, this isn't an application, its a component. There's probably a better way to do it, but I can't think of one. > 2) Don't fork/exe

Re[2]: NSApp problem outside of bundle

2009-06-29 Thread Peter Mulholland
Hello Stephen, Monday, June 29, 2009, 11:12:20 PM, you wrote: > You don't use kCurrentProcess as an argument. You use it like this: > ProcessSerialNumber psn = { 0, kCurrentProcess }; > TransformProcessType( &psn, ... ); I see. It isn't really explained all that clearly. I'll give that a shot.

NSObjectController, content outlet and content object question

2009-06-29 Thread Michael de Haan
May I indulge the group with an issue I have been trying to understand for a few days. I have tried to read the extensive literature and correspondence to the group, but so far have not seen an answer that is specific to this question. Given this simple appwhich keeps a slider and text

Re: Re[2]: NSApp problem outside of bundle

2009-06-29 Thread Kyle Sluder
On Mon, Jun 29, 2009 at 3:20 PM, Peter Mulholland wrote: > Monday, June 29, 2009, 9:17:35 PM, you wrote: > >> Woah... this is kinda nuts. > > How exactly? Because it directly violates quite a few requirements of working on OS X? And you're resorting to pretty convoluted workarounds to try to get

Re: NSApp problem outside of bundle

2009-06-29 Thread Stephen J. Butler
On Mon, Jun 29, 2009 at 3:03 PM, Peter Mulholland wrote: > BTW Yes I know about kCurrentProcess. It doesn't work. Passing that to > TransformProcessType() causes a crash. You don't use kCurrentProcess as an argument. You use it like this: ProcessSerialNumber psn = { 0, kCurrentProcess }; Transfo

Re[4]: NSApp problem outside of bundle

2009-06-29 Thread Peter Mulholland
Hello Kyle, Monday, June 29, 2009, 11:36:54 PM, you wrote: > Because it directly violates quite a few requirements of working on OS > X? And you're resorting to pretty convoluted workarounds to try to > get things working again. That should be a pretty good clue that > you're doing things incor

nib-object retaining question

2009-06-29 Thread WT
Hello list, suppose I have a nib file where the File Owner's class has outlets to some of the objects in the nib. When the nib is loaded, the connections are established and the outlet ivars in the (now actual) file owner point to the unarchived objects they're supposed to point to. All f

Re: NSObjectController, content outlet and content object question

2009-06-29 Thread Quincey Morris
On Jun 29, 2009, at 15:23, Michael de Haan wrote: Given this simple appwhich keeps a slider and textField's value synchronized. 1) View consisting of a slider and a textField 2) Model (Foo) with a single property "number" 3) NSObjectController I am able to use 2 configurations to get the

Re: NSTableView -setDataCell confusion

2009-06-29 Thread Raleigh Ledet
On Jun 28, 2009, at 10:05 PM, Quincey Morris wrote: On Jun 27, 2009, at 13:18, Chase Meadors wrote: I'm using AMIndeterminateProgressIndicatorCell (at least the drawing code) to imitate a progress indicator in the table view. To get it to use the custom cell, I've been calling [myTableCo

Re: NSObjectController, content outlet and content object question

2009-06-29 Thread Michael de Haan
Quincey Morris wrote: On Jun 29, 2009, at 15:23, Michael de Haan wrote: Given this simple appwhich keeps a slider and textField's value synchronized. 1) View consisting of a slider and a textField 2) Model (Foo) with a single property "number" 3) NSObjectController I am able to use 2

Re: nib-object retaining question

2009-06-29 Thread mmalc Crawford
On Jun 29, 2009, at 3:58 PM, WT wrote: I have three questions: The answers are all contained in the documentation. You should take some time to read "Nib Files" in "Resource Programming Guide" and "Memory Management Programming Guide for Cocoa". mmalc ___

NSBitMapRepresentation --> JPEG compression?

2009-06-29 Thread Chris Tracewell
--- Using GC --- I am saving images to file from an NSImage dropped into an NSImageView using JPEG as the file format via the code below. -(IBAction)saveImages:(id)sender { TKProduct *theProduct = [[myProductArrayController selectedObjects] objectAtIndex:0]; NSBitmapImageRep *th

Re: Re[2]: NSApp problem outside of bundle

2009-06-29 Thread Steve Christensen
On Jun 29, 2009, at 3:22 PM, Peter Mulholland wrote: Monday, June 29, 2009, 11:12:20 PM, you wrote: You don't use kCurrentProcess as an argument. You use it like this: ProcessSerialNumber psn = { 0, kCurrentProcess }; TransformProcessType( &psn, ... ); I see. It isn't really explained all t

Re[4]: NSApp problem outside of bundle

2009-06-29 Thread Peter Mulholland
Hello Steve, Tuesday, June 30, 2009, 12:42:31 AM, you wrote: > It's actually described very clearly in Xcode's developer docs for > TransformProcessType: > ... > Parameters > PSN > The serial number of the process you want to transform. You can also > use the constant kCurrentProcess to r

Re: Re[4]: NSApp problem outside of bundle

2009-06-29 Thread Kyle Sluder
On Mon, Jun 29, 2009 at 3:56 PM, Peter Mulholland wrote: > If you are referring to me not using NSApplicationMain(), how is that > unsupported? In fact the code is based on things I've seen in Apple samples. > [NSApplication sharedApplication] is a documented API. So is loading your own > NIB. I

Re: nib-object retaining question

2009-06-29 Thread Roland King
and note also that the answer is slightly different depending on whether you are targeting OSX or iPhone, so make sure you read the correct piece of the documentation for the platform of interest. mmalc Crawford wrote: On Jun 29, 2009, at 3:58 PM, WT wrote: I have three questions: The an

disabling grammar checking

2009-06-29 Thread kvic...@pobox.com
while it is meaningful to do spell checking in my app, it is never meaningful to check grammar. therefore, i would like the "Check grammar" checkbox to not appear in the guess panel, or at least be disabled/grayed out. how can i accomplish this? additionally, i'm not happy that the framework

Re[6]: NSApp problem outside of bundle

2009-06-29 Thread Peter Mulholland
Hello Kyle, Tuesday, June 30, 2009, 1:11:02 AM, you wrote: > I'm referring to your use of NSApplication in an app that's not > bundled. You can't do that. Apps must be in app bundles. Technically it is. While it does execute on the command line without the nib in a bundle, its not really desi

Re: Re[6]: NSApp problem outside of bundle

2009-06-29 Thread Kyle Sluder
On Mon, Jun 29, 2009 at 5:30 PM, Peter Mulholland wrote: > I'll see how it goes. If necessary I'll put RegDialog.app inside Resources > and then just have the loader run that instead. You really might just want to save yourself the effort and do it now. Things break in extremely subtle ways when

Re: CalendarStore and delegated calendars

2009-06-29 Thread Steven Riggs
Any takers on the subject of iCal delegated calendars and the CalendarStore? I may file a bug. -Steve On Jun 22, 2009, at 11:47 PM, Steven Riggs wrote: Hello all, Is it a bug or by design that the CalendarStore will not pick up delegated calendars? I've googled all night without an answ

(as you type) spell checking of an attributed string

2009-06-29 Thread kvic...@pobox.com
in my app, i use a NSTableView to let the user specify headers/footers for use in reports. a row in the table corresponds to a single header/footer line. a single header/footer line is an NSAttributedString, and i allow the user to specify the text and font and size and text color. additionally

Re: Question about font managing (NSFont).

2009-06-29 Thread Graham Cox
On 30/06/2009, at 2:10 AM, Anders Lassen wrote: Is a font a large object that requires a lot of memory usage and CPU time for initial loading, etc. ??? or should I just think of it, as an small object pointer. (my object tree will in average contain about 100-300 objects). I hope someone

Re: disabling grammar checking

2009-06-29 Thread Martin Wierschin
i'm not happy that the framework is changing the name of my menu item from "Show SpellingŠ" (as i've specified in IB) to "Show Spelling and Grammar". is there some way to globally "fix" this? (i know i can provide my overrides of showGuessPanel: and validateMenuItem: in specific field edito

Re: Re[4]: NSApp problem outside of bundle

2009-06-29 Thread Michael Ash
On Mon, Jun 29, 2009 at 6:56 PM, Peter Mulholland wrote: > This is exactly the kind of attitude that means game dev does *not* happen on > OS X. What, that the free help doesn't feel like helping you implement a proprietary DRM scheme makes it impossible to develop games on OS X? You're free to

Re: Re[4]: NSApp problem outside of bundle

2009-06-29 Thread Michael Ash
On Mon, Jun 29, 2009 at 8:11 PM, Kyle Sluder wrote: >> IF Apple start requiring ALL apps to be code signed (and presumably, charge >> for the privilege), watch as support from smaller developers disappears. >> Even MS aren't going to do that. > > I doubt that.  Code signing is easy for anyone to

Re: Load File Faster.

2009-06-29 Thread Scott Ribe
> How can I make the application load that 6,3MB property list file > faster? Don't abuse property lists; if you need a database, use a database. -- Scott Ribe scott_r...@killerbytes.com http://www.killerbytes.com/ (303) 722-0567 voice ___ Cocoa-dev

Re: Load File Faster.

2009-06-29 Thread Dave Keck
> Don't abuse property lists; if you need a database, use a database. Indeed. And if you can/aren't already, use a binary plist. And load the data in a background thread, to keep the UI snappy. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Ple

Re: Load File Faster.

2009-06-29 Thread mmalc Crawford
On Jun 29, 2009, at 8:55 PM, Dave Keck wrote: Don't abuse property lists; if you need a database, use a database. Indeed. And if you can/aren't already, use a binary plist. And load the data in a background thread, to keep the UI snappy. Without any additional information, I would suggest i

Input for CIFilter

2009-06-29 Thread Mahaboob
Hi, I can apply almost all filter effects to my graphics except Generator and Gradient effects. I'm applying filters in drawRect: method. This method is calling a function for applying filters. This function checks all the filters in effect stack and assigns input graphics for the input key named "

Re: NSBitMapRepresentation --> JPEG compression?

2009-06-29 Thread Marco S Hyman
On Jun 29, 2009, at 4:12 PM, Chris Tracewell wrote: The issue is that when using writeToFile my images have an extra 3 to 10 KB of size whether the image is really small or really big - ie 5KB or 300KB. I am suspecting that my XCode generated images are bigger for one of two reasons... 1)