Re: Updating a cell in NSTableView - it just will not draw! [SOLVED]

2008-04-21 Thread Graham Cox
Great, got it working now. Thanks a lot for the lead... to be honest pulling the dataSource's strings feels a bit hackish but at least it's confined to the controller class that is the table's dataSource, so it's a unique place in my app anyway. Works a treat ;-) I also feel I understand

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

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

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

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

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

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: 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

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

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,

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

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) cocoa-dev@lists.apple.com Message-ID: [EMAIL PROTECTED][EMAIL PROTECTED] Content-Type: text/plain; charset=US-ASCII on 4/20/08

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

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

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) cocoa-dev@lists.apple.com Message-ID: [EMAIL PROTECTED][EMAIL PROTECTED] Content-Type: text/plain; charset=US-ASCII on 4/20/08

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.

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 tends

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

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 snip This routine only copies the amount

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: 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

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 object class=NSCustomResource

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

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

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

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

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

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

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

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 or

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: 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

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 variable. Is there such a convenience method in Cocoa? Study the docs again, the answers are there if you've

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…

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

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.

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

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

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

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:

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

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

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

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

-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

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

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

-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

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

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

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

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

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.

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.

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

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

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 =

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

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

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