KVO Setting a flag for any property change

2011-12-14 Thread Andre Masse
in -observeValueForKeyPath. Both approach involve a lot of boilerplate coding (some subclasses have 20+ properties). I thought about using -keyPathsForValuesAffectingModified: but I don't see how I can set a flag using this. Any ideas? Thanks, Andre Masse

Re: KVO Setting a flag for any property change

2011-12-14 Thread Andre Masse
Clever! Thanks for the suggestion. Andre Masse Keary Suska mailto:cocoa-...@esoteritech.com December 14, 2011 10:56 This kind of approach is probably best unless you can base your superclass on NSManagedObject, which does this automatically. But, as you find, there is some difficulty. I

Re: KVO Setting a flag for any property change

2011-12-14 Thread Andre Masse
Thanks for pointing this out. Andre Masse Keary Suska mailto:cocoa-...@esoteritech.com December 14, 2011 21:03 On Dec 14, 2011, at 3:21 PM, Andre Masse wrote: Clever! Thanks for the suggestion. You probably figured this out but for prosperity there needs to be an observer

View based NSTableView and NSArrayController not in sync

2011-10-11 Thread Andre Masse
selectNext/selectPrevious (I have buttons for this in the detail view) doesn't change the selection in the tableView (but is in sync with the model). Am I missing something obvious here? Thanks, Andre Masse ___ Cocoa-dev mailing list (Cocoa-dev

Re: View based NSTableView and NSArrayController not in sync

2011-10-11 Thread Andre Masse
That's it!! Thanks a lot, Andre Masse ___ 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-admins(at)lists.apple.com Help/Unsubscribe/Update

Re: Validating form input w/o core data

2011-09-28 Thread Andre Masse
:@+-*/.]; NSCharacterSet *inStringSet = [NSCharacterSet characterSetWithCharactersInString:*partialStringPtr]; if ([alphaNums isSupersetOfSet:inStringSet]) { return YES; } return NO; } Cheers, Andre Masse Graham Cox

Re: Validating form input w/o core data

2011-09-28 Thread Andre Masse
It's in NSFormatter. You just override it in your subclass. Cheers, Andre Masse William Squires mailto:wsqui...@satx.rr.com September 28, 2011 20:48 Okay, but where does the code go? Is this a delegate method

Printing exception on Lion

2011-09-07 Thread Andre Masse
Hi, I'm trying to implement printing in my application. I was following Aaron Hillegass book (Cocoa Programming for Mac OS X, chap 27) and while it does print, I got an exception. So, I downloaded the examples on the book's site

Re: Printing exception on Lion

2011-09-07 Thread Andre Masse
Thank you all for your replies. Yes, my bad. This is an error log, not an exception. Glad to know its a known issue though. Thanks, Andre Masse On 07/09/2011, at 12:24 , Raleigh Ledet wrote: This is a known problem, but it shouldn't be throwing an exception. It's just logging an error

Need help for data validation

2011-08-16 Thread Andre Masse
missing something obvious? Thanks, Andre Masse ___ 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-admins(at)lists.apple.com Help/Unsubscribe

Re: Need help for data validation

