CSWeekView classes available

2009-12-21 Thread David Hirsch
A little while ago I posted a query here asking if anybody knew of a Cocoa class to create a weekly calendar, somewhat like the iCal week view. Although there were a couple of promising replies, I decided to roll my own, "CSWeekView". I've released it on GitHub under the LGPL. For my program'

Re: iCal-like display class (week)?

2009-12-17 Thread David Hirsch
move or resize. >> >> It currently only has a single day view, but it might be a starting point. >> If you're interested, I'd be happy to share the code with you. >> >> Cheers, >> Jim >> >> >> >> >> On Dec 17, 2009, a

iCal-like display class (week)?

2009-12-17 Thread David Hirsch
Does anybody know of some Cocoa classes that would allow me to mimic the week view shown by iCal? I've looked around for such a thing online without success. Also, in case there are none out there in the wild: I'm looking for some pointers on how to implement this weekly calendar view. Here ar

Re: Error on third opening of preferences window

2009-12-15 Thread David Hirsch
Ah, I see. Strange that this would be the default behavior. -Dave On Dec 15, 2009, at 11:07 AM, Markus Spoettl wrote: On Dec 15, 2009, at 8:02 PM, David Hirsch wrote: The same behavior happens in a non-document-based app. Did you switch off "Release When Closed" for the window

Error on third opening of preferences window

2009-12-15 Thread David Hirsch
Okay, all: can somebody explain this error to me? The debugger isn't much help and the problem is not in my code (because I can reproduce this without writing any code!). 1) Make a new document-based cocoa project in XCode. 2) Open MainMenu.xib in IB, add a new blank window. Set the window

Re: Problem with properties and setters; also:Surprising behavior of NSMutableArray - makes spontaneous copy

