Trying to calculate a running total using Core Data

2008-04-21 Thread Felix Rodriguez
I am trying to figure out how to calculate a running total using core data. I have created an entity called Transactions that have the following properties. Transactions amount balance I am trying to calculate the balance by adding up the amount of all the previous balance

Re: After Unarchive Object Exists, After First GUI Action, gone...

2008-04-21 Thread Andrew Farmer
On 20 Apr 08, at 18:55, John Joyce wrote: Looks like I found a solution... anyone please let me know if my solution stinks. (or any of the rest of this thing!) In the method - (void)windowControllerDidLoadNib:(NSWindowController *) aController I added this: [textView setString:[[stickitNotes ob

Re: Implementing a Slightly Unusual NSTableView

2008-04-21 Thread Peter Zegelin
Thanks Graham - I have updated my code as well. I also think I solved the focus problem. Tried most of the responder methods without luck so I took a different tack. I realized that I would only have 3 views that could grab the focus so I created a global variable 'currentResponder' (will

Re: Trying to calculate a running total using Core Data

2008-04-21 Thread I. Savant
I know how to create a NSFetchRequest on a transaction object but I am unsure on how to create the NSPredicate object to extract all the transactions that were created prior to the current transaction. How about consulting the documentation? Fetching (trust me - re-read this) http://devel

Cropping an NSBitmapImageRep to a given NSRect?

2008-04-21 Thread Daniel Thorpe
Hello everyone, I can't seem to get this to work, yet it seems like it should be so easy. I have an NSBitmapImageRep, and I want to crop it to a given NSRect. The code I've attempted so far is this: // Create an NSImage for the current image rep NSImage *source = [[NSImage a

Re: Complex data for webservices

2008-04-21 Thread Niklas Saers
Just a short update with new questions: On Apr 20, 2008, at 2:07 PM, Niklas Saers wrote: So I know I have to create some kind of CFTypeRef, but how do I make a CFTypeRef object to match the Authentication class definition above? And how do I make a CFTypeRef to match an array of Authenticat

Re: Cropping an NSBitmapImageRep to a given NSRect?

2008-04-21 Thread Graham Cox
On 21 Apr 2008, at 9:43 pm, Daniel Thorpe wrote: [source compositeToPoint:NSZeroPoint fromRect:extent operation:NSCompositeSourceIn fraction:1.0]; Try using NSCompositeSourceCopy here instead. G. ___ Cocoa-dev mailing list (Cocoa-dev@lists.appl

Getting current NSViewAnimation coordinates

2008-04-21 Thread Thomas Engelmeier
Hi, I have some code that sometimes needs to cancel aka stop a running NSViewAnimation and start another. It seems on Tiger the real view coordinates are animated but on Leopard only an proxy is anmiated.. - on Leopard the view with the stopped animation is very visibly redrawn at the ori

Re: Cropping an NSBitmapImageRep to a given NSRect?

2008-04-21 Thread Graham Cox
Oops, I meant NSCompositeCopy g. On 21 Apr 2008, at 9:55 pm, Graham Cox wrote: On 21 Apr 2008, at 9:43 pm, Daniel Thorpe wrote: [source compositeToPoint:NSZeroPoint fromRect:extent operation:NSCompositeSourceIn fraction:1.0]; Try using NSCompositeSourceCopy here instead. G. ___

Re: Complex data for webservices

2008-04-21 Thread Niklas Saers
Just a short PS On Apr 21, 2008, at 1:45 PM, Niklas Saers wrote: TestAuthentication *WS = [[TestAuthentication alloc] init]; [WS setParameters:param]; NSLog(@"isComplete == %d, isFault == %d, true == %d", [WS isComplete], [WS isFault], YES); I hadn't noticed that static functions were also p

Crash when dispaying document in iChat Theater

2008-04-21 Thread Antonio Nunes
Hi, I'm trying to implement iChat Theater capability into my garbage collected app, and it looks to be almost working, except for a rather all important crash. When my app is notified that it should start sending video it executes the following code: IMAVManager *manager = [IMAVMa

Fullscreen mode detection from background

2008-04-21 Thread Peter Hoerster
Hi, is there a method to detect from the background if a foreground program is running in fullscreen mode? I have to hide a floating panel when a video or game software is running fullscreen. Thanks in advance. Peter ___ Cocoa-dev mailing list (Cocoa

Re: Cropping an NSBitmapImageRep to a given NSRect?

2008-04-21 Thread Daniel Thorpe
Thanks Graham, I've just tried NSCompositeCopy, still doesn't work, no change... One thing that I've noticed though, is that the source is a grayscale image, but the image that I'm creating is RGB. Should I perhaps be creating a new bitmap image rep in the target (of the same colorSpace)

Re: Cropping an NSBitmapImageRep to a given NSRect?

2008-04-21 Thread Graham Cox
Hard to tell from the code posted. Maybe extent is incorrect? You can just draw the source imageRep directly - you don't have to wrap it in an image, and given that you just want a straight copy it'll be simpler too. Use [imageRep drawAtPoint:...] This may not have a bearing on your problem

Re: After Unarchive Object Exists, After First GUI Action, gone...

2008-04-21 Thread John Joyce
On Apr 21, 2008, at 6:45 AM, [EMAIL PROTECTED] wrote: Date: Mon, 21 Apr 2008 01:16:56 -0700 From: Andrew Farmer <[EMAIL PROTECTED]> Subject: Re: After Unarchive Object Exists, After First GUI Action, gone... To: John Joyce <[EMAIL PROTECTED]> Cc: cocoa-dev@lists.apple.com Message-ID: <[

Re: Cropping an NSBitmapImageRep to a given NSRect?

2008-04-21 Thread Daniel Thorpe
The extent rect is correct, I've double checked that. Looking at the docs for NSImageRep's drawAtPoint and drawInRect methods, it looks like they only allow you to draw the whole image rep, not a rect within the rep. I think the problem might be that the cropping is working fine, it's jus

Re: A cursor bug in DragItemAround example

2008-04-21 Thread Ling Wang
Cursor-tracking glitches, where the cursor doesn't revert when exiting a view, are really common in Cocoa apps. I see them in all kinds of apps, even major Apple ones like Mail and Xcode. I think it's due to bugs in AppKit, unfortunately. These bugs have been around since at least 10.0, but

Re: Complex data for webservices

2008-04-21 Thread Jeff LaMarche
Niklas: I'm no expert on Web Services on Objective-C, but I've been playing around with them a bit. One thing that I have discovered is that CFTypeRef is not _always_ a dictionary. In some cases, it wants a string. For example, if you run WSMakeStubs on the National Weather Service's WSD

Conflicting encodings issue in a Cocoa app

2008-04-21 Thread Ewan Delanoy
Hello all, in the user interface of my Cocoa app I have a button with two alternative titles, one that I write in Interface Builder and the other appears on a line in my code as follows, [theButton setTitle:[NSString stringWithFormat:@"Put a n with a tilde,like this

Re: Binding NSButton enabled state

2008-04-21 Thread Lorenzo Thurman
> Message: 1 > Date: Sun, 20 Apr 2008 14:02:52 -0600 > From: Keary Suska <[EMAIL PROTECTED]> > Subject: Re: Binding NSButton enabled state > To: "Cocoa-Dev (Apple)" > Message-ID: <[EMAIL PROTECTED]<[EMAIL PROTECTED]> > > > Content-Type: text/plain; charset="US-ASCII" > > on 4/20/08 11:47 AM,

Re: Cropping an NSBitmapImageRep to a given NSRect?

2008-04-21 Thread Graham Cox
On 21 Apr 2008, at 11:21 pm, Daniel Thorpe wrote: The extent rect is correct, I've double checked that. Looking at the docs for NSImageRep's drawAtPoint and drawInRect methods, it looks like they only allow you to draw the whole image rep, not a rect within the rep. True, but if you don't

Re: Cropping an NSBitmapImageRep to a given NSRect? [Solved]

2008-04-21 Thread Daniel Thorpe
Right, well, I've solved my problem, but using a completely different method. I still don't know/understand how to crop an NSImage to a smaller NSRect within the image's bounds. However, this is what I've done to solve this... // imageRep is my NSBitmapImageRep which contains the ori

Re: Binding NSButton enabled state

2008-04-21 Thread Lorenzo Thurman
> Message: 1 > Date: Sun, 20 Apr 2008 14:02:52 -0600 > From: Keary Suska <[EMAIL PROTECTED]> > Subject: Re: Binding NSButton enabled state > To: "Cocoa-Dev (Apple)" > Message-ID: <[EMAIL PROTECTED]<[EMAIL PROTECTED]> > > > Content-Type: text/plain; charset="US-ASCII" > > on 4/20/08 11:47 AM,

Re: Conflicting encodings issue in a Cocoa app

2008-04-21 Thread glenn andreas
On Apr 21, 2008, at 8:35 AM, Ewan Delanoy wrote: [theButton setTitle:[NSString stringWithFormat:@"Put a n with a tilde,like this : %c",0X00F1]]; Unfortunately, at runtime the exotic character is displayed incorrectly: it appears as a "breve" (Unicode character number 02D8 instead of 00F1)

Selection in NSCollectionView

2008-04-21 Thread Sudarshan S
I am trying to understand NSCollectionView with Apple provided sample IconCollection. I would like to write an action code to handle selection of items in this collection view. How do I do it ? thanks, Leo _

Proper way to revert with NSUserDefaultsController

2008-04-21 Thread Lorenzo Thurman
I've run into some trouble using revert with NSUserDefaultsController: It doesn't work. My settings do not revert to their previous settings. I'm working on a prefs window and what I want to have happen is if a user clicks the cancel button, any changes made are reverted to their previous setting.

Premature notification from NSApplication - workaround?

2008-04-21 Thread Graham Cox
I'm responding to: - (void) applicationDidBecomeActive: (NSNotification*) aNotification But when I get the notification, it seems that [NSApp mainWindow] still returns nil as if it were inactive. The message is obviously sent before -mainWindow is set up, which means that in fact the appli

Integrating application with Time Machine

2008-04-21 Thread Rama Krishna
Is it possible to show an application's UI in Time Machine? When time machine is launched from Mail, the snapshots at different times are shown in the mail window as opposed to a Finder windows. Is it possible for any other application to do the same thing? So when user enter time machine and

Re: A cursor bug in DragItemAround example

2008-04-21 Thread Jens Alfke
On 21 Apr '08, at 6:22 AM, Ling Wang wrote: Do you mean that it is unclear why this happens and there is no way for application developers to avoid this annoyance? As far as I know, yes. :-( —Jens smime.p7s Description: S/MIME cryptographic signature ___

Re: Conflicting encodings issue in a Cocoa app

2008-04-21 Thread Ewan Delanoy
> > You want %C, not %c (%c is "character", while %C is unicode character). > You're right, it works now with %C instead of %c. Thanks! I guess the use of %c should be avoided, like the use of old-fashioned C Strings? Ewan _

Re: Integrating application with Time Machine

2008-04-21 Thread Karl Moskowski
On 21-Apr-08, at 10:51 AM, Rama Krishna wrote: Is it possible to show an application's UI in Time Machine? When time machine is launched from Mail, the snapshots at different times are shown in the mail window as opposed to a Finder windows. Is it possible for any other application to do the

Re: Conflicting encodings issue in a Cocoa app

2008-04-21 Thread Jens Alfke
On 21 Apr '08, at 6:35 AM, Ewan Delanoy wrote: It seems clear that this is a conflicting encoding issue, but between which encodings? coming from where? (The default file encoding is "Unicode UTF-8" in the Xcode preferences, and it seems there is no item to deal with encodings in the Inter

Re: Conflicting encodings issue in a Cocoa app

2008-04-21 Thread Ewan Delanoy
> > "%c" is interpreted at runtime according to the default string > encoding for that process. This depends on what the user's preferred > language is set to, but for English and most European languages it's > MacRoman. That choice makes sense for backward-compatibility reasons, > but nowadays it

Using scrolling lists of controls and handling window resize.

2008-04-21 Thread Duncan Champney
My app has a 3D view window that displays a large OpenGL view over most of it's surface, along with a group of controls that run down the left side of the window. The user can resize the window quite small, which makes some of the controls disappear off the bottom of the window. My solution

Re: Trying to calculate a running total using Core Data

2008-04-21 Thread Keary Suska
on 4/21/08 2:06 AM, [EMAIL PROTECTED] purportedly said: > I am trying to figure out how to calculate a running total using core > data. I have created an entity called Transactions that have the > following properties. > > Transactions > amount > balance > > > > This routine only copies the am

Re: Conflicting encodings issue in a Cocoa app

2008-04-21 Thread Jean-Daniel Dupas
Le 21 avr. 08 à 16:48, Jens Alfke a écrit : On 21 Apr '08, at 6:35 AM, Ewan Delanoy wrote: It seems clear that this is a conflicting encoding issue, but between which encodings? coming from where? (The default file encoding is "Unicode UTF-8" in the Xcode preferences, and it seems there is

Re: Premature notification from NSApplication - workaround?

2008-04-21 Thread Keary Suska
on 4/21/08 8:14 AM, [EMAIL PROTECTED] purportedly said: > I'm responding to: - (void) applicationDidBecomeActive: > (NSNotification*) aNotification > > But when I get the notification, it seems that [NSApp mainWindow] > still returns nil as if it were inactive. The message is obviously > sent bef

Re: horizontal sizeToFit of NSTextView or NSTextField

2008-04-21 Thread Jack Repenning
On Apr 20, 2008, at 11:37 AM, Manfred Schwind wrote: Getting the height of a text for a given width is easy and I've done that countless times. Also getting the width of a string (layed out in one line if it has no newlines) is no problem. But I have a different problem. I try to give an ea

Cannot find an icon

2008-04-21 Thread Lorenzo
When I compile then launch my app, I get this message on the Console Could not find image named 'icnabcd'. Now, there is no such an icon named that way on my nib file. Anyway I started a search on the project and found the following lines in the Nib file icnabcd So I tried to repl

Re: A cursor bug in DragItemAround example

2008-04-21 Thread Mike Wright
On 21 Apr 2008 07:41:25 -0700 , Jens Alfke <[EMAIL PROTECTED]> wrote: On 21 Apr '08, at 6:22 AM, Ling Wang wrote: Do you mean that it is unclear why this happens and there is no way for application developers to avoid this annoyance? As far as I know, yes. :-( —Jens Perhaps it's not relat

Re: Crash when dispaying document in iChat Theater

2008-04-21 Thread Kevin Grant
Is the view drawing on a thread other than the main thread? That might not be allowed (I'm not sure about Cocoa...in Carbon this was never possible). For the doesNotRecognizeSelector case, do you see any compiler warnings about this? That would at least show if it's your code that's referring to

Re: Trying to calculate a running total using Core Data

2008-04-21 Thread I. Savant
> First issue I see is how you can know what transaction objects "occur" prior > to any given object. I don't think you can rely on objects being retrieved > in any specific order that your data model doesn't enforce. You're correct - you can't rely on the order in which instances are fetched

Re: Trying to calculate a running total using Core Data

2008-04-21 Thread I. Savant
> ... of course, even if you use a predicate to specify a date range, > the transaction order still doesn't matter. I digress. Sorry - this is confusing. I meant to delete this paragraph after I realized that the OP is talking about a running balance after each transaction, rather than the to

Re: Crash when dispaying document in iChat Theater

2008-04-21 Thread Antonio Nunes
On Apr 21, 2008, at 4:55 PM, Kevin Grant wrote: Is the view drawing on a thread other than the main thread? That might not be allowed (I'm not sure about Cocoa...in Carbon this was never possible). No, it all happens on the main thread. For the doesNotRecognizeSelector case, do you see any c

NSTextfields and keyboard equivalents - am I missing something?

2008-04-21 Thread Mattias Arrelid
I have a simple test application with a few custom menu items. Let's assume that _none_ of these items has a key equivalent of COMMAND + (right arrow) for now. When the first responder of the application is an NSTextField, and the user produces COMMAND + (right arrow), the insertion point is being

Re: Conflicting encodings issue in a Cocoa app

2008-04-21 Thread Aki Inoue
(By the way, in 10.5, GCC now allows you to use non-ascii characters in string literals right in your source code. So there's no need to construct a string with an $(D+P(B in it programmatically, as long as you're building with Xcode 3.0.) What will be the output encoding in this case ?

Re: Crash when dispaying document in iChat Theater

2008-04-21 Thread Quincey Morris
On Apr 21, 2008, at 05:18, Antonio Nunes wrote: I'm trying to implement iChat Theater capability into my garbage collected app, and it looks to be almost working, except for a rather all important crash. When my app is notified that it should start sending video it executes the following c

Copying contents of an NSString to the Clipboard

2008-04-21 Thread Johnny Lundy
Greetings, I've studied the pasteboard docs, and wonder if there is a simple way to copy the contents of an NSString to the general clipboard. In AS or AS Studio it's just "set the clipboard to ." Is there such a convenience method in Cocoa? Thanks, Johnny ___

Consistent Contextual Menu in NSTableview

2008-04-21 Thread Steve Cronin
Folks; I'm having some difficulty getting consistent contextual menu behavior in NSTableView. In the Finder and iTunes (what I feel most users are familiar with) if a row is selected but the user causes a contextual menu on a different row then row selection changes. (I don't want to star

Re: NSTextfields and keyboard equivalents - am I missing something?

2008-04-21 Thread John Stiles
In "The Path Of Key Events" in the URL you posted, the #1 item in the list is "key equivalents." AppKit checks keyDown events to see if command is held; if it is, it tries to match it against the menus before passing it through the responder chain. I think your best bet is to dim your menu item

Re: Implementing a Slightly Unusual NSTableView

2008-04-21 Thread Corbin Dunn
I seem to recall that in 10.5 there is new API, either in NSTableView or NSActionCell, that makes this easy to do; but I just looked through both headers and can't find it. Does anyone else remember? Yeah, I remember. The DragNDropOutlineView demo shows how. Basically, you implement: -

Re: Conflicting encodings issue in a Cocoa app

2008-04-21 Thread Jean-Daniel Dupas
Le 21 avr. 08 à 18:54, Aki Inoue a écrit : (By the way, in 10.5, GCC now allows you to use non-ascii characters in string literals right in your source code. So there's no need to construct a string with an ñ in it programmatically, as long as you're building with Xcode 3.0.) What will

Re: NSTableView -editColumn:row:withEvent:select: question

2008-04-21 Thread Corbin Dunn
On Apr 18, 2008, at 3:37 PM, John Stiles wrote: Ben Lachman wrote: > Well, you should be able to just override the drawing code, since > thats really your problem. Going directly against the docs, while it > may work fine now, is playing with fire in my opinion. Yeah… that's why I posted :

Remove the GUI > Revert applications to command-line binaries.

2008-04-21 Thread Pippo
Hello, I have built and runt the OpenGLScreenSnapshot app successfully using the sample code available here: http://devworld.apple.com/samplecode/OpenGLScreenSnapshot/index.html The app permits to take a picture of the screen. While running the OpenGLScreenSnapshot app, one must select the

Re: Crash when dispaying document in iChat Theater

2008-04-21 Thread Antonio Nunes
On Apr 21, 2008, at 5:52 PM, Quincey Morris wrote: If d is a local variable, as this code fragment seems to say, what's keeping it (and therefore d.someView) from getting garbage collected as soon as it goes out of scope? 'setVideoDataSource' is documented to *not* retain the view (in non-G

Re: Copying contents of an NSString to the Clipboard

2008-04-21 Thread I. Savant
> I've studied the pasteboard docs, and wonder if there is a simple way to > copy the contents of an NSString to the general clipboard. In AS or AS > Studio it's just "set the clipboard to ." Is there such a > convenience method in Cocoa? Study the docs again, the answers are there if you've ca

Re: NSTableView -editColumn:row:withEvent:select: question

2008-04-21 Thread John Stiles
Corbin Dunn wrote: On Apr 18, 2008, at 3:37 PM, John Stiles wrote: Ben Lachman wrote: > Well, you should be able to just override the drawing code, since > thats really your problem. Going directly against the docs, while it > may work fine now, is playing with fire in my opinion. Yeah… tha

Re: horizontal sizeToFit of NSTextView or NSTextField

2008-04-21 Thread Manfred Schwind
Either I'm misunderstanding your question, or you're misunderstanding the Geometries code. I think you want - widthForHeight:attributes:, with the height specified for three lines (could just take it from what IB sets for you, or first get a heightForWidth:reallyBig, then triple that). The

Re: Unregistering KVO observers-solved

2008-04-21 Thread Steve Nicholson
On Apr 18, 2008, at 2:35 PM, Hal Mueller wrote: Maybe try [[NSNotificationCenter defaultCenter] removeObserver:nil name:nil object:self] in your dealloc method? I think that will patch the symptom, but I still don't understand why you're getting the original error. I tried that, but no lu

Re: Fullscreen mode detection from background

2008-04-21 Thread Ken Thomases
On Apr 21, 2008, at 7:24 AM, Peter Hoerster wrote: is there a method to detect from the background if a foreground program is running in fullscreen mode? I have to hide a floating panel when a video or game software is running fullscreen. It depends on what you mean by fullscreen mode. Most

Re: Crash when dispaying document in iChat Theater

2008-04-21 Thread Quincey Morris
On Apr 21, 2008, at 10:32, Antonio Nunes wrote: d is a local variable indeed, but it is just an intermediate instrument, one that points to a document that is held' by the document controller. The object d points to remains connected to a root object by being held by the controller. Just

Re: thread count problem

2008-04-21 Thread David Duncan
On Apr 21, 2008, at 1:03 PM, Nick Rogers wrote: when I run my cocoa app, Activity monitor shows it having 2 threads, and thats ok, cause I'm running one POSIX thread with the start of the app and which remains till the app is exited. The problem is when I detach a new NSThread, from which I'm

New to drag and drop

2008-04-21 Thread Mark Thomas
Hi, I'm looking to add in drag and drop support to my app, but one thing which isn't clear at the minute, is whether you are suppose to subclass the NSViews or use delegates to do this. I would have assumed delegates as makes the most future proof solution, so I added a [webWindow registerForDra

Re: thread count problem

2008-04-21 Thread Scott Ribe
1) What are you doing in the method you call from your detached thread? Or 2) Don't worry, be happy. There are a number of Cocoa features which will create a worker thread of their own[1]. In other words, if you *never* explicitly create a thread, you'll likely wind up with multiple threads any

Re: thread count problem

2008-04-21 Thread Navneet Kumar
Thanks for the reply. No, it doesn't affect my app. I was just asking whether it is a problem. On 22-Apr-08, at 1:52 AM, David Duncan wrote: On Apr 21, 2008, at 1:03 PM, Nick Rogers wrote: when I run my cocoa app, Activity monitor shows it having 2 threads, and thats ok, cause I'm running on

thread count problem

2008-04-21 Thread Nick Rogers
hi, when I run my cocoa app, Activity monitor shows it having 2 threads, and thats ok, cause I'm running one POSIX thread with the start of the app and which remains till the app is exited. The problem is when I detach a new NSThread, from which I'm calling "performSelectorOnMainThread:" fre

Re: Consistent Contextual Menu in NSTableview

2008-04-21 Thread Nate Weaver
I would probably override -menuForEvent: instead of -rightMouseDown: . Leopard also has a bit nicer contextual menu handing for table/outline views: If you right-click a row that's not currently selected it highlights just an outline and doesn't change the selection (you can use -clickedRow

Re: thread count problem

2008-04-21 Thread Sean McBride
On 4/22/08 1:33 AM, Nick Rogers said: >when I run my cocoa app, Activity monitor shows it having 2 threads, >and thats ok, cause I'm running one POSIX thread with the start of >the app and which remains till the app is exited. >The problem is when I detach a new NSThread, from which I'm calling >"

Cocoa support for serial port access?

2008-04-21 Thread Rick Mann
Does Cocoa provide any high-level serial port access API? Or do I just use IOKit? -- Rick ___ 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-d

adding an opaque NSView as subview of a semi-transparent NSView

2008-04-21 Thread Bryan Bonczek
I have a custom NSView subclass that draws a semi-transparent background with the following: [[NSColor colorWithDeviceRed:0.0f green:0.0f blue:0.0f alpha:QuickViewControlAlphaValue] set]; NSRectFill(rect); Why is it that any subview I add to my custom view gets drawn with the same alpha v

Re: Mounting AFP Volume using Cocoa

2008-04-21 Thread Bill Monk
On Apr 19, 2008, on Mon, 21 Apr 2008 10:06:47 +0530, JanakiRam wrote: This code works fine , but when i try to mount another volume/ account on the same server , this code doesn't seem to work.I'm always getting -43 error.If i unmount the earlier volume/account on the same server then i'm

-windowDidLoad not getting called

2008-04-21 Thread Rick Mann
I started a very simple non-document Cocoa app project. I added a controller class derived from NSWindowController, and added an NSObject to my .xib to represent it. I've connected an outlet in my controller to a field in the window, and a button in the window to an action in the controller

Re: Cocoa support for serial port access?

2008-04-21 Thread Apple Cocoa List
Check out AMSerialPort from http://www.harmless.de/cocoa.php I have used it for several projects and highly recommend it. Todd On Apr 21, 2008, at 5:00 PM, Rick Mann wrote: Does Cocoa provide any high-level serial port access API? Or do I just use IOKit? -- Rick

SynchroScrollView

2008-04-21 Thread John Stiles
Has anyone gotten this example to work in Leopard? http://developer.apple.com/documentation/Cocoa/Conceptual/NSScrollViewGuide/Articles/SynchroScroll.html I just tried it and I'm having terrible luck. The view is just blanking itself out immediately. I can get it to sort-of work if I replac

Re: Cocoa support for serial port access?

2008-04-21 Thread Hal Mueller
AMSerialPort is nice. I use it with USB-serial converters and with Bluetooth serial devices. http://www.harmless.de/cocoa.php Hal ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to th

-windowDidLoad not getting called

2008-04-21 Thread Rick Mann
I started a very simple non-document Cocoa app project. I added a controller class derived from NSWindowController, and added an NSObject to my .xib to represent it. I've connected an outlet in my controller to a field in the window, and a button in the window to an action in the controller

Re: SynchroScrollView

2008-04-21 Thread John Stiles
I found thee things which, in conjunction, solve the problem: 1 - Rewrite synchronizedViewContentBoundsDidChange as follows. -scrollToPoint seems broken. (I am clamping the scroll view to the left side on purpose) - (void)synchronizedViewContentBoundsDidChange:(NSNotification *)notification

Re: New to drag and drop

2008-04-21 Thread Nick Zitzmann
On Apr 21, 2008, at 2:23 PM, Mark Thomas wrote: 1) I have a webkit control which covers the whole window, would the drop message be sent to the parent ? 2) Or should I be putting operating this on the Webkit control ? DnD implementations vary a bit. Views that display what its data sour

How to import drawing paths into a Cocoa application?

2008-04-21 Thread Steve Weller
I my app I want to be able to use drawing paths for two purposes: 1. Clip images to the path 2. Generate points that lie on the path as a function of the distance along the path I want to be able to create paths with Omnigraffle or some other vector-image app, and export them to PDF or EP

Re: -windowDidLoad not getting called

2008-04-21 Thread Ken Thomases
On Apr 21, 2008, at 6:15 PM, Rick Mann wrote: I started a very simple non-document Cocoa app project. I added a controller class derived from NSWindowController, and added an NSObject to my .xib to represent it. I've connected an outlet in my controller to a field in the window, and a button

Flicker when resizing NSStatusItem with Custom View

2008-04-21 Thread vance
Hi I am seeing annoying flickering when resizing a status bar item using a custom view. I tried using * [statusItem setLength:XX.X] and * [customView setFrame:newFrame] Both methods produce flickering. I investigated further to see where exactly is the flicker happening. T

Where is mach_port_deallocate()?

2008-04-21 Thread Rick Mann
Argh. So hard to find stuff in the docs. Where is mach_port_deallocate()? TIA, -- Rick ___ 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-a

Re: -windowDidLoad not getting called

2008-04-21 Thread Rick Mann
On Apr 21, 2008, at 5:21 PM, Ken Thomases wrote: Sometimes an NSWindowController is instantiated in a NIB as a controller for a window in that same NIB. Other times, an NSWindowController is outside the NIB that contains its window, and is used to load that NIB. I suspect that -windowDi

Re: How to import drawing paths into a Cocoa application?

2008-04-21 Thread Graham Cox
On 22 Apr 2008, at 10:23 am, Steve Weller wrote: Are there any easy ways of calculating the points on the path as a function of the distance from the start of the path? I'm not sure about the rest of your question but I can answer this part. The short answer is no - it's really tricky. H

Re: -windowDidLoad not getting called

2008-04-21 Thread Jeff Nouwen
On Apr-21-2008, at 6:34 PM, Rick Mann wrote: I basically want my controller to go do some stuff after it and the window are loaded. -setWindow seems like an ugly place to do this, and -init is probably too early. Is there a better place? - (void)awakeFromNib - Jeff

Re: Where is mach_port_deallocate()?

2008-04-21 Thread stephen joseph butler
On Mon, Apr 21, 2008 at 7:22 PM, Rick Mann <[EMAIL PROTECTED]> wrote: > Argh. So hard to find stuff in the docs. Where is mach_port_deallocate()? egrep -R mach_port_deallocate /usr/include It would appear to be in mach/mach_port.h (at least on 10.5).

Re: Where is mach_port_deallocate()?

2008-04-21 Thread Rick Mann
On Apr 21, 2008, at 5:50 PM, stephen joseph butler wrote: egrep -R mach_port_deallocate /usr/include Oh I forgot to try that. It would appear to be in mach/mach_port.h (at least on 10.5). I used to try to include the actual file I needed, but that seemed to break the Frameworks thing. S

Callbacks from IOKit

2008-04-21 Thread Rick Mann
Being somewhat new to Cocoa, I often wonder if there's a better way to do things. I'm doing some stuff with USB, and the example code I'm using uses IOServiceAddMatchingNotification() to add a pointer to a C callback to get notified when things happen on the USB bus. In C++, one typically

Re: SynchroScrollView

2008-04-21 Thread John Stiles
Oh, there was a fourth problem actually. This doesn't work in all cases: NSRect changedBounds = [changedContentView bounds]; It should have been NSRect changedBounds = [changedContentView documentVisibleRect]; Also, I switched to RBSplitView to work around issue 3. Is there an IB3 plugin for

Re: SynchroScrollView

2008-04-21 Thread John Stiles
NM that last part, I found the plugin. For the archives, it's at http://brockerhoff.net/src/RBSplitView.ibplugin.zip Sorry, all, for the multiple replies-to-self here :) John Stiles wrote: Oh, there was a fourth problem actually. This doesn't work in all cases: NSRect changedBounds = [cha

Re: How to import drawing paths into a Cocoa application?

2008-04-21 Thread Graham Cox
Whoops, the URL should be: http://apptree.net/drawkitmain.htm On 22 Apr 2008, at 10:35 am, Graham Cox wrote: On 22 Apr 2008, at 10:23 am, Steve Weller wrote: Are there any easy ways of calculating the points on the path as a function of the distance from the start of the path? I'm not su

Re: Where is mach_port_deallocate()?

2008-04-21 Thread Tommy Nordgren
On 22 apr 2008, at 02.50, stephen joseph butler wrote: egrep -R mach_port_deallocate /usr/include Even better - use the search dialog in the free Text Editor TextWrangler from BareBones Software (www.barebones.com) Then you will get a dialog where you can browse any results.

vertically resize NSTextField frame

2008-04-21 Thread Stuart Malin
I have an NSTextField into which I pour some text. I'd like to resize the text field's frame to accommodate the typeset text. I'd like to adjust only the frame's vertical size, leaving the width fixed. I'd appreciate any pointers about what methods I can use to accomplish this. _

Truncated Table Headers

2008-04-21 Thread Jason Barker
Hi everyone, I have resized a few columns in a table to be just a few pixels wider than the actual names of those columns. I have used bindings to connect an NSArrayController to these columns. When I test the interface in Interface Builder as well as building and running the project in Xcode, I no

Re: Flicker when resizing NSStatusItem with Custom View

2008-04-21 Thread Peter Ammon
On Apr 21, 2008, at 5:23 PM, vance wrote: Hi I am seeing annoying flickering when resizing a status bar item using a custom view. I tried using * [statusItem setLength:XX.X] and * [customView setFrame:newFrame] Hi Vance, Thank you for your analysis. This is a known bug.

Re: Flicker when resizing NSStatusItem with Custom View

2008-04-21 Thread vance
Thanks Peter, the workaround worked nicely Vance On Apr 21, 2008, at 9:25 PM, Peter Ammon wrote: On Apr 21, 2008, at 5:23 PM, vance wrote: Hi I am seeing annoying flickering when resizing a status bar item using a custom view. I tried using * [statusItem setLength:XX.X] and

[SOLVED] vertically resize NSTextField frame

2008-04-21 Thread Stuart Malin
After poking around some more, I came up with this approach, which seems to work (except that I now have to deal with adjusting the text field's origin): NSRect r = NSMakeRect(0, 0, [theTextField frame].size.width, MAXFLOAT); NSSize s = [[theTextField cell] cellSizeForBounds:r];

NSCollectionView and CoreData question

2008-04-21 Thread Matthew Delves
Greetings, What I currently have is a core data store that holds information I want to display in an NSCollectionView. What I'm wondering is whether there is a way to get this accomplished and if so how? Any help is greatly appreciated. Thanks, Matthew Delves ___

Programmatically placing an item in the dock

2008-04-21 Thread Oliver Wagner
Hi everyone, I would like to add and remove an item in the dock (preferably with a nice poof when removed) programmatically without restarting the dock. I can't find a way to do this in 10.5. Do any of you know if this is possible? Thanks, Ollie ___

Re: -windowDidLoad not getting called

2008-04-21 Thread Chris Hanson
On Apr 21, 2008, at 5:34 PM, Rick Mann wrote: That's all a rather unfortunate inconsistency (and part of why I sit here learning Cocoa and thinking, "I thought Cocoa was supposed to be this great thing"). I basically want my controller to go do some stuff after it and the window are loade

  1   2   >