2011-08-16 Thread Andre Masse
Answering my own question: Read the documentation on: - (BOOL)control:(NSControl *)control textShouldEndEditing:(NSText *)fieldEditor Cheers, Andre Masse On 16/08/2011, at 12:21 , Andre Masse wrote: Hi, I need to validate input when the user enters data on a particular cell (caseNumber

Re: Strategies for reusing NSPopover

2011-08-13 Thread Andre Masse
the framework try to present a sheet displaying the error. -[NSPopoverFrame titlebarRect]: unrecognized selector sent to instance 0x102075780 Of course, popovers don't have titlebars... Andre Masse ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please

NSPopover and interface ideas

2011-08-12 Thread Andre Masse
things around in the view to make room for it. Not sure how or if this can be done. Also, the main window is using most of the screen so, I can't just resize the window. I've search the web for master/detail interface ideas without too much success. Any suggestions, ideas? Thanks, Andre Masse PS

Re: Drawing text like Lion's Mail

2011-08-08 Thread Andre Masse
Seems like a lot of work for a simple effect. I may play again with this later on this project. I have save this thread in Mail which is telling me that there's 20 messages selected using its fancy font effect :-) Thanks for all infos guys, Andre Masse On 08/08/2011, at 13:29 , David Duncan

Re: Drawing text like Lion's Mail

2011-08-07 Thread Andre Masse
For those interested, Matt and Kyle were right. Helvetica Neue Bold 20pts. All my attempts to replicate the shadow have failed though. I'm using 85% white and it's good enough for me. Thanks to all, Andre Masse ___ Cocoa-dev mailing list (Cocoa

Re: Drawing text like Lion's Mail

2011-08-07 Thread Andre Masse
. Feel free to email it to me directly. Thanks, Andre Masse On 07/08/2011, at 14:12 , Siegfried wrote: On 07/08/2011, at 10:52, Andre Masse wrote: For those interested, Matt and Kyle were right. Helvetica Neue Bold 20pts. All my attempts to replicate the shadow have failed though. I'm using

Drawing text like Lion's Mail

2011-08-03 Thread Andre Masse
? Thanks, Andre Masse ___ 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-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http

Re: Drawing text like Lion's Mail

2011-08-03 Thread Andre Masse
for your help, Andre Masse On 03/08/2011, at 16:51 , Jens Alfke wrote: You can draw it in one pass using NSShadowAttributeName. —Jens ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments

Re: Drawing text like Lion's Mail

2011-08-03 Thread Andre Masse
Thanks but after having done 10+ screenshots and doing side by side comparisons, it clearly isn't Lucida Grande. It's very close to Helvetica but the kerning is different. Andre Masse On 03/08/2011, at 17:52 , Thomas Davie wrote: No – it's using the system font – Lucida Grande. Bob

Re: Drawing text like Lion's Mail

2011-08-03 Thread Andre Masse
:-) Thanks, Andre Masse On 03/08/2011, at 18:41 , Kyle Sluder wrote: Helvetica Neue? It's very clearly not Lucida Grande. --Kyle Sluder ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments

Re: Drawing text like Lion's Mail

2011-08-03 Thread Andre Masse
Think I could be close if I could turn off anti-aliasing. Is there any way to do that in -drawRect ? Thanks, Andre Masse ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list

Re: Drawing text like Lion's Mail

2011-08-03 Thread Andre Masse
Forget that last one. Found how and it's worst :-) Andre Masse PS: if anybody want that, here's how: CGContextRef context = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort]; CGContextSetShouldAntialias(context, NO); On 03/08/2011, at 20:10 , Andre Masse wrote: Think I could

Re: Drawing text like Lion's Mail

2011-08-03 Thread Andre Masse
I've downloaded it and looks like it works on Lion. Never used it, so I may have to spend some time looking at tutorials. Thanks for the suggestion, Andre Masse On 03/08/2011, at 22:02 , Andy Lee wrote: Does F-Script Anywhere work on Lion? Maybe you can inspect the view and find a clue

Re: Calculations in a tableview

2011-07-30 Thread Andre Masse
function is to sort and filter the model array property. It has no role in sourcing actual data to your table. This was the key! Thanks again, Andre Masse ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests

NSNumberFormatter documentation error?

2011-07-30 Thread Andre Masse
a bug on radar? Thanks, Andre Masse ___ 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-admins(at)lists.apple.com Help/Unsubscribe/Update your

Re: NSNumberFormatter documentation error?

2011-07-30 Thread Andre Masse
Thanks for the clarification. Andre Masse It's not a matter of misinterpretation per se. The documentation reflects the API, and would apply only to objects you create in your own code. Interface Builder may choose to have its own defaults for objects created by it, and those choices

Calculations in a tableview

2011-07-28 Thread Andre Masse
of this would be greatly appreciated. Thanks, Andre Masse ___ 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-admins(at)lists.apple.com Help

Re: Calculations in a tableview

