NSButton checkbox reports reverse state

2008-06-15 Thread mirage_3d
hi there, i have implemented an NSMatrix of checkboxes and had an outlet point to it. in my code i have changed the appearance of the buttons as well as their states in awakeFromNib. when i check the buttons' states in my action however, the buttons report the inverse state to what they really shou

Re: NSOutlineView threading problem

2008-06-15 Thread Michael Ash
On Sun, Jun 15, 2008 at 8:05 PM, David <[EMAIL PROTECTED]> wrote: > As it stands its a nightmare if something as trivial as an Array > isn't even thread safe. I'm not sure how having thread safe arrays would help. If you're mutating a collection in one thread while you're accessing it from another

Re: How to create Custom Knobs with Sprite animation ?

2008-06-15 Thread Graham Cox
On 16 Jun 2008, at 7:54 am, David Paulicke wrote: Ok , I want to create a Custom GUI and don´t want to use the prebuild Cocoa Controls ( Sliders , Knobs , buttons ) . Instead i want to use my own Knobs/Sliders i´ve drawed myself . OK, probably a bad idea but don't let me stop you. I wa

Re: NSOutlineView threading problem

2008-06-15 Thread Bill Bumgarner
On Jun 15, 2008, at 8:05 PM, David wrote: On Sun, Jun 15, 2008 at 8:46 PM, Bill Bumgarner <[EMAIL PROTECTED]> wrote: I would highly recommend that you look long and hard at how are you are managing the data structures that are also used by NSOutlineView. In particular, if you are futzing wit

Re: Initializing font size in UITextField

2008-06-15 Thread Omar Qazi
On Jun 15, 2008, at 3:30 PM, Mike Westerfield wrote: I'm trying to set the font size in a UITextField that is created using Interface Builder in the iPhone SDK. I'm new to Cocoa, so there may be something obvious I'm missing. The first attempt was to set the Min Size from Interface Builder

Re: Custom NSMenu

2008-06-15 Thread Graham Cox
I think the short answer is: you can't (in Cocoa). This has always been a bit tricky to implement, going right back to the original Mac OS c. 1984. While a pop-up is down and tracking it is handling its own event loop so is probably ignoring mouseEntered: and mouseExited: events. If your me

Re: NSOutlineView threading problem

2008-06-15 Thread David
On Sun, Jun 15, 2008 at 8:46 PM, Bill Bumgarner <[EMAIL PROTECTED]> wrote: > I would highly recommend that you look long and hard at how are you are > managing the data structures that are also used by NSOutlineView. In > particular, if you are futzing with an NSMutableArray from one thread while

NSTableView problems when 0 items

2008-06-15 Thread Kiel Gillard
Howdy, Are there any messages in your Run Log or in Console that might help you figure out the problem? Can you verify the table data source method implementations are returning the right values? Kiel I have an NSTableView object and an NSPopUpButton that I use to select a > category of informati

NSTableView problems when 0 items

2008-06-15 Thread Christopher J Kemsley
I have an NSTableView object and an NSPopUpButton that I use to select a category of information to display in the table... The problem is this: If I select a category with 0 items in it, the table view will update as expected... but, if I select one with more than one item right afterward

Re: Still trying to refactor a category as a class

2008-06-15 Thread Paul Archibald
Wow, Ken, thank you for such a thoughtful and detailed response. I need to read it a few more times to understand it better, but it has been very useful already. I recognize a couple of points were I might have gone astray in my first try. Oh, and thanks for your second response, too. For

Re: Issue with displaying URI prefixes on child elements using NSXML