2009-12-14 Thread David Hirsch
f the error. -Dave On Dec 14, 2009, at 3:01 PM, David Hirsch wrote: (After drafting the first version of this email, I found a sort-of solution, but I do not understand why it works. I thought that simple properties (e.g., object.foo) essentially just called the foo:/setFoo: methods, particu

Problem with properties and setters; also:Surprising behavior of NSMutableArray - makes spontaneous copy

2009-12-14 Thread David Hirsch
(After drafting the first version of this email, I found a sort-of solution, but I do not understand why it works. I thought that simple properties (e.g., object.foo) essentially just called the foo:/setFoo: methods, particularly if you used @property (assign). That is apparently not the

Does initWithCoder re-create observers made with addObserver?

2009-12-03 Thread David Hirsch
I'm trying to track down a bug. The subject says it all: If I've created an observer programatically, then saved both the observed and observer objects with encodeObject:forKey:, will decodeObjectForKey recreate that observer for me, or do I need to do it myself? __

Re: Key path help for complex binding

2009-12-02 Thread David Hirsch
This is quite helpful, Quincey, but one thing you wrote surprises me: If you have a simple 'int' property backed by a single 'int' instance variable, changing the variable directly in your class implementation will not generate any KVO notifications. Changing the *property* -- which in that

Re: Key path help for complex binding

2009-12-02 Thread David Hirsch
Dec 2, 2009, at 4:17 AM, Quincey Morris wrote: On Dec 1, 2009, at 16:19, David Hirsch wrote: The problem is, when I add a new Room to the master rooms array, and then add that room to the roomCosts array of each Course's roomConstraint, the table column doesn't get updated, unt

Re: Key path help for complex binding

2009-12-01 Thread David Hirsch
-Dave On Dec 1, 2009, at 4:19 PM, David Hirsch wrote: First thanks for all the help to date. I'm learning a great deal. The current problem: I have a model for which I cannot seem to figure out the correct key paths for binding. My doc has a rooms array (of Rooms) and a courses a

Key path help for complex binding

2009-12-01 Thread David Hirsch
First thanks for all the help to date. I'm learning a great deal. The current problem: I have a model for which I cannot seem to figure out the correct key paths for binding. My doc has a rooms array (of Rooms) and a courses array (with NSArrayControllers). Each course has a roomConstraint

Re: What to subclass in NSArrayController to enable immediate editing of added rows?

2009-12-01 Thread David Hirsch
m in for the sake of docs-obedience anyhow. Thanks for the help. -Dave On Dec 1, 2009, at 2:05 PM, Sean McBride wrote: On 12/1/09 1:51 PM, David Hirsch said: Well, that is a nice bit of code to have, but it doesn't really address the issue. As I wrote in my original post, there are a nu

Re: What to subclass in NSArrayController to enable immediate editing of added rows?

2009-12-01 Thread David Hirsch
to be selected?) -Dave On Dec 1, 2009, at 1:44 PM, Sean McBride wrote: On 11/30/09 7:57 PM, David Hirsch said: I'm trying to have my table immediately enable editing of added items. I have a handy NSTableView category to do that: - (void)makeEditableSelectedCellOfColumn

What to subclass in NSArrayController to enable immediate editing of added rows?

2009-11-30 Thread David Hirsch
I have read about this online, but I can't find a solution that (a) works and (b) seems wise. I'm trying to have my table immediately enable editing of added items. The NSTableView is bound to an NSArrayController. I've subclassed NSArrayController, and tried this first: - (void)add:(id)s

Re: I can't supply document reference to (init) with bindings, can I?

2009-11-29 Thread David Hirsch
oblem. Thanks, -Dave On Nov 29, 2009, at 4:54 PM, Graham Cox wrote: On 30/11/2009, at 10:31 AM, David Hirsch wrote: I'm trying to use bindings as much as possible, but I think I need to do this with actions & outlets. I have a NSArrayController (courseController) managing an

I can't supply document reference to (init) with bindings, can I?

2009-11-29 Thread David Hirsch
I'm trying to use bindings as much as possible, but I think I need to do this with actions & outlets. I have a NSArrayController (courseController) managing an NSMutableArray (courses) of Course objects. In order to correctly initialize each Course, I need to have data from other arrays (

Is there a key path for this?

2009-11-28 Thread David Hirsch
I want to know if I can do this with bindings or not. I've read a good deal, and tried a few things without success. My document class has an array of Instructors, with a controller. Each instructor has a timeConstraint, which in turn has an array of NSNumbers. I have an NSTableView boun

Re: Drawing: The Right place to keep bounds

2009-11-25 Thread David Hirsch
I think you are missing the point of the quote, which is that drawing programs are an exception to the typical rule that view data must be strictly separated from the model ("However, in this case"). When the model data is all about visual information (drawing), then you have no choice but

Multiple nibs for this application?

2009-11-24 Thread David Hirsch
I am starting to write a course-instructor-room scheduling application with a number of separate lists (e.g., courses, rooms, instructors), each of which will be fairly short, but might have quite a few fields. The main application window will be trivial - a set of buttons, each of which o

Should I learn CoreData for this project?

2009-11-03 Thread David Hirsch
So, I'm hearing folks sing the praises of CoreData, which I have not yet learned. It seems like a long uphill climb, but if life will be spectacular afterwards, I'll do it. I am a semi-casual programmer; I've just finished a couple of small programs that do not use CoreData, and I can see

Re: Undo architecture advice needed

2009-10-09 Thread David Hirsch
they arrive at the phase object (typically in a setter). And this is the place to record the information needed for undoing the change. Hope this makes any sense Kai On 9.10.2009, at 19:53, David Hirsch wrote: Hello list- I have a document-based application. Each document has a NSArray of p

Undo architecture advice needed

2009-10-09 Thread David Hirsch
Hello list- I have a document-based application. Each document has a NSArray of phases. Phases is an NSArrayController created in IB and bound to FIle's Owner.phases. When a given phase is selected in the NSTableView (bound to phase controller), then its properties show up in a set of

[Solved] Re: "remote" binding problem

2009-10-06 Thread David Hirsch
find their error in the future. Note that I was thus incorrect: binding works through accessors, apparently. This was not clear from the docs I had read. -Dave On Oct 6, 2009, at 8:21 PM, Graham Cox wrote: On 07/10/2009, at 2:12 PM, David Hirsch wrote: I would strongly recommend a pro

Re: "remote" binding problem

2009-10-06 Thread David Hirsch
On Oct 6, 2009, at 7:56 PM, Graham Cox wrote: In Interface Builder, I would like to bind a text field to the current score. When I set up the text field value's binding to File's Owner.quizResults.currentScore, the app crashes inside loadNib (inside NSPopAutoreleasePool). Is that expect

"remote" binding problem

2009-10-06 Thread David Hirsch
Hello list- Here is part of my app: @interface ModeQuizDoc : NSDocument { QuizResults *quizResults; } @implementation ModeQuizDoc - (id)init { self = [super init]; if (self) { quizResults = [[[QuizResults alloc] init] retain]; } } @interface QuizResults : NS

Re: [Solved] Re: NSTableView: no display until header clicked

2009-10-05 Thread David Hirsch
NSArrayController has things like insert: or add: -Dave On Oct 5, 2009, at 10:36 AM, Kyle Sluder wrote: On Oct 5, 2009, at 10:26 AM, David Hirsch wrote: I (now) realize that I could use the arrayController to populate the array, but retaining my direct array manipulation and doing the

Re: [Solved] Re: NSTableView: no display until header clicked

2009-10-05 Thread David Hirsch
even without these two lines - how are you populating the array controller in code ? Am 05.10.2009 um 19:19 schrieb David Hirsch: That's right on the money: The array was indeed bound to the contentArray in IB (otherwise it would never have been able to show any data), but I need

[Solved] Re: NSTableView: no display until header clicked

2009-10-05 Thread David Hirsch
y controller in a non KVO way... but still, w/o code not to be discussed. Cheers, Volker Am 05.10.2009 um 18:47 schrieb David Hirsch: Thanks, Volker. rearrangeObjects did work, but I don't understand why that call should be necessary. If anybody out there wants to educate me, I&#x

Re: NSTableView: no display until header clicked

2009-10-05 Thread David Hirsch
single [NSArrayController rearrangeObjects] call or similar. Volker Am 05.10.2009 um 18:32 schrieb David Hirsch: My window has two NSTableViews. Each has two columns, each of which is bound to a field in Phases, an NSArrayController. When my window is displayed, I calculate my model, and th

NSTableView: no display until header clicked

2009-10-05 Thread David Hirsch
My window has two NSTableViews. Each has two columns, each of which is bound to a field in Phases, an NSArrayController. When my window is displayed, I calculate my model, and the NSTableViews show the headers, but blank data cells. However, when I click the header of one table, all four

[Enigmatic semi-solution] Re: Cannot get pixel color from NSBitmapImageRep

2009-10-01 Thread David Hirsch
Well, I can work around it but I don't understand this at all. Apparently the context is flipped, or getPixelAtX:y: is flipped, or something. In this code, the first NSLog statement gives all zeros, and the second gives the intended red color. However flipped returns NO. Any ideas as to

Re: Cannot get pixel color from NSBitmapImageRep

2009-10-01 Thread David Hirsch
Jonathan, Dave- Nothing works yet. Dave's NSLog statement prints "NSCalibratedRGBColorSpace 0 0 0 0", and restoring the graphics context does not help the problem. Still stumped. -Dave This is just as guess, but perhaps there's an issue with the drawing not being completed and flushed ba

Cannot get pixel color from NSBitmapImageRep

2009-10-01 Thread David Hirsch
In the code below, the TIFF gets saved correctly (transparent but for the red square), but when I query the pixel at (40,40) which should be in the middle of the red square, I get a black pixel (r==g==b==a==0.0): offscreenRep = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:nil

Accessor works intermittently

2009-09-30 Thread David Hirsch
I cannot figure out why this does not work: Phase *thisPhase = [phases objectAtIndex:i]; float testmode = [thisPhase mode]; float testmode2 = [[phases objectAtIndex:i] mode]; Following along with the code execution in the debugger, testmode gets