2011-07-28 Thread Andre Masse
Well, I may end up doing this… Thanks Andre Masse On 28/07/2011, at 18:52 , Thomas Davie wrote: On 28 Jul 2011, at 23:48, Andre Masse wrote: Hi, For example, lets say I have a tableview with 3 columns: quantity, unit price and total. I want to calculate total using (quantity * unit

Re: Calculations in a tableview

2011-07-28 Thread Andre Masse
on a and b. This would be easy if the 3 values were in an NSTextField instead of a tableview as I could add an action to the first 2 fields and none to the third. Is this can be done using bindings or should I stop fighting the framework and and use a datasource? Thanks, Andre Masse On 28/07

NSWindowController window deprecated

2011-07-23 Thread Andre Masse
Hi, Got this warning in Xcode 4.1 on Lion. Is this really deprecated? There's no indication in NSWindowController header… Thanks, Andre Masse___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator

Re: NSWindowController window deprecated

2011-07-23 Thread Andre Masse
the project, but the warnings are still there… Thanks for your reply, Andre Masse On 23/07/2011, at 14:05 , Nick Zitzmann wrote: On Jul 23, 2011, at 7:50 AM, Andre Masse wrote: Hi, Got this warning in Xcode 4.1 on Lion. Is this really deprecated? There's no indication in NSWindowController

Re: NSWindowController window deprecated

2011-07-23 Thread Andre Masse
Wow! I feel so stupid! That was it! Thanks, Andre Masse On 23/07/2011, at 15:55 , Jean-Daniel Dupas wrote: Make sure you import all the required headers (especially the one defining MainWindowController). Le 23 juil. 2011 à 21:29, Andre Masse a écrit : Not sure what's going on, I

Re: Need help debugging this

2011-07-18 Thread Andre Masse
? Thanks to all for your help, Andre Masse PS: Salut Vincent :-) ___ 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-admins(at)lists.apple.com Help

Re: Need help debugging this

2011-07-18 Thread Andre Masse
you to think the exception was in NSApplicationMain (). Thanks a lot. Turned out the crash occurred in NSNumberFormatter. Removed it from the cell in the table view and the problem disappeared. Thanks all for your help. I learned a lot while tracking down this bug. Cheers, Andre Masse

Need help debugging this

2011-07-17 Thread Andre Masse
across runs and even after a machine reboot. Any infos, pointer to doc etc. would be appreciated, Thanks, Andre Masse ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact

Strange pause selecting row in NSTableView

2011-06-25 Thread Andre Masse
mac? I may have some background app messing up... Thanks, Andre Masse ___ 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-admins

Re: Strange pause selecting row in NSTableView

2011-06-25 Thread Andre Masse
Are you clicking on one of the selected rows? Clicking on non selected rows doesn't show the delay... My double-click speed is almost at full speed. Thanks for testing this, Andre Masse On 25/06/2011, at 10:52 , Andy Lee wrote: On Jun 25, 2011, at 10:23 AM, Fritz Anderson wrote: On 25 Jun

Re: Strange pause selecting row in NSTableView

2011-06-25 Thread Andre Masse
Double-click speed was at about 80% max. Setting it full speed indeed reduce the delay. It's barely noticeable now. Thanks for your help, Andre Masse On 25/06/2011, at 11:34 , Andy Lee wrote: Ah, I didn't read carefully enough. Indeed if I select multiple rows and click one of them, I see

Setting the firstResponder in a view

2011-06-19 Thread Andre Masse
makeFirstResponder:myFirstResponderField on the window. Obviously, this is not an ideal solution... I'm probably missing something obvious and feel free to call me an idiot for overlooking this :-) Thanks and Cheers, Andre Masse ___ Cocoa-dev mailing list (Cocoa-dev

Re: Setting the firstResponder in a view

2011-06-19 Thread Andre Masse
, the problem was that the view's window was nil! I assumed that a view always had a window. I was wrong. Need to find why though. Sorry for the noise, Andre Masse On 18/06/2011, at 16:51 , Andre Masse wrote: Hi List, I've been banging my head on this for awhile... I'm using a non document, non

Re: selectionShouldChangeInTableView called twice

2008-12-24 Thread Andre Masse
that :-) Thanks, Andre Masse ___ 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-admins(at)lists.apple.com Help/Unsubscribe/Update your

Re: selectionShouldChangeInTableView called twice

2008-12-23 Thread Andre Masse
isn't working but since there's only 3 users (one being me) for this app, I can live with that :-) Thanks to all for your suggestions, Andre Masse ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator

Re: selectionShouldChangeInTableView called twice

2008-12-22 Thread Andre Masse
calling, but you are always welcome to log a new bug report with your test case. Thanks for the info Corbin. Andre Masse ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list

Re: selectionShouldChangeInTableView called twice