2008-06-15 Thread Chris Suter
On 12/06/2008, at 6:54 PM, Nathan Kinsinger wrote: I'm curious about what using elementWithName:URI: is supposed to do when you don't pass a qualified name in, or rather, why have it at all? The URI seems to be redundant if you are already passing the qualified name in. Just as a test (f

Re: NSOutlineView threading problem

2008-06-15 Thread Bill Bumgarner
On Jun 15, 2008, at 2:36 PM, David wrote: What I thought I was doing seems to be working. I am able to run a secondary thread, adding nodes to the tree I'm displaying in the primary thread. All problems appear to have been resolved. No need for locking or any other magic. I think folks are

Re: How can an object know when another object has gone away?

2008-06-15 Thread James W. Walker
On Jun 15, 2008, at 4:04 PM, Hamish Allan wrote: On Sun, Jun 15, 2008 at 11:20 PM, James W. Walker <[EMAIL PROTECTED]> wrote: Here's my specific situation. I have several controllers that can create tasks, using an NSTask wrapper based on the Moriarty sample. When a task completes, it

Re: looking for a crc code

2008-06-15 Thread Chris Suter
On 15/06/2008, at 3:49 AM, Michael Hall wrote: On Jun 14, 2008, at 10:25 AM, Jens Alfke wrote: On 14 Jun '08, at 4:59 AM, Ilan Volow wrote: No mention at all I can find (in the 20 seconds I scanned the first two result pages) of any cocoa CRC implementations. If a newbie were to do a sea

[Moderator] List Guidelines - MUST READ

2008-06-15 Thread Scott Anguish
Please stay on-topic There are currently more than 4000 subscribers to this list and several hundred messages posted per day. In order to keep the list useful please stay on topic and stick to technical discussion. Cocoa-dev should not be the first place you turn when y

[Moderator] Re: iPhone SDK build of default application fails

2008-06-15 Thread Scott Anguish
Discussion of the iPhone SDK is NOT allowed in public. From the list guidelines Discussing NDA Projects (Snow Leopard and iPhone OS) and Private API This list is not an appropriate forum for the discussion of issues that ar

Re: knowing when WebView is done

2008-06-15 Thread Timothy Ritchey
Many thanks to Adam for his code, which helped to trim down the way WebKit was working for me, especially the bits about turning off JavaScript, etc. Also, to Keary for walking through the backtrace. In order to keep the memory footprint of my application down, I decided to use a helper app

Re: How can an object know when another object has gone away?

2008-06-15 Thread Hamish Allan
On Sun, Jun 15, 2008 at 11:20 PM, James W. Walker <[EMAIL PROTECTED]> wrote: > Here's my specific situation. I have several controllers that can create > tasks, using an NSTask wrapper based on the Moriarty sample. When a task > completes, it sends a message to the controller that created it. I

Re: How can an object know when another object has gone away?

2008-06-15 Thread James W. Walker
On Jun 15, 2008, at 3:25 PM, Andreas Monitzer wrote: On Jun 16, 2008, at 00:20, James W. Walker wrote: Is there a standard Cocoa design pattern or idiom to have an object find out when another object has been destroyed? In PowerPlant, I'd use LBroadcaster and LListener, with the listener

Re: Initializing font size in UITextField

2008-06-15 Thread Kyle Sluder
On Sun, Jun 15, 2008 at 6:30 PM, Mike Westerfield <[EMAIL PROTECTED]> wrote: > I'm trying to set the font size in a UITextField that is created using > Interface Builder in the iPhone SDK. I'm new to Cocoa, so there may be > something obvious I'm missing. Well, you're certainly forgetting about th

Re: Initializing font size in UITextField

2008-06-15 Thread Dave Camp
On Jun 15, 2008, at 3:30 PM, Mike Westerfield wrote: I'm trying to set the font size in a UITextField that is created using Interface Builder in the iPhone SDK. I'm new to Cocoa, so there may be something obvious I'm missing. The first thing you are missing is that the SDK is under NDA and

Initializing font size in UITextField

2008-06-15 Thread Mike Westerfield
I'm trying to set the font size in a UITextField that is created using Interface Builder in the iPhone SDK. I'm new to Cocoa, so there may be something obvious I'm missing. The first attempt was to set the Min Size from Interface Builder. This does not appear to do anything. I then attemp

Re: How can an object know when another object has gone away?

2008-06-15 Thread Andreas Monitzer
On Jun 16, 2008, at 00:20, James W. Walker wrote: Is there a standard Cocoa design pattern or idiom to have an object find out when another object has been destroyed? In PowerPlant, I'd use LBroadcaster and LListener, with the listener listening for msg_BroadcasterDied. What about using

How can an object know when another object has gone away?

2008-06-15 Thread James W. Walker
Is there a standard Cocoa design pattern or idiom to have an object find out when another object has been destroyed? In PowerPlant, I'd use LBroadcaster and LListener, with the listener listening for msg_BroadcasterDied. Here's my specific situation. I have several controllers that can

Re: NSMutableAttributedString's setBaseWritingDirection problem

2008-06-15 Thread Dmitry Markman
indeed thanks a lot it works now On Jun 15, 2008, at 5:13 PM, Ken Thomases wrote: On Jun 15, 2008, at 3:57 PM, Dmitry Markman wrote: Hi, all I have a problem with the NSMutableAttributedString's setBaseWritingDirection method here is a code NSMutableAttributedString *attrStrin

Re: When is a document moved or renamed?

2008-06-15 Thread Uli Kusterer
Am 13.06.2008 um 23:11 schrieb Andy Mroczkowski: My solution/workaround was to keep track of the slave document's URL myself, and hijack NSDocument's save facility at a high level by overriding: I think the 'correct', i.e. most robust solution here would be to use an Alias to store the r

Re: NSOutlineView threading problem

2008-06-15 Thread David
Thanks for the responses. I've SOLVED IT. WooHoo! What I thought I was doing seems to be working. I am able to run a secondary thread, adding nodes to the tree I'm displaying in the primary thread. All problems appear to have been resolved. No need for locking or any other magic. I think folks are

Re: NSNotifications & background apps?

2008-06-15 Thread Andrew Farmer
On 15 Jun 08, at 03:18, dreamcat7 wrote: - yes, thank you i have had a look. Its copyright of Tildesoft under creative commons 1.0 liscence. So i must attribude the following (1) line of sourcecode to Tildesoft under the http://creativecommons.org/licenses/by/1.0/ And likely that the Meow too

Re: Read PSD-Layers with NSImage

2008-06-15 Thread Scott Andrew
I believe Image IO isn't PSD layer aware. However the API is Tiff layer aware. Scott On Jun 14, 2008, at 11:41 PM, Mike Abdullah wrote: As far as I am aware, Cocoa only supports drawing of PSD images; you can't access the individual layers. To do any more, you probably have to drop down t

Re: Automatically Call a Function

2008-06-15 Thread Philip Lee Bridson
Actually no I didn't. Now it works fine, in my frustration that was something I hadn't even considered that I get wrong. Thanks for the reply. Phil. On 15 Jun 2008, at 22:16, Ken Thomases wrote: On Jun 15, 2008, at 3:59 PM, Philip Lee Bridson wrote: -(void)applicationDidFinishLaunching:(

Re: Automatically Call a Function

2008-06-15 Thread Ken Thomases
On Jun 15, 2008, at 3:59 PM, Philip Lee Bridson wrote: -(void)applicationDidFinishLaunching:(NSNotification *)notification { printf("In Delegate method.\n"); //DEBUG winCtrl = [[NSWindowController alloc] initWithWindowNibName:@"Window"]; [winCtrl showWindow:self];

Re: NSMutableAttributedString's setBaseWritingDirection problem

2008-06-15 Thread Ken Thomases
On Jun 15, 2008, at 3:57 PM, Dmitry Markman wrote: Hi, all I have a problem with the NSMutableAttributedString's setBaseWritingDirection method here is a code NSMutableAttributedString *attrString = [[[NSAttributedString alloc] initWithString:textString attributes:stringAttribute

Re: looking for a crc code

2008-06-15 Thread Ilan Volow
Python's zlib module has crc32 e.g. import zlib zlib.crc32("Wish things were this easy in Cocoa") -- Ilan On Jun 15, 2008, at 3:19 AM, Jason Coco wrote: There is: uLong crc32(uLong crc, const Bytef *buf, uInt len); On Jun 14, 2008, at 20:04 , Michael Vannorsdel wrote: I thought I saw a

Re: Using a Core Data relationship binded to an NSTokenField

2008-06-15 Thread Orestis Markou
Hi, after some experimentation, I have this Obj-C class that tries to do the minimal thing: @implementation OMSetToArrayValueTransformerOBJC + (Class) transformedValueClass { return [NSMutableArray class]; } + (BOOL) allowsReverseTransformation { return YES; } - (id) transformedVal

Re: Automatically Call a Function

2008-06-15 Thread Philip Lee Bridson
Hi There, I used the notification like suggested and I still cannot display my window. This is my code: -(void)applicationDidFinishLaunching:(NSNotification *)notification { printf("In Delegate method.\n"); //DEBUG winCtrl = [[NSWindowController alloc] initWithWindow

NSMutableAttributedString's setBaseWritingDirection problem

2008-06-15 Thread Dmitry Markman
Hi, all I have a problem with the NSMutableAttributedString's setBaseWritingDirection method here is a code NSMutableAttributedString *attrString = [[[NSAttributedString alloc] initWithString:textString attributes:stringAttributes] autorelease]; NSRange attrStringRange =

XML-RPC call using Cocoa Frameworks

2008-06-15 Thread Kevin McQuown
What is the easiest framework to use so that my application can make a synchronous call to another server on the web. As an example, this server is waiting to receive an xml request which looks like the following: - sample.sumAndDifference - - - - 3 - - - 11 I know how t

Re: Converting to NSPersistentDocument

2008-06-15 Thread Hamish Allan
On Sun, Jun 15, 2008 at 11:42 AM, Steven Hamilton <[EMAIL PROTECTED]> wrote: > I've been a busy bee learning Cocoa and core data (as my frequent postings > may reveal) and now I wish to add NSPersistentDocument functionality. I > started my project using the normal Core Data template so how do I c

Re: NSNotifications & background apps?

2008-06-15 Thread Hamish Allan
On Sat, Jun 14, 2008 at 8:52 PM, dream cat7 <[EMAIL PROTECTED]> wrote: > Seeing notifications from outside: > [...] > Sometimes 2 process are > communicating And one of them is launching / closing multiple times during > the session (e.g. sending kill message as NSNotification). You refer to NSNo

Re: iPhone SDK build of default application fails

2008-06-15 Thread Stephen J. Butler
On Sun, Jun 15, 2008 at 1:32 PM, Edward Kenworthy <[EMAIL PROTECTED]> wrote: > Hopefully someone can help me :) No, we can't, because everything iPhone related is under the NDA you accepted when you downloaded the kit. You'll have to file a radar bug or contact DTS. ___

iPhone SDK build of default application fails

2008-06-15 Thread Edward Kenworthy
Hopefully someone can help me :) I've just downloaded and installed the iPhone SDk, run up Xcode, File- >New and created several of the template applications. In each case I click Build & Go... and nothing. The status bar says it's building but it spends forever building (doing nothing). (I'

Re: Automatically Call a Function

2008-06-15 Thread Marcel Weiher
On Jun 15, 2008, at 10:09 , Philip Lee Bridson wrote: Firstly I need a function to automatically run from a class used in MainMenu.nib when the main.m calls NSApplicationMain(); The NSApplication object provides this facility: http://developer.apple.com/documentation/Cocoa/Reference/Applica

Re: Automatically Call a Function

2008-06-15 Thread Stephen J. Butler
On Sun, Jun 15, 2008 at 12:09 PM, Philip Lee Bridson <[EMAIL PROTECTED]> wrote: > I have tried to put the function in awakeFromNib but then the window wont > close itself from that function. I have also tried putting my first window > before the call to NSApplicationMain but then the application cr

Re: Could kEventAppSystemUIModeChanged arrive too early to my handler

2008-06-15 Thread Jean-Daniel Dupas
Le 15 juin 08 à 18:15, Mohsan Khan a écrit : Hi I'm trying to handle when some other app changes to fullscreen by handling the kEventAppSystemUIModeChanged event. The event handler is called but then when I check if the menu bar is visibe I get TRUE! So I figured, either the apps I'm t

Re: Static Functions and Variables

2008-06-15 Thread Jean-Daniel Dupas
Le 15 juin 08 à 17:38, Jason Stephenson a écrit : Whoops! Had a brain fart. In my previous message where I say @interface, I meant to say @implemenation. Sorry for any confusion. Got too much going on today. I should have just stayed away from email. --Jason In Obj-C, the concept of

Automatically Call a Function

2008-06-15 Thread Philip Lee Bridson
Hi there - sorry this is actually two questions in one. Firstly I need a function to automatically run from a class used in MainMenu.nib when the main.m calls NSApplicationMain(); Also, I cannot figure out why when I initialize a window from a nib or from a file before the call to NSApplic

Could kEventAppSystemUIModeChanged arrive too early to my handler

2008-06-15 Thread Mohsan Khan
Hi I'm trying to handle when some other app changes to fullscreen by handling the kEventAppSystemUIModeChanged event. The event handler is called but then when I check if the menu bar is visibe I get TRUE! So I figured, either the apps I'm testing fullscreen mode with (VLC, Photoshop) d

Re: Static Functions and Variables

2008-06-15 Thread Jason Stephenson
Whoops! Had a brain fart. In my previous message where I say @interface, I meant to say @implemenation. Sorry for any confusion. Got too much going on today. I should have just stayed away from email. --Jason ___ Cocoa-dev mailing list (Cocoa-dev@l

Static Functions and Variables

2008-06-15 Thread Jason Stephenson
My question is: Does it make a difference if I put static functions and variables inside or outside of my Class' @interface? I tend to treat them like C functions and variables and place them at the top of my source (.m) file, before the @interface declaration. When it comes to static funct

Re: How to disconnect bound views temporarily

2008-06-15 Thread Andy Mroczkowski
Hi Markus, I'm guessing that your NSArrayController is in the nib itself. One thing you could do is instantiate it programmatically and set it as an ivar of some other controller class in the nib (lets call it MyWindowController). Then bind the views to the MyWindowController.arrayContr

Custom NSMenu

2008-06-15 Thread Marco Cassinerio
I've to build e custom menu like this: | "menu item 1" | "menu item 2" | "menu item 3" | Every menu item is a NSPopUpMenu's subclass with a custom image displayed. When the user left-click on a menu item a PopUpMenu is displayed. What i would is let the user to left-click and move mouse over

NSNumberFormatterPercentStyle flakiness

2008-06-15 Thread Aron Nopanen
Hi, I've noticed some odd behavior with NSNumberFormatterPercentStyle in NSNumberFormatter (on Leopard 10.5.3). Attempting to translate an invalid string to a number causes subsequent number-to-string conversions to give invalid results. 'Invalid results' can be more accurately defined

Re: Trying to install kEventAppSystemUIModeChanged using NSAppleEventManager.

2008-06-15 Thread Jean-Daniel Dupas
Le 15 juin 08 à 13:25, Mohsan Khan a écrit : Hi I'm trying to to install kEventAppSystemUIModeChanged using NSAppleEventManager, so that my app will know when the menubar & dock is hidden i.e. some other app enters fullscreen mode. I've tried entering fullscreen mode using VLC and Photos

Trying to install kEventAppSystemUIModeChanged using NSAppleEventManager.

2008-06-15 Thread Mohsan Khan
Hi I'm trying to to install kEventAppSystemUIModeChanged using NSAppleEventManager, so that my app will know when the menubar & dock is hidden i.e. some other app enters fullscreen mode. I've tried entering fullscreen mode using VLC and Photoshop. handleAppleEvent is never called because t

Converting to NSPersistentDocument

2008-06-15 Thread Steven Hamilton
G'day!, I've been a busy bee learning Cocoa and core data (as my frequent postings may reveal) and now I wish to add NSPersistentDocument functionality. I started my project using the normal Core Data template so how do I change my program to use the NSPersistentDocument model instead of

Re: NSNotifications & background apps?

2008-06-15 Thread dreamcat7
On 14 Jun 2008, at 22:27, Nathan Kinsinger wrote: I haven't seen "Meow" but there is a Notification Watcher project (with source) at: http://www.tildesoft.com/Programs.html It may do what you need, or you could extend it to do so. --Nathan - yes, thank you i have had a look. Its copyrig

Re: looking for a crc code

2008-06-15 Thread Andreas Mayer
I've got some old CRC code lying around. Don't know if it's Intel/64bit clean though. Maybe someone want's to check? :) // // NSData_CRC.h // // CRC algorithms for 16, 32 and 64 bit widths // // Put together by Arne Schween, Peter N. Lewis, Matthew Dillon and Thomas Tempelmann // // Be aw

Re: argument checks

2008-06-15 Thread Chris Suter
On 12/06/2008, at 10:01 PM, Graham Cox wrote: But maybe the original point is getting lost? You asserted (pardon the pun) that passing a nil argument was never acceptable My exact words were: “it’s often not safe to pass nil objects as arguments” and I stand by that. I raised the point bec

How to disconnect bound views temporarily

2008-06-15 Thread Markus Spoettl
Hi List, I have a document window that can show the same data in more than one way, very much like Finder, one view mode is an outline, the other is a collection. Both are bound to the same data, so they reflect changes automatically. I was wondering if there is some way to tell a contr

Re: looking for a crc code

2008-06-15 Thread Jason Coco
There is: uLong crc32(uLong crc, const Bytef *buf, uInt len); On Jun 14, 2008, at 20:04 , Michael Vannorsdel wrote: I thought I saw a CRC32 implementation in zlib at one time. On Jun 14, 2008, at 9:25 AM, Jens Alfke wrote: On 14 Jun '08, at 4:59 AM, Ilan Volow wrote: No mention at all I c