2008-12-21 Thread Andre Masse
... Thanks for the idea, Andre Masse ___ 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-admins(at)lists.apple.com Help/Unsubscribe/Update your

Re: selectionShouldChangeInTableView called twice

2008-12-21 Thread Andre Masse
by the user. That way it is not a surprise, that ending the mode also has to be confirmed. Thanks, I think I have a winner here :-) Andre Masse ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator

Re: Listening for changes

2008-12-20 Thread Andre Masse
Thanks for the idea Mike. Not sure how I could implement this without sending the notification in every setter of the class though... Andre Masse On Dec 19, 2008, at 19:24, Mike Abdullah wrote: Since you apparently want to just know that one of the fields changed, but not which one

selectionShouldChangeInTableView called twice

2008-12-20 Thread Andre Masse
, I made a test project available here and will radar it if it has no workaround: http://idisk.mac.com/miyano/Public/TestRowChanges.zip Now, since I can't rely on -selectionShouldChangeInTableView:, how do you guys handle this? Thanks, Andre Masse

Re: selectionShouldChangeInTableView called twice

2008-12-20 Thread Andre Masse
on this :-) Andre Masse ___ 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-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http

Re: Enabling add button

2008-12-19 Thread Andre Masse
Thanks a lot Mark, This works great. The only change I made is to test with isEqualTo for the table view's specific instance to prevent adding rows when the master table is the first responder. And no flickers when presenting a sheet :-) Thanks again, Andre Masse On Dec 19, 2008

Listening for changes

2008-12-19 Thread Andre Masse
Let's say I have a class (called it Client) that has 25 fields and need to be notified when any of these is modified. Do I have to do - observeValueForKeyPath for each of the 25 fields? Thanks, Andre Masse ___ Cocoa-dev mailing list (Cocoa-dev

Re: Listening for changes

2008-12-19 Thread Andre Masse
Thanks for the great trick! Andre Masse On Dec 19, 2008, at 12:35, Ken Thomases wrote: On Dec 19, 2008, at 11:06 AM, Andre Masse wrote: Let's say I have a class (called it Client) that has 25 fields and need to be notified when any of these is modified. Do I have to do

Re: Listening for changes

2008-12-19 Thread Andre Masse
just can't figure out how I should implement - (BOOL) needSaving! Setting it to NO in -init and implementing it like this obviously doesn't work: - (BOOL) needSaving { return YES; } Thanks, Andre Masse On Dec 19, 2008, at 12:35, Ken Thomases wrote: On Dec 19, 2008, at 11:06 AM

Re: Listening for changes

2008-12-19 Thread Andre Masse
Thanks for the explanation. It just works :-) Andre Masse On Dec 19, 2008, at 13:51, Keary Suska wrote: As I understand this approach, it doesn't matter. All you should need to do is observe the fake property, and in the observeValueForKeyPath call do whatever you need to do

Enabling add button

2008-12-18 Thread Andre Masse
if there's another way... Thanks, Andre Masse ___ 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-admins(at)lists.apple.com Help/Unsubscribe/Update

Re: Enabling add button

2008-12-18 Thread Andre Masse
table view use a datasource (no bindings). I'm open to any suggestions, Andre Masse ___ 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-admins

Re: Enabling add button

2008-12-18 Thread Andre Masse
guess I have no choice. BTY, when does NSArrayController canInsert: returns NO? Thanks again, Andre Masse ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators

Re: Enabling add button

2008-12-18 Thread Andre Masse
transfer focus to the editable text in the new row in the table view. This is what I'm using (in a Mail like toolbar). The confusion occur when the user is using the shortcut... Thanks, Andre Masse ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com

Re: Enabling add button

2008-12-18 Thread Andre Masse
YES. If there is no Master selection, you'd get NO. I had a bug that was setting the content array to nil, strangely the button bound to canInsert: was enabled... Didn't try binding to selection though. Thanks for your help, Andre Masse ___ Cocoa

Re: Enabling add button

2008-12-18 Thread Andre Masse
, Andre Masse ___ 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-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http

Drawing NSTextFieldCell subclass in table view

2008-12-13 Thread Andre Masse
, Andre Masse - (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView { // we want 36x20 CGFloat y = cellFrame.size.height/2.0 - 10.0; NSRect frame = NSMakeRect(cellFrame.origin.x, y, 36.0, 20.0); CGFloat lineWidth = 1.5; frame

Re: Drawing NSTextFieldCell subclass in table view

2008-12-13 Thread Andre Masse
Right on Patrick! Thanks a lot, Andre Masse On Dec 13, 2008, at 19:26, Patrick Mau wrote: Hi Andre It seems you are not using the cellFrame.origin.y when you create your new frame. CGFloat y = cellFrame.origin.y + cellFrame.size.height/2.0 - 10.0; NSRect frame

Re: Drawing NSTextFieldCell subclass in table view

2008-12-13 Thread Andre Masse
Although this was not the cause in this particular problem, it will help with another issue I have in an another class. Thanks for the info, Andre Masse On Dec 13, 2008, at 19:03, Iceberg-Dev wrote: NSTextFieldCell is flipped. This has an impact on the y value. It might be the cause

Print toolbar icon

2008-12-05 Thread Andre Masse
Hi, I need the print icon from the NSToolbarItem to be used in other parts of my application. I've looked in NSImage.h and it's not there. Any other places I should look for it? Thanks, Andre Masse ___ Cocoa-dev mailing list (Cocoa-dev

Re: Hide / show password in NSTextField / NSSecureTextField

2008-12-02 Thread Andre Masse
You could use a secure and plain text field bound to the same value and hide/show one as needed. Andre Masse On Dec 2, 2008, at 11:26, Helder da Rocha wrote: Yes. I tried that. But it doens't show the characters. It simply toggles from showing nothing to showing bullets. I want to toggle

Re: Creating a Bottom Bar on NSWindow

2008-12-02 Thread Andre Masse
If you're targeting Leopard, you can put these 2 lines in your controller's -awakeFromNib: method: [[self window] setAutorecalculatesContentBorderThickness:YES forEdge:NSMinYEdge]; [[self window] setContentBorderThickness: 32.0 forEdge: NSMinYEdge]; Cheers, Andre Masse On Dec 2, 2008

Crash when closing window from the menu

2008-12-01 Thread Andre Masse
this is happening... Any idea? Andre Masse backtrace here: #0 0x922d5907 in ___forwarding___ () #1 0x922d5a12 in __forwarding_prep_0___ () #2 0x94ee1cae in -[NSTableView _dataSourceValueForColumn:row:] () #3 0x94e63fe0 in -[NSTableView preparedCellAtColumn:row:] () #4 0x94e63e44

Re: Crash when closing window from the menu

2008-12-01 Thread Andre Masse
Thanks for your reply Keary, What I don't understand is why I don't crash if the window is closed from its close box... Andre Masse On Dec 1, 2008, at 09:08, Keary Suska wrote: On Dec 1, 2008, at 6:47 AM, Andre Masse wrote: I've a strange bug that happens if the window is closed

Re: Crash when closing window from the menu

2008-12-01 Thread Andre Masse
Ah! Didn't know that. Thanks a lot, Andre Masse On Dec 1, 2008, at 09:12, Jean-Daniel Dupas wrote: When you dealloc a datasource, a delegate or any other object that is not retained by class that uses it, you have to unregister it. For example, if you have an object that is datasource

Re: Crash when closing window from the menu

2008-12-01 Thread Andre Masse
Thanks for the info Thomas. I should have said that I'm not using GC. Andre Masse On Dec 1, 2008, at 09:22, Thomas Davie wrote: This is a shot in the dark, but I was looking at a very similar error recently. It turned out to be caused by having forgotten to turn on garbage collection

Re: Crash when closing window from the menu

2008-12-01 Thread Andre Masse
That would explain the different behaviours. Thanks a lot, Andre Masse On Dec 1, 2008, at 10:26, Jean-Daniel Dupas wrote: What I don't understand is why I don't crash if the window is closed from its close box... The order in which the window go offscreen, the window content

Re: Crash when closing window from the menu

2008-12-01 Thread Andre Masse
Many thanks for the links! Very valuable reads! So far so good, no more crashes :-) Thanks again, Andre Masse On Dec 1, 2008, at 14:54, Jerry Krinock wrote: According to [1], you need one more line of code here: [tableView reloadData]; // other dealloc stuff

Re: Crash when closing window from the menu

2008-12-01 Thread Andre Masse
to all the people on this list! You're all helping me becoming a better Cocoa programmer... Thanks, Andre Masse On Dec 1, 2008, at 23:59, Michael Ash wrote: On Mon, Dec 1, 2008 at 2:54 PM, Jerry Krinock [EMAIL PROTECTED] wrote: On 2008 Dec, 01, at 6:12, Jean-Daniel Dupas wrote: - (void

Font binding

2008-11-29 Thread Andre Masse
= [NSKeyedUnarchiver unarchiveObjectWithData:data]; [test setStringValue:[tf fontName]]; } The label changes its value but not its font. Must be some silly thing I overlook... Any hints? Thanks, Andre Masse ___ Cocoa-dev mailing list (Cocoa

Re: Testing components within an application

2008-11-22 Thread Andre Masse
Hi Frank, I used to do this back in my Java days: put a main function in the class and just run it. That was a quick way to test a class, but I don't think you can do that as easily in Cocoa. I maybe wrong though, still a noob here :-). Andre Masse On Nov 22, 2008, at 08:08, Frank

Re: NSButton ical Like

2008-11-19 Thread Andre Masse
I've not used it but this may worth taking a look at: http://code.google.com/p/calendarcontrol/ Andre Masse On Nov 19, 2008, at 14:37, Emmanuel Pinault wrote: How do I make a button like the mini calendar in ical (the one that show the days and when one is selected , it shows the day

NSView positioning problems

2008-11-16 Thread Andre Masse
a big chunk to swallow and I would like to see a simple example on where to put the code for replacing a view. Thanks, Andre Masse ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments

Re: NSView positioning problems

2008-11-16 Thread Andre Masse
Quincey you were right on the money: the new view had a wrong flag (anchored to the bottom). Thanks a lot to everyone, Andre Masse On Nov 16, 2008, at 14:41, Quincey Morris wrote: There's not quite enough information here to be certain what's going on, but in a sense it shouldn't matter

BOOL madness

2008-11-11 Thread Andre Masse
to the value of isDirty, but flag is always YES... I also tried using a plain c bool and got the same result (true). Any idea what I'm doing wrong? Thanks, Andre Masse ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin

Re: BOOL madness

2008-11-11 Thread Andre Masse
Thanks a lot, this the method I was looking for. Andre Masse On Nov 11, 2008, at 20:11, Rob Keniger wrote: BOOL is not an object type. You need to use [myObject boolValue] to get a BOOL. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com

Re: BOOL madness

2008-11-11 Thread Andre Masse
by NSString and NSNumber. I suppose there's some kind of conversion from BOOL to NSString or NSNumber being done somewhere for putting this value in the change dictionary. Thanks to all of you guys. That was quick :-) Andre Masse ___ Cocoa-dev mailing

Re: BOOL madness

2008-11-11 Thread Andre Masse
Thanks for pointing that out. I'll check the archives. Andre Masse On Nov 11, 2008, at 20:28, Jim Correia wrote: I know this isn't the question you asked, nor the root of the problem you are having, but by way of saving you future pain, that is not the correct way to write

Re: BOOL madness

2008-11-11 Thread Andre Masse
observeValueForKeyPath:keyPath ofObject:object change:change context:context]; } } Thanks to you all, Andre Masse PS: pretty long context name though :-) ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator

Re: BOOL madness

2008-11-11 Thread Andre Masse
Thanks a lot for the doc pointer. Andre Masse On Nov 11, 2008, at 21:12, Michael Ash wrote: Key-Value Observing is built on top of Key-Value Coding, and KVC is documented to box non-object scalars using NSNumber and NSValue: http://developer.apple.com/documentation/Cocoa/Conceptual

Re: NSArrayController, bindings and NSUserDefaults

2008-11-09 Thread Andre Masse
Thanks a lot for your example Steven. I'm probably over thinking this. I'll just use IB, no custom class, no encoding no trouble :-) Thanks again, Andre Masse On Nov 9, 2008, at 15:13, Steven Riggs wrote: Check out a code sample (using no code, just IB)... http://idisk.mac.com

Re: Help with this crashing method

2008-11-09 Thread Andre Masse
Ahh! Thanks a lot guys. Now I can sleep :-) Have a good night, Andre Masse ___ 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-admins

Re: NSArrayController, bindings and NSUserDefaults

2008-11-09 Thread Andre Masse
of NSMutableDictionary all setup in IB. Have a good night, Andre Masse On Nov 9, 2008, at 16:05, Volker in Lists wrote: you need an formatter - NSUnarchiveFromData and then it works rather well. I store supplementary information that each user can edit in NSUserDefaults. The info is maintained

Re: NSArrayController, bindings and NSUserDefaults

2008-11-09 Thread Andre Masse
read a lot both in books and on the net... Thanks, Andre Masse ___ 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-admins(at)lists.apple.com

NSArrayController, bindings and NSUserDefaults

2008-11-09 Thread Andre Masse
* port; The view contains an NSTableView and NSTextFields displaying the currently selected row content but at this point I'm only trying (without any success) to fill up the table view. Any help, pointer to tutorial etc appreciated. Thanks, Andre Masse

Help with this crashing method

2008-11-09 Thread Andre Masse
]; // register it [[NSUserDefaults standardUserDefaults] registerDefaults:defaultValues]; --- crash here } Any help someone so I can go to sleep :-) Thanks, Andre Masse ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post

Re: NSTableView highlited text color

2008-11-06 Thread Andre Masse
Thanks for the idea, Andre Masse On Nov 5, 2008, at 21:38, Dave Fernandes wrote: As yet another way to do this, you can subclass the NSTableView and override drawRow: clipRect: Here's my code to give a background color to expandable rows in an outline view (like in Mail.app

NSTableView highlited text color

2008-11-05 Thread Andre Masse
and it's almost unreadable when the row is selected. I could make my own NSTextFieldCell subclass and override - isHighlited but would prefer not to. Thanks, Andre Masse ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin

Re: NSTableView highlited text color

2008-11-05 Thread Andre Masse
Thanks Corbin. Quick and easy, I like that :-) Andre Masse On Nov 5, 2008, at 17:48, Corbin Dunn wrote: If you set an explicit color on the cell, then it doesn't know it should flip the black text to white text when it is selected (in other words, it has no way of knowing that what you

Re: NSTableView highlited text color

2008-11-05 Thread Andre Masse
Thanks Mudi, That's another way too. Andre Masse On Nov 5, 2008, at 17:47, Mudi Dandan wrote: I believe retuning an NSattributedstring for object value should work. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post

Re: Need help to make this method prettier

2008-11-02 Thread Andre Masse
I tried at first to use the standard NSNumberFormatter in IB but couldn't find the right pattern. Your solution works great and don't require subclassing so thanks a lot. Andre Masse On Nov 1, 2008, at 16:09, Bill Bumgarner wrote: Use the APIs whenever possible. int main (int argc

Re: Tracking changes to NSTableView datasource

2008-11-02 Thread Andre Masse
the cases where the user let the view open and takes a break or even leave for the night... Thanks a lot Michael this could be a much simpler solution. Andre Masse On Nov 1, 2008, at 23:05, Michael Ash wrote: I don't know if it's compatible with how you want things to work

Need help to make these methods prettier

2008-11-01 Thread Andre Masse
Hi, I'm implementing a custom NSFormatter. I want a number with 9 digits displayed as 123 456 789. So before implementing the formatter I made a test project to check the conversion. The version I did get the job done but its not pretty :-) Any more good looking solutions? Thanks, Andre

Re: Delegation across thread

2008-10-31 Thread Andre Masse
Thanks a lot for your very clear explanation Michael. Looks like performSelectorOnMainThread: will be the way to go. Thanks again, Andre Masse On Oct 31, 2008, at 00:41, Michael Ash wrote: It's important to remember that delegate is just a design pattern, not a language feature. A delegate

Tracking changes to NSTableView datasource

2008-10-31 Thread Andre Masse
these kind of things? Any ideas, suggestions? Thanks, Andre Masse ___ 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-admins(at)lists.apple.com

Re: Tracking changes to NSTableView datasource

2008-10-31 Thread Andre Masse
for your reply Graham, Andre Masse On Oct 31, 2008, at 19:11, Graham Cox wrote: To be honest I can hardly follow this at all. You say: I have a datasource for an NSTableView which is a NSMutableArray This can't be, since NSMutableArray doesn't implement the NSTableDataSource protocol. So

Re: Static text over an image

2008-10-30 Thread Andre Masse
a bug on radar so that this *behavior* is fixed, and I'll do that :-) Thanks to all for your suggestions, Andre Masse ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list

  1   2   >