Static Library

2009-09-03 Thread David Blanton
Ok, not a Cocoa question but I know one of the smart guys here will  
like to guide me off list.


Question:

Is a static library properly designed if it requires headers from  
another static library?


I think not.

___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


(no subject)

2009-09-04 Thread David Blanton
I want to develop a CocoaTouch app that talks to a web server without  
doing 'web pages'.  I.e. the app does http gets and posts driving php  
(or other) scripts on the server to access some sql database.


Reason for this approach - to use coca table view to display data,  
generally speaking to have a nicer UI.


Make sense or shoveling against the tide?

Pleas comment / advise.

db

___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: (no subject)

2009-09-04 Thread David Blanton

Thank you I.S. and Steven ... I am off to the races!

On Sep 4, 2009, at 4:42 PM, Steven Degutis wrote:

This is a common concept. In fact, it's exactly how nearly all  
twitter apps on the iPhone work.


Usually it can be done manually with NSURLConnection and the like,  
though you may consider using a third-party framework like ASI-HTTP- 
Request or CocoaREST.


--
Steven Degutis
http://www.thoughtfultree.com/
http://www.degutis.org/

On Fri, Sep 4, 2009 at 5:16 PM, David Blanton  
 wrote:
I want to develop a CocoaTouch app that talks to a web server  
without doing 'web pages'.  I.e. the app does http gets and posts  
driving php (or other) scripts on the server to access some sql  
database.


Reason for this approach - to use coca table view to display data,  
generally speaking to have a nicer UI.


Make sense or shoveling against the tide?

Pleas comment / advise.

db

___

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://lists.apple.com/mailman/options/cocoa-dev/steven.degutis%40gmail.com

This email sent to steven.degu...@gmail.com





___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Does Mac OS X support interior pointers?

2009-09-09 Thread David Blanton

Hey, I am not a peon!


...  instead of wasting your efforts on a little mailing list  
populated by peons who're merely trying to write applications.



___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Best Design Advice

2009-09-27 Thread David Blanton
I need to create an app the is auto downloaded and installed from a  
web site when the user clicks a web page button.


The app needs to be installed so that it always runs when the user  
logs in.


The app needs to periodically (by user preference setting) connect to  
a web server.


The app needs to display a window with information gleaned from its  
last web server connect.


=
1. Where should the app be installed.

2. Are there any permission issues.

3. Is this a background service or status like item.

4. Is it's periodic web connect fired by a timer or some other means.

5. Any other general tips / tricks.
=


Thanks in advance!

db


___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Best Design Advice

2009-09-27 Thread David Blanton

Jens -

I am not sure from your response how the app will run when the user  
logs in.


Should not  the app be installed in a particular location so that it  
starts when the user logs in?


And, does this not imply that the user should not have the option of  
specifying where the app is installed.


And, if there is a particular location to be installed so that the app  
runs at login are there not permission issues?



Thanks.

db


On Sep 27, 2009, at 10:38 AM, Jens Alfke wrote:



On Nov 14, 2009, at 9:21 AM, David Blanton wrote:

I need to create an app the is auto downloaded and installed from a  
web site when the user clicks a web page button.


It can be downloaded when the user clicks a button, but of course it  
can't automatically run or be installed that way; that would be a  
security issue. The user needs to explicitly open the app after it's  
downloaded.



1. Where should the app be installed.


Wherever the user wants. You shouldn't need an installer for this,  
just package the app as a .zip or .dmg file.



2. Are there any permission issues.


No. But setting your app to launch at login without the user's  
consent would be a bad idea, unless of course you're writing  
malware ;). Please either put up an alert asking the user on first  
launch, or make it a checkbox in the prefs.



3. Is this a background service or status like item.


Only if you want it to be. Is there any UI? (If not, how does the  
user configure it or turn it off?)

Should it have a dock item? If not, how does the user access its UI?


4. Is it's periodic web connect fired by a timer or some other means.


Probably an NSTimer.

—Jens




___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


NSHTTPCookieStorage

2009-10-02 Thread David Blanton
Do I understand correctly that using  NSHTTPCookieStorage I can read  
cookies received by browsers on Mac.




___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Auto Install Login Item

2009-10-03 Thread David Blanton
Should my cocoa app write an entry to com.apple.loginitems.plist so it  
launches at login or is there a better way?


___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


NSResponder / acceptsFirstResponder

2010-03-12 Thread David Blanton
How does one get a views acceptFirstResponder method called without  
having to click on the view?


If a class subclasses NSResponder so it can get events how does one  
get an instance of this class in the responder chain?


-db
___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Order of [... directoryContentsAtPath:...]

2009-12-09 Thread David Blanton



 NSArray *array = [[NSFileManager defaultManager]  
directoryContentsAtPath:fullPath]];



Will array objects 0 thru n be in dictionary order?  This seems to be  
the case  but not always.  Should one sort array in an  
ascending manner?



Every place I run my code I always see array in dictionary order.   
However, in one customer case the order is not dictionary.


Just information I am looking for.

db


___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Wierd Crash Report

2009-12-14 Thread David Blanton



I ask this here as I have seen questions on Crash Reports.

This is is Universal Binary ... why is there any PPC involved as it is  
running on Intel


This is an iMac

Can anyone shed some light for me ?  Or tell me where to go with this  
type of issue ..


Thanks

db



Process: Convert it [817]
Path:/Applications/Convert it.app/Contents/MacOS/Convert it
Identifier:  com.BriTonLeap.convertitmac
Version: 1.42b (7309)
Code Type:   PPC (Translated)
Parent Process:  launchd [74]

Date/Time:   2009-12-14 14:07:30.817 -0500
OS Version:  Mac OS X 10.5.8 (9L31a)
Report Version:  6
Anonymous UUID:  D7DD7915-6444-4E83-A599-82BC6AD583BD

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x, 0x
Crashed Thread:  0

Thread 0 Crashed:
0   translate   0xb8152b34 spin_lock_wrapper + 91256
1   translate 	0xb8171633  
CallPPCFunctionAtAddressInt + 96207

2   translate   0xb80bdb8b 0xb800 + 777099
3   translate   0xb80b7007 0xb800 + 749575
4   translate   0xb80d49c0 0xb800 + 870848
5   translate   0xb813d75f spin_lock_wrapper + 4259
6   translate   0xb8011b64 0xb800 + 72548

Thread 1:
0   ??? 0x800bc286 0 + 2148254342
1   ??? 0x800c3a7c 0 + 2148285052
2   translate 	0xb818b6ea  
CallPPCFunctionAtAddressInt + 202886

3   ??? 0x800ed155 0 + 2148454741
4   ??? 0x800ed012 0 + 2148454418

Thread 0 crashed with X86 Thread State (32-bit):
 eax: 0x  ebx: 0xb81715c2  ecx: 0x  edx: 0x0006
 edi: 0x0331  esi: 0x  ebp: 0xb7fff978  esp: 0xb7fff958
  ss: 0x001f  efl: 0x0246  eip: 0xb8152b34   cs: 0x0017
  ds: 0x001f   es: 0x001f   fs: 0x   gs: 0x0037
 cr2: 0x81272acc

Binary Images:
0xb800 - 0xb81d7fe7  translate ??? (???) /usr/libexec/oah/translate

Translated Code Information:
NO CRASH REPORT
___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Wierd Crash Report

2009-12-14 Thread David Blanton
Thanks to all ...  I was unaware of the "Open With Rosetta" option in  
Get Info.


I just had the user uncheck it and my code is running fine.

So, how did it get checked in the first place  ... hmm mystery as the  
user says she did not do it


She did have a dealer tech rep out a few days ago, I wonder ?

Thanks again, happy user now !

db

On Dec 14, 2009, at 1:14 PM, Mike Abdullah wrote:



On 14 Dec 2009, at 19:40, David Blanton wrote:




I ask this here as I have seen questions on Crash Reports.

This is is Universal Binary ... why is there any PPC involved as it  
is running on Intel


This is an iMac


Code type says it all. "PPC (Translated)". i.e. the user has forced  
your app to launch under Rosetta.


Can anyone shed some light for me ?  Or tell me where to go with  
this type of issue ..


Thanks

db



Process: Convert it [817]
Path:/Applications/Convert it.app/Contents/MacOS/ 
Convert it

Identifier:  com.BriTonLeap.convertitmac
Version: 1.42b (7309)
Code Type:   PPC (Translated)
Parent Process:  launchd [74]

Date/Time:   2009-12-14 14:07:30.817 -0500
OS Version:  Mac OS X 10.5.8 (9L31a)
Report Version:  6
Anonymous UUID:  D7DD7915-6444-4E83-A599-82BC6AD583BD

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x, 0x
Crashed Thread:  0

Thread 0 Crashed:
0   translate 	0xb8152b34 spin_lock_wrapper +  
91256
1   translate 	0xb8171633  
CallPPCFunctionAtAddressInt + 96207

2   translate   0xb80bdb8b 0xb800 + 777099
3   translate   0xb80b7007 0xb800 + 749575
4   translate   0xb80d49c0 0xb800 + 870848
5   translate 	0xb813d75f spin_lock_wrapper +  
4259

6   translate   0xb8011b64 0xb800 + 72548

Thread 1:
0   ??? 0x800bc286 0 + 2148254342
1   ??? 0x800c3a7c 0 + 2148285052
2   translate 	0xb818b6ea  
CallPPCFunctionAtAddressInt + 202886

3   ??? 0x800ed155 0 + 2148454741
4   ??? 0x800ed012 0 + 2148454418

Thread 0 crashed with X86 Thread State (32-bit):
eax: 0x  ebx: 0xb81715c2  ecx: 0x  edx: 0x0006
edi: 0x0331  esi: 0x  ebp: 0xb7fff978  esp: 0xb7fff958
ss: 0x001f  efl: 0x0246  eip: 0xb8152b34   cs: 0x0017
ds: 0x001f   es: 0x001f   fs: 0x   gs: 0x0037
cr2: 0x81272acc

Binary Images:
0xb800 - 0xb81d7fe7  translate ??? (???) /usr/libexec/oah/ 
translate


Translated Code Information:
NO CRASH REPORT
___

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://lists.apple.com/mailman/options/cocoa-dev/cocoadev%40mikeabdullah.net

This email sent to cocoa...@mikeabdullah.net







___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Call Cocoa from C++

2009-12-17 Thread David Blanton

I searched the archive .. no hits.

The question:

How / Can I store a pointer to an obj-c object in a C++ class and then  
send messages to the obj-c object from C++?


Somethng like:


class MyClass
{   
public:
void* objcptr; // ptr to my obj-c object
void CallOBJC(void);
}

MyClass::CallOBJC()
{

[objcptr updateText];
}







___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Call Cocoa from C++

2009-12-17 Thread David Blanton

Thanks all !

I need Bing lessons from MS for my searches , I guess!

db
On Dec 17, 2009, at 12:24 PM, Kyle Sluder wrote:

On Thu, Dec 17, 2009 at 11:16 AM, David Blanton  
 wrote:

I searched the archive .. no hits.


You mustn't have searched the documentation. Or Google, for that  
matter.


http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/ObjectiveC/Articles/ocCPlusPlus.html

--Kyle Sluder




___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Remember Window and Inspector Positions

2009-12-21 Thread David Blanton
I have a main window and a few floating inspectors. I would like to  
come back to the position the user left these upon relaunch. Do I have  
to program this or is there some Cocoa or other construct that does  
this for me?


db

___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Remember Window and Inspector Positions

2009-12-21 Thread David Blanton
Ok.  I thought I had some automagic behaviour before but in doing a  
sample I did not observe it.  I had not named the window in IB.  I'll  
give that a go now.


Happy Healtcare!

db
On Dec 21, 2009, at 12:38 PM, Alexander Spohr wrote:



Am 21.12.2009 um 20:22 schrieb David Blanton:

I have a main window and a few floating inspectors. I would like to  
come back to the position the user left these upon relaunch. Do I  
have to program this or is there some Cocoa or other construct that  
does this for me?


You can put that into UserDefaults.
And I think a window just needs a name (in IB even?) and some BOOL  
set to YES to that automagic. But I am not sure about the latter.


atze






___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Window Controllers

2009-12-23 Thread David Blanton
In my NSDocument app I have three Panels that will act as inspectors  
for the document content.


In best Cocoa practices, should these Panels be owned by a window  
controller?


db
___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Window Controllers

2009-12-23 Thread David Blanton

Please disregard my question about Window Controllers.

db

On Dec 23, 2009, at 1:48 PM, David Blanton wrote:


I meant should each Panel have a Window Controller.

On Dec 23, 2009, at 1:45 PM, David Blanton wrote:

In my NSDocument app I have three Panels that will act as  
inspectors for the document content.


In best Cocoa practices, should these Panels be owned by a window  
controller?


db
___

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://lists.apple.com/mailman/options/cocoa-dev/airedale%40tularosa.net

This email sent to aired...@tularosa.net








___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Window Controllers

2009-12-23 Thread David Blanton

I meant should each Panel have a Window Controller.

On Dec 23, 2009, at 1:45 PM, David Blanton wrote:

In my NSDocument app I have three Panels that will act as inspectors  
for the document content.


In best Cocoa practices, should these Panels be owned by a window  
controller?


db
___

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://lists.apple.com/mailman/options/cocoa-dev/airedale%40tularosa.net

This email sent to aired...@tularosa.net





___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


NSPredicate mal behaviour?

2009-12-28 Thread David Blanton

In a directory I have:

.DS_Store
._Filename


These name are in a array that is filtered using this predicate:

notBeginsWithDot = [NSPredicate predicateWithFormat:@"NOT SELF  
BEGINSWITH %@", @"."];


childrenArray = [childrenArray  
filteredArrayUsingPredicate:notBeginsWithDot];



childrenArray now contains ._Filename but not .DS_Store.

This seems incorrect since both start with '."

Comments please.

db
___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSPredicate mal behaviour?

2009-12-28 Thread David Blanton

Errata.  Can't debug my own code.  NSPredicate is working properly.


Happy New Year!


On Dec 28, 2009, at 2:09 PM, David Blanton wrote:


In a directory I have:

.DS_Store
._Filename


These name are in a array that is filtered using this predicate:

notBeginsWithDot = [NSPredicate predicateWithFormat:@"NOT SELF  
BEGINSWITH %@", @"."];


childrenArray = [childrenArray  
filteredArrayUsingPredicate:notBeginsWithDot];



childrenArray now contains ._Filename but not .DS_Store.

This seems incorrect since both start with '."

Comments please.

db
___

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://lists.apple.com/mailman/options/cocoa-dev/airedale%40tularosa.net

This email sent to aired...@tularosa.net





___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


MyDocument.xib v MainMenu.xib

2009-12-29 Thread David Blanton
In a document based app I want to have some 'inspectors" that reflect  
what i sgoing on in the document.  These inspectors should float.


If I make NSPanel's for the inspector in MyDocument.xib then each  
instance of a document gets its own set of inspectors.


I would like to have just one set of inspectors whose contents change  
as different documents are activated.


Putting the inspectors in MainMenu.xib will let me make just 'one set'  
for all documents but I am unsure as to how to get a reference from  
the inspector to the document given different xib's.


Suggestion please.

db

___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: MyDocument.xib v MainMenu.xib

2009-12-30 Thread David Blanton

Thanks to all who gave advice.

I'll give a description of what I did.  If you have any further  
comments or suggestions please come forth!


In MainMenu.xib

An NSPanel that contains an NSOutlineView
An Application Delegate that has a reference to the NSOutlineView


In MyDocument.m

- (id)init
{
self = [super init];
if (self) {

// Add your subclass-specific initialization here.
// If an error occurs here, send a [self release] message and  
return nil.


m_treeDataSource = [[[TreeDataSource alloc] init] retain];
m_treeDelegate = [[[TreeDelegate alloc] init] retain];

if(!m_treeDataSource || !m_treeDelegate)
{
[self release];
return nil;
}

m_appDelegate = [NSApp delegate];
m_tree = m_appDelegate->m_tree;
[m_tree retain];
[m_tree setDataSource:m_treeDataSource];
[m_tree setDelegate:m_treeDelegate];
}
return self;
}

- (void)windowDidBecomeKey:(NSNotification *)notification {

[m_tree setDataSource:m_treeDataSource];
[m_tree setDelegate:m_treeDelegate];

}


MyDocument.m has methods to manage m_treeDataSource

- (IBAction)root:(id)sender {

TreeItem* root = [[[TreeItem alloc] init] retain];
root->m_parent = nil;
root->m_itemName = [m_root stringValue];  // m_root is a TextField   
[m_treeDataSource->m_roots addObject:root];
}


- (IBAction)data:(id)sender {

[m_tree reloadData];
}

Still have some problems that I'll ask some questions about in a bit.

db






On Dec 30, 2009, at 12:55 AM, Graham Cox wrote:



On 30/12/2009, at 4:23 PM, David Blanton wrote:

In a document based app I want to have some 'inspectors" that  
reflect what i sgoing on in the document.  These inspectors should  
float.


If I make NSPanel's for the inspector in MyDocument.xib then each  
instance of a document gets its own set of inspectors.


I would like to have just one set of inspectors whose contents  
change as different documents are activated.


Putting the inspectors in MainMenu.xib will let me make just 'one  
set' for all documents but I am unsure as to how to get a reference  
from the inspector to the document given different xib's.


Suggestion please.



Each document your application opens will be a new instance built  
from the same nib. So even if there were a way to 'connect' objects  
in one nib to objects in another, it wouldn't help you - different  
documents will be made active at different times and your inspectors  
need to be aware of those activations.


A simple approach is to make your inspectors respond to all window  
did become main/resign main notifications, and then ask the document  
controller singleton for -currentDocument at those times. It can  
then figure out if the document itself has changed as a result of  
the active window change and do whatever it needs to do to inspect  
the document contents.


Setting up the notifications is best done in the inspector  
controller's -awakeFromNib method.


--Graham






___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Save MyDocument

2009-12-30 Thread David Blanton

MyDocument is a subclass of NSDocument.

The docs say:

You can control whether the default accessory view (which contains a  
pop-up menu allowing the user to choose what type to save) appears in  
the Save panel by overriding shouldRunSavePanelWithAccessoryView. The  
default accessory view is used if that method returns YES and the  
document supports writing multiple types.


I can instance a view in IB, add a popup with file types but how to  
hook this up the NSSavePanel is a ?


db 
 
___


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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Save MyDocument

2009-12-30 Thread David Blanton

Duh ... It was workling and I didn't see it.

sorry for the bandwidth waste.


On Dec 30, 2009, at 6:55 PM, David Blanton wrote:


MyDocument is a subclass of NSDocument.

The docs say:

You can control whether the default accessory view (which contains a  
pop-up menu allowing the user to choose what type to save) appears  
in the Save panel by overriding shouldRunSavePanelWithAccessoryView.  
The default accessory view is used if that method returns YES and  
the document supports writing multiple types.


I can instance a view in IB, add a popup with file types but how to  
hook this up the NSSavePanel is a ?


db___

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://lists.apple.com/mailman/options/cocoa-dev/airedale%40tularosa.net

This email sent to aired...@tularosa.net





___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


NSImage

2009-12-31 Thread David Blanton
Given an array of color data (a generic bitmap) what is the best /  
fastest / recommended method to convert this to an NSImage?




___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSImage

2009-12-31 Thread David Blanton
Yeah, I was doing it with CGBitmapContextCreate followed by  
CGBitmapContextCreateImage but that ends up as a CGImageRef.


I want NSImage so I can put an NSImageCell in an NSOutlineView and  
walk away !



Happy New Year !

I have 15 year old scotch to crack with a 28 year Apple Employee this  
evening !



On Dec 31, 2009, at 3:54 PM, Henry McGilton (Boulevardier) wrote:



On Dec 31, 2009, at 2:26 PM, David Blanton wrote:

Given an array of color data (a generic bitmap) what is the best /  
fastest / recommended method to convert this to an NSImage?


Load your data into memory, create an NSBitmapImageRep from that  
pile of

data, then make an NSImage from the NSBitmapImageRep . . .

Cheers,
. . . . . . . .Henry



=
iPhone App Development and Developer Education . . .
Visit  www.nonatomic-retain.com

Mac OSX Application Development, Plus a Great Deal More . . .
Visit  www.trilithon.com



___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSImage

2010-01-01 Thread David Blanton

Thanks.  Food for thought.

I will be dealing with converting these bitmaps as the user does mouse  
stuff in a view, like dragging it around or grabbing sizing handles.   
I will be sending the move data to our underlying portable code, that  
code renders a new bitmap and hands it to me for display.


Any comments on performance, please.

db

On Jan 1, 2010, at 11:08 AM, Mike Abdullah wrote:



On 31 Dec 2009, at 22:26, David Blanton wrote:

Given an array of color data (a generic bitmap) what is the best /  
fastest / recommended method to convert this to an NSImage?


Strictly speaking, the quickest way to generate an NSImage object  
would be to create an NSImageRep that knows how to draw your array  
of color data. Then, create an NSImage with that. The ways to do that:


A) Can you directly init an NSBitmapImageRep from the data? If so,  
use that


B) Create a NSCustomImageRep object and have the existing holder of  
the image data implement the drawing methods.


C) Create your own NSImageRep subclass.




___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSImage

2010-01-01 Thread David Blanton

Yeah, I understand the path and like it because it is much cleaner.

Thanks for the remarks.
On Jan 1, 2010, at 2:47 PM, Uli Kusterer wrote:


David,

I think you may want to read Henry's answer again. The path going  
through NSBitmapImageRep and NSImage that he recommends doesn't  
involve any CGBitmapContexts or CGImageRefs. Well, at least not in  
any code you write :-)


-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
http://www.masters-of-the-void.com

On 01.01.2010, at 00:21, David Blanton wrote:

Yeah, I was doing it with CGBitmapContextCreate followed by  
CGBitmapContextCreateImage but that ends up as a CGImageRef.


I want NSImage so I can put an NSImageCell in an NSOutlineView and  
walk away !



Happy New Year !

I have 15 year old scotch to crack with a 28 year Apple Employee  
this evening !



On Dec 31, 2009, at 3:54 PM, Henry McGilton (Boulevardier) wrote:



On Dec 31, 2009, at 2:26 PM, David Blanton wrote:

Given an array of color data (a generic bitmap) what is the  
best / fastest / recommended method to convert this to an NSImage?


Load your data into memory, create an NSBitmapImageRep from that  
pile of

data, then make an NSImage from the NSBitmapImageRep . . .

  Cheers,
  . . . . . . . .Henry



=
iPhone App Development and Developer Education . . .
  Visit  www.nonatomic-retain.com

Mac OSX Application Development, Plus a Great Deal More . . .
  Visit  www.trilithon.com









___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


NSBitMapImageRep Woes

2010-01-06 Thread David Blanton

Here is the code:

@interface MyDocumentView : NSView {
@public

NSBitmapImageRep*   m_NSBitmapImageRep;
NSRect  m_frameRect;
float   m_sz;
BBitmap m_bitmap;
unsigned char*  m_ptrs[1];
}

- (void)awakeFromNib {

m_ptrs[0] = (unsigned char*)&m_bitmap.m_array;
m_NSBitmapImageRep = [[NSBitmapImageRep alloc]
   
initWithBitmapDataPlanes:m_ptrs
   
pixelsWide:m_frameRect.size.width
   
pixelsHigh:m_frameRect.size.height
   bitsPerSample:8
   samplesPerPixel:4
   hasAlpha:YES
   isPlanar:NO
   
colorSpaceName:NSCalibratedRGBColorSpace
   
bitmapFormat:NSAlphaFirstBitmapFormat
   bytesPerRow:(4 * 
m_frameRect.size.width)
   bitsPerPixel:32];
}

- (void)drawRect:(NSRect)dirtyRect {

[NSGraphicsContext saveGraphicsState];  
[m_NSBitmapImageRep drawInRect:dirtyRect];  
[NSGraphicsContext restoreGraphicsState];
}

m_bitmap.m_array is created in readFromData:ofType:fromFile

I know it is correct because if I use this code I get proper results: 
(in this case bitmap is a local var but is generated just m_bitmap is.


	context = CGBitmapContextCreate (bitmap.m_array, bitmap.m_pixelsx,  
bitmap.m_pixelsy, 8, bitmap.m_pixelsx * 4, colorSpace,  
kCGImageAlphaNoneSkipFirst|kCGBitmapByteOrder32Host);	

CGImageRelease(_cgImageRef);
_cgImageRef =  CGBitmapContextCreateImage (context);
CGImageRetain(_cgImageRef); 
CGContextRelease(context);
CGColorSpaceRelease(colorSpace);


The problem is I just see garbage, no image.  Clearly I am doing  
something wrong with the NSBitMapImageRep but I have no idea what.


Please comment!

db


___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSBitMapImageRep Woes

2010-01-06 Thread David Blanton

OK.

So, from other comments I made some changes.

1. Correctly set the dimensions by using m_bitmap.m_pixelsx and  
m_bitmap.m_pixelsy (these are members of our portable bitmap class).



m_NSBitmapImageRep = [[NSBitmapImageRep alloc]
  
initWithBitmapDataPlanes:m_ptrs
  pixelsWide:m_bitmap.m_pixelsx
  pixelsHigh:m_bitmap.m_pixelsy
  bitsPerSample:8
  samplesPerPixel:4
  hasAlpha:YES
  isPlanar:NO
  
colorSpaceName:NSCalibratedRGBColorSpace
  
bitmapFormat:NSAlphaFirstBitmapFormat
  bytesPerRow:(4 * 
m_bitmap.m_pixelsx)
  bitsPerPixel:32];


And changed the drawInRect to draw in the views bounds

- (void)drawRect:(NSRect)dirtyRect {

NSRect bounds = [self bounds];
[NSGraphicsContext saveGraphicsState];  
[m_NSBitmapImageRep drawInRect:bounds]; 
[NSGraphicsContext restoreGraphicsState];
}

Now, from David Duncan's comment.

My bitmap data does have alpha, i.e 4 samples per pixel ARGB. I   
thought kCGImageAlphaNoneSkipFirst says don't make an alpha plane,  
skip byte 1 and go to RED.


I am not sure how to specify this in the 'bitmapFormat' parameter.


On Jan 6, 2010, at 10:35 AM, David Duncan wrote:


On Jan 6, 2010, at 9:21 AM, David Blanton wrote:


m_NSBitmapImageRep = [[NSBitmapImageRep alloc]
   
initWithBitmapDataPlanes:m_ptrs
   
pixelsWide:m_frameRect.size.width
   
pixelsHigh:m_frameRect.size.height
   bitsPerSample:8
   samplesPerPixel:4
   hasAlpha:YES
   isPlanar:NO
   
colorSpaceName:NSCalibratedRGBColorSpace
   
bitmapFormat:NSAlphaFirstBitmapFormat
   bytesPerRow:(4 * 
m_frameRect.size.width)
   bitsPerPixel:32];


This code creates a bitmap with alpha.

	context = CGBitmapContextCreate (bitmap.m_array, bitmap.m_pixelsx,  
bitmap.m_pixelsy, 8, bitmap.m_pixelsx * 4, colorSpace,  
kCGImageAlphaNoneSkipFirst|kCGBitmapByteOrder32Host);	


This code creates a bitmap without alpha.

The problem is I just see garbage, no image.  Clearly I am doing  
something wrong with the NSBitMapImageRep but I have no idea what.



Hence garbage.
--
David Duncan
Apple DTS Animation and Printing





___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSBitMapImageRep Woes

2010-01-07 Thread David Blanton

Thanks to all.

I have my bitmap being drawn but it is upside down.

Do isFlipped play any role in this / how do I get it to draw right  
side up without inverting my raw data?


For those interested this is the correct definition of NSBitMapImageRep:

m_ptrs[0] = (unsigned char*)m_bitmap.m_array;
m_NSBitmapImageRep = [[NSBitmapImageRep alloc]
  
initWithBitmapDataPlanes:m_ptrs
  pixelsWide:m_bitmap.m_pixelsx
  pixelsHigh:m_bitmap.m_pixelsy
  bitsPerSample:8
  samplesPerPixel:3
  hasAlpha:NO
  isPlanar:NO
  
colorSpaceName:NSCalibratedRGBColorSpace
  
bitmapFormat:NSAlphaNonpremultipliedBitmapFormat
  
bytesPerRow:(4*m_bitmap.m_pixelsx)
  bitsPerPixel:32];




On Jan 6, 2010, at 11:32 AM, David Duncan wrote:


On Jan 6, 2010, at 10:19 AM, David Blanton wrote:


Now, from David Duncan's comment.

My bitmap data does have alpha, i.e 4 samples per pixel ARGB. I   
thought kCGImageAlphaNoneSkipFirst says don't make an alpha plane,  
skip byte 1 and go to RED.


I am not sure how to specify this in the 'bitmapFormat' parameter.


AlphaNoneSkipFirst means you have no alpha, and skip any leading  
bytes per necessary to fill the pixel size. In your particular case  
since you have 8 bits per component and 3 components, that means  
skip the first 8 bits of each word then decode 8 bits for each of 3  
components.


When you create your NSBitmapImageRep however, you specify that  
there is alpha, which means that you are specifying the equivalent  
of kCGImageAlphaPremultipliedFirst (since you don't specify the  
NSAlphaNonpremultipliedBitmapFormat flag).  What you really want is  
to specify no alpha and 3 samples per pixel (if I'm not mistaken, I  
usually work in Quartz rather than NS for graphics). Specifying 32  
bits per pixel as you do should get the same interpretation that you  
are currently getting via Quartz.


Also keep in mind that your Quartz code is more work than you would  
actually need. Since you aren't drawing to your image data, you  
should create the CGImage directly via CGImageCreate rather than  
using CGBitmapContextCreate to then extract a CGImage – the  
performance difference is in the syscalls necessary to mark the  
memory for the bitmap context as copy-on-write.

--
David Duncan
Apple DTS Animation and Printing





___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSBitMapImageRep Woes

2010-01-07 Thread David Blanton

Answered my own question ... apologize for the noise!
On Jan 7, 2010, at 4:05 PM, David Blanton wrote:


Thanks to all.

I have my bitmap being drawn but it is upside down.

Do isFlipped play any role in this / how do I get it to draw right  
side up without inverting my raw data?


For those interested this is the correct definition of  
NSBitMapImageRep:


m_ptrs[0] = (unsigned char*)m_bitmap.m_array;
m_NSBitmapImageRep = [[NSBitmapImageRep alloc]
  
initWithBitmapDataPlanes:m_ptrs
  pixelsWide:m_bitmap.m_pixelsx
  pixelsHigh:m_bitmap.m_pixelsy
  bitsPerSample:8
  samplesPerPixel:3
  hasAlpha:NO
  isPlanar:NO
  
colorSpaceName:NSCalibratedRGBColorSpace
  
bitmapFormat:NSAlphaNonpremultipliedBitmapFormat
  
bytesPerRow:(4*m_bitmap.m_pixelsx)
  bitsPerPixel:32];




On Jan 6, 2010, at 11:32 AM, David Duncan wrote:


On Jan 6, 2010, at 10:19 AM, David Blanton wrote:


Now, from David Duncan's comment.

My bitmap data does have alpha, i.e 4 samples per pixel ARGB. I   
thought kCGImageAlphaNoneSkipFirst says don't make an alpha plane,  
skip byte 1 and go to RED.


I am not sure how to specify this in the 'bitmapFormat' parameter.


AlphaNoneSkipFirst means you have no alpha, and skip any leading  
bytes per necessary to fill the pixel size. In your particular case  
since you have 8 bits per component and 3 components, that means  
skip the first 8 bits of each word then decode 8 bits for each of 3  
components.


When you create your NSBitmapImageRep however, you specify that  
there is alpha, which means that you are specifying the equivalent  
of kCGImageAlphaPremultipliedFirst (since you don't specify the  
NSAlphaNonpremultipliedBitmapFormat flag).  What you really want is  
to specify no alpha and 3 samples per pixel (if I'm not mistaken, I  
usually work in Quartz rather than NS for graphics). Specifying 32  
bits per pixel as you do should get the same interpretation that  
you are currently getting via Quartz.


Also keep in mind that your Quartz code is more work than you would  
actually need. Since you aren't drawing to your image data, you  
should create the CGImage directly via CGImageCreate rather than  
using CGBitmapContextCreate to then extract a CGImage – the  
performance difference is in the syscalls necessary to mark the  
memory for the bitmap context as copy-on-write.

--
David Duncan
Apple DTS Animation and Printing





___

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://lists.apple.com/mailman/options/cocoa-dev/airedale%40tularosa.net

This email sent to aired...@tularosa.net




___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


ColorSpace Question

2010-01-07 Thread David Blanton

I have been using

CGContextRefcontext;
context = CGBitmapContextCreate (m_bitmap.m_array.m_array,  
m_bitmap.m_array.m_pixelsx, m_bitmap.m_array.m_pixelsy, 8,  
m_bitmap.m_array.m_pixelsx * 4, colorSpace,kCGImageAlphaNoneSkipFirst| 
kCGBitmapByteOrder32Host);

CGImageRelease(m_BitmapImage);
CGContextRelease(context);
CGImageRetain(m_BitmapImage);

Then

CGContextDrawImage(cellViewContext, r, m_BitmapImage);

and all is well.


Now I use an NSBitMapImageRep and my colors are off

m_ptrs[0] = (unsigned char*)m_bitmap.m_array;
m_NSBitmapImageRep = [[NSBitmapImageRep alloc]
  
initWithBitmapDataPlanes:m_ptrs
  pixelsWide:m_bitmap.m_pixelsx
  pixelsHigh:m_bitmap.m_pixelsy
  bitsPerSample:8
  samplesPerPixel:3
  hasAlpha:NO
  isPlanar:NO
  
colorSpaceName:NSCalibratedRGBColorSpace
		  bitmapFormat:NSAlphaNonpremultipliedBitmapFormat| 
kCGBitmapByteOrder32Host

  
bytesPerRow:(4*m_bitmap.m_pixelsx)
  bitsPerPixel:32];
I am confused by this as m_bitmap.m_array is created identically in  
both examples

___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


CGImageCreate performance

2010-01-07 Thread David Blanton
If David Duncan would comment on performance issues using his  
suggested approach:


CGColorSpaceRef colorSpace;
colorSpace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB);
	CGDataProviderRef provider = CGDataProviderCreateWithData  
(NULL,m_bitmap.m_array, 4*m_bitmap.m_pixelsx*m_bitmap.m_pixelsy, NULL);

CGImageRelease(m_CGImageRef);
	m_CGImageRef = CGImageCreate(m_bitmap.m_pixelsx, m_bitmap.m_pixelsy,  
8, 32, 4*m_bitmap.m_pixelsx, colorSpace,  kCGImageAlphaNoneSkipFirst| 
kCGBitmapByteOrder32Host, provider, NULL,YES,  
kCGRenderingIntentDefault);

CGImageRetain(m_CGImageRef);
CGColorSpaceRelease(colorSpace);
CGDataProviderRelease(provider);

Clearly I have kicked NSBitMapImageRep under the bus as the above  
gives what I am looking for.


The performance issue comes from the fact the user will be dragging  
this bitmap around so I a regenerating m_bitmap.m_array  constantly.


Thanks for all the help ... I think I have learned something!

db
___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: CGImageCreate performance

2010-01-07 Thread David Blanton

Let me clarify.

There will be various graphic images in the bitmap that he user can  
grab handles on and resize.


There will be simulation of stitching (as in sewing machine) going on.

These are all calculated / created in underlying portable code (we use  
it in Windows).



On Jan 7, 2010, at 6:42 PM, Rob Keniger wrote:



On 08/01/2010, at 11:36 AM, David Blanton wrote:

The performance issue comes from the fact the user will be dragging  
this bitmap around so I a regenerating m_bitmap.m_array  constantly.



I'm not sure what your app does, but have you considered using a  
Core Animation layer to host the bitmap? That way you can move the  
image around willy-nilly with virtually zero cost, and you only have  
to regenerate the bitmap if it changes.


--
Rob Keniger



___

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://lists.apple.com/mailman/options/cocoa-dev/airedale%40tularosa.net

This email sent to aired...@tularosa.net




___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


NSScroller

2010-01-07 Thread David Blanton

Is there an 'easy' way to get NSScroller  events in an NSDocument app?

I would like to know where the knob is.

-db
___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSScroller

2010-01-07 Thread David Blanton
I mentioned NSDocument app simce that is where I am and the content is  
contained in a scroll view.


I wan to send to my model code that the user scrolled the view and I  
want to know by how much.


So, I thought I would implement trackKnob but I don't know how 


On Jan 7, 2010, at 9:04 PM, Graham Cox wrote:



On 08/01/2010, at 2:52 PM, David Blanton wrote:

Is there an 'easy' way to get NSScroller  events in an NSDocument  
app?


I would like to know where the knob is.



The knob's position is just the -floatValue (or -intValue) of the  
scroller control.


What are you trying to do? NSDocument is not part of the 'view'  
layer of MVC so it's unclear how the two are related. If you want to  
send an action in response to a scroller just hook it up to an  
action method. However, scrollers are not a good control to use when  
you really mean e.g. a slider.


--Graham





___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSScroller

2010-01-07 Thread David Blanton
If a scroll view's content view is larger than the scroll view then  
the scroll view generates scrollers - correct?


Let me try to get to some of the REALLY

1. I want to always make the content view some factor larger than the  
scroll view to keep the scroller knobs a uniform size.


2. If the user scrolls I want to tell my model how much was scrolled  
so it can regenerate a bitmap for display.


3. If the window size changes apply a factor to the content view to  
achieve 1 above.


 -db


On Jan 7, 2010, at 9:33 PM, Graham Cox wrote:



On 08/01/2010, at 3:21 PM, David Blanton wrote:

I wan to send to my model code that the user scrolled the view and  
I want to know by how much.


So, I thought I would implement trackKnob but I don't know how 



To get the scroll position of the scrolled view is much more useful  
than getting the scroller's current value. [[aView scrollView]  
documentVisibleRect] will return a rect whose origin will be the  
scroll position.  is any view (if it's not within a  
scrollview, you'll just get an empty rect).


However, I'm still wondering what business the document has knowing  
this. Scrolled views should work automatically and there is no  
reason to track scroll position. When a view is asked to draw, its  
dirty rects indicate what parts need drawing - by drawing only those  
parts you will automatically be drawing efficiently as new parts of  
the view are scrolled on screen. That's about the only scenario I  
can think of where it might matter, and it's already taken care of.


So, what are you REALLY trying to do?

--Graham






___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSScroller

2010-01-07 Thread David Blanton

Let me cogitate on your superb answer for a bit.  I'll be back.  Thanks.

On Jan 7, 2010, at 10:14 PM, Graham Cox wrote:



On 08/01/2010, at 3:58 PM, David Blanton wrote:

If a scroll view's content view is larger than the scroll view then  
the scroll view generates scrollers - correct?


Let me try to get to some of the REALLY

1. I want to always make the content view some factor larger than  
the scroll view to keep the scroller knobs a uniform size.


For this I'd perhaps consider subclassing NSScroller and override - 
setKnobProportion: to call super with some constant value regardless  
of what is passed in. That will keep the knob a constant size. If  
the content view is some fixed proportion of the visible view, this  
will just happen anyway, but I'm unsure just how sensible this would  
be.




2. If the user scrolls I want to tell my model how much was  
scrolled so it can regenerate a bitmap for display.


Sounds very hacky.




What would probably be better is wait until the view needs to draw  
something, then figure out if that part has been cached as a bitmap  
yet. If so, you can just draw it. If not, you can generate the  
bitmap there and then and then just draw it. This way your document/ 
data model needs to know nothing about the view, in keeping with  
good MVC design. Instead, it waits for the view to ask it for data  
for some portion, and then it has the information about what part of  
the view is being drawn. This approach automatically takes care of  
scrolling, zooming, sizing and so forth without any hacks. The view  
just makes its dirty rects available to the data model when it is  
requesting data. If it slows down drawing too much initially, you  
could use the "no cache data available" state to trigger creation of  
that data, maybe in a background thread, then redraw it when it is  
available. In the meantime you'd have to draw something else, such  
as a blank background or a pattern denoting "no data yet" perhaps.


3. If the window size changes apply a factor to the content view to  
achieve 1 above.


OK, if that makes sense for the app. Sounds a bit weird, but what do  
I know? What happens if the user does some work in the corner of the  
content area then makes the window smaller? Wouldn't that lose that  
work?


--Graham






___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Hiding the Window Content View

2010-01-08 Thread David Blanton
When the content view of a window has setHidden:YES called on it the  
result is a Title Bar, Size Control and a "body" (for lack of a better  
term).  Is it possible to get rid of this "body" leaving just the  
Title Bar and Size Control.  The effect would be that when dragging  
the Title Bar the Size Control moves with the drag and we see the  
desktop in the "body" area.


-db
___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Workspace Configuration

2010-01-08 Thread David Blanton
How I don't know but View / Smart Groups / Error & Warnings wasn't  
on.  But still, using Xcode 3.1.2, why do my previous XC 2.1.4  
projects not show
<>


but only this
<>



On Jan 8, 2010, at 12:12 PM, David Blanton wrote:


OK.  I guess the real question is this:

How do I get theBuild tab to show in this control:



On Jan 8, 2010, at 12:04 PM, Chris Espinosa wrote:



On Jan 8, 2010, at 10:50 AM, David Blanton wrote:

I guess the terminology is Build Log vs. Build Transcript.  I  
cannot see the Build Log when clicking the error indicator (what  
do you call the red circle with a white x that follows the gray  
circle with hammer followed by the word fail, all in the lower  
right corner of the window?)


Control-command-shift-4, drag a rectangle, and paste.  You get  
something like this:




Is that what you mean?

That's the Status Bar (View > Layout > Show/Hide Status Bar).   
Clicking on the error or warning icon opens the Build Results  
window (or tab, depending on your current Layout as specified in  
Preferences > General > Layout).


If you're running Xcode 3.1.x there are four icons in the split bar  
between the Build Results and the editor pane, and the third one  
from the left opens the Build Transcript.  In Xcode 3.2, you can  
open the Build Transcript for an individual step or issue with the  
rollover on the right edge of the step:




or see the full build transcript with the context menu (right-click  
or control-click)




Chris


___
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list  (xcode-us...@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/xcode-users/airedale%40tularosa.net

This email sent to aired...@tularosa.net


___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Flicker Free Drawing

2010-01-08 Thread David Blanton
Does NSBackingStoreBuffered guarantee there will be no flicker when  
drawing?


That is, I won't see the content view background drawn, then myview  
background drawn, then myview whatever I draw into bounds rect ...  
which would be "flicker, flicker" if I am drawing all through resizing  
the window and scrolling the content.


-db
___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Hiding the Window Content View

2010-01-08 Thread David Blanton
I am just trying to find the best way to do rapid drawing with no  
flicker.  I don't see an override on background drawing so I was  
wanting to eliminate the backgroud of the content view.


On Jan 8, 2010, at 1:30 PM, Kyle Sluder wrote:

On Fri, Jan 8, 2010 at 12:01 PM, David Blanton  
 wrote:
When the content view of a window has setHidden:YES called on it  
the result
is a Title Bar, Size Control and a "body" (for lack of a better  
term).  Is
it possible to get rid of this "body" leaving just the Title Bar  
and Size
Control.  The effect would be that when dragging the Title Bar the  
Size
Control moves with the drag and we see the desktop in the "body"  
area.


Sounds like you're trying to make a window that would be used as a
"select a portion of the desktop" device.

You will need to create a borderless window and do everything (resize,
titlebar, etc.) yourself. The actual window shape and opacity is
controlled by private API. In this case it's probably for the best, as
I'm having trouble understanding what you could be trying to implement
that would make sense to do with a window.

(Of course, if you're dead-set on using a window, you could always get
an image of the desktop and draw that into a custom content view, but
that will be a bit slow.)

--Kyle Sluder




___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Flicker Free Drawing

2010-01-08 Thread David Blanton
Great and thanks!  Now, if my app is a Cocoa document-based  
application where do I implement

initWithContentRect:styleMask:backing:defer:

-db
On Jan 8, 2010, at 1:48 PM, Paul Sanders wrote:


Correct.  Nothing happens until the window is 'flushed' (which
normally happens in the event loop).  It is one of the joys of
programming on the Mac (compared to Windows).

Paul Sanders

- Original Message -----
From: "David Blanton" 
To: "cocoa-dev List" 
Sent: Friday, January 08, 2010 8:38 PM
Subject: Flicker Free Drawing


Does NSBackingStoreBuffered guarantee there will be no flicker
when
drawing?

That is, I won't see the content view background drawn, then
myview
background drawn, then myview whatever I draw into bounds rect
...
which would be "flicker, flicker" if I am drawing all through
resizing
the window and scrolling the content.

-db
___

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://lists.apple.com/mailman/options/cocoa-dev/p.sanders%40alpinesoft.co.uk

This email sent to p.sand...@alpinesoft.co.uk







___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Flicker Free Drawing

2010-01-08 Thread David Blanton

I guess I just choose Buffered in Window Attributes in IB.


On Jan 8, 2010, at 1:56 PM, David Blanton wrote:

Great and thanks!  Now, if my app is a Cocoa document-based  
application where do I implement

initWithContentRect:styleMask:backing:defer:

-db
On Jan 8, 2010, at 1:48 PM, Paul Sanders wrote:


Correct.  Nothing happens until the window is 'flushed' (which
normally happens in the event loop).  It is one of the joys of
programming on the Mac (compared to Windows).

Paul Sanders

- Original Message -----
From: "David Blanton" 
To: "cocoa-dev List" 
Sent: Friday, January 08, 2010 8:38 PM
Subject: Flicker Free Drawing


Does NSBackingStoreBuffered guarantee there will be no flicker
when
drawing?

That is, I won't see the content view background drawn, then
myview
background drawn, then myview whatever I draw into bounds rect
...
which would be "flicker, flicker" if I am drawing all through
resizing
the window and scrolling the content.

-db
___

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://lists.apple.com/mailman/options/cocoa-dev/p.sanders%40alpinesoft.co.uk

This email sent to p.sand...@alpinesoft.co.uk







___

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://lists.apple.com/mailman/options/cocoa-dev/airedale%40tularosa.net

This email sent to aired...@tularosa.net




___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Hiding the Window Content View

2010-01-08 Thread David Blanton
Thanks for references and tips. I think I will be able to achieve the  
results I am looking for from all who have commented!


- db

On Jan 8, 2010, at 4:39 PM, Alastair Houghton wrote:


On 8 Jan 2010, at 20:46, David Blanton wrote:

I am just trying to find the best way to do rapid drawing with no  
flicker.


The answer to that question depends rather on what you mean by  
"rapid" and on what you're trying to draw.


The fastest way to draw on Mac OS X is generally OpenGL; it's also  
somewhat lower level than most of the alternatives, and unless you  
need to use it for some other reason it's usually best to go with  
something higher level.


For general drawing (including controls and the main views of the  
majority of applications), Quartz is usually more than fast enough;  
that's true even for fairly complex animation, though there may be  
better alternatives for various kinds of animated content.  Quartz  
usually also gives you the best rendering quality, if that matters  
to you, and has the significant advantage of device independence (so  
you can draw to a printer just as easily as to the display).


If you want to do the kinds of animations you often see in apps  
these days, or in the demo programs Apple shows off in some of its  
presentations, Core Animation is the way to go.  You can use that  
from a view's animator, using layer-backed views, or by creating  
CALayers yourself.


Finally if you're doing image processing, you might want to  
investigate Core Image and/or the Accelerate framework functions  
(vImage, vDSP et al).


In addition, you can do many of these things without any code by  
using Quartz Composer...


There are probably other things I haven't mentioned as well... this  
is just OTOH.


As for flicker, for OpenGL obviously you're going to want to  
configure things for double buffered operation, and you might care  
about display synchronisation too (see QA1385 and QA1521).  The  
higher level APIs flush the window buffers automatically in a manner  
that is synchronised with display refresh so you won't see tearing--- 
though the implication, of course, is that there's a maximum rate at  
which you can draw before the system starts to throttle your updates  
(see TN2133).  If you're using Core Animation, you need not worry  
about this at all as it handles the issue for you.


Kind regards,

Alastair.

--
http://alastairs-place.net





___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


NSScroller knob reposition

2010-01-13 Thread David Blanton

I am seeing some strange behavior.

I set the knob position of the horz and vert scrollers as follows:

- (void)centerScrollers {

[m_hScroller setDoubleValue:0.5];
[m_vScroller setDoubleValue:0.5];

}

Then when I move either knob with the mouse the other knob moves as  
well by some random amount.


Doesn't seem like correct behavior to me.

-db
___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


IBLibraryObjectTemplate

2010-01-14 Thread David Blanton
This appeared automagically in my .xib. Can anyone tell me what this  
is and how it got there:


-db

2010-01-14 11:50:44.021 Customize It[9646:813] Unknown class  
IBLibraryObjectTemplate in Interface Builder file.

___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


NSDocument

2010-01-14 Thread David Blanton
When my document based app starts up the awakeFromNib method in my  
NSDocument subclass is called.


When I choose Open a new NSDocument is instanced but this does not  
call awakeFromNib.


Am I missing a setting?

I need awakeFromNib to be called for any instance on my NSDocument  
sublass.


I am in dire straits on this on,  any help ...appreciated.

-db


___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSDocument

2010-01-14 Thread David Blanton
Thank you for commenting but now I am really confused.  When a project  
is created from the document based template it contains files  
MyDocument.h and MyDocument.m which define the interface and  
implementation for a class MyDocument that inherits from NSDocument.


Whne built and and run if any one of many init methods are implemented  
and awakeFromNib is implemented these are called.


So, I do not understand what you have said.

- db

On Jan 14, 2010, at 1:53 PM, Matt Neuburg wrote:

On Thu, 14 Jan 2010 12:57:57 -0700, David Blanton >

said:

When my document based app starts up the awakeFromNib method in my
NSDocument subclass is called.

When I choose Open a new NSDocument is instanced but this does not
call awakeFromNib.

Am I missing a setting?

I need awakeFromNib to be called for any instance on my NSDocument
sublass.

I am in dire straits on this on,  any help ...appreciated.


In a standard doc-based app, there is no NSDocument instance in the  
nib. So

naturally no NSDocument instance ever awakes from a nib. So naturally
awakeFromNib is never called. The fact that your NSDocument subclass's
awakeFromNib is *ever* called suggests that you have already done  
something

very odd.

Of course I could just be confused, but it sounds to me like you  
might be
asking the wrong question. Is the question how to perform  
initializations as
a document is opened? The Document-Based Applications Overview  
contains a

discussion of this question.

m.

--
matt neuburg, phd = m...@tidbits.com, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
http://www.tidbits.com/matt/default.html#applescriptthings







___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSDocument

2010-01-14 Thread David Blanton
Only one nib (xib) that was created  (MyDocument.xib) when the project  
was created form the document based app template.


I am looking at the Open as Files Owner ... hmm not sure.

Thanks.

-db
On Jan 14, 2010, at 1:27 PM, Quincey Morris wrote:


On Jan 14, 2010, at 11:57, David Blanton wrote:

When my document based app starts up the awakeFromNib method in my  
NSDocument subclass is called.


When I choose Open a new NSDocument is instanced but this does not  
call awakeFromNib.


Am I missing a setting?

I need awakeFromNib to be called for any instance on my NSDocument  
sublass.


'[NSDocument awakeFromNib]' is invoked because (or when, if you  
prefer) the document is File's Owner for the associated nib file.  
Your symptoms would suggest that it's being set as File's Owner when  
a File -> New... is done (since that's what you get for free when  
the application starts up) but not when a File -> Open... is done.  
Is it possible there are two nib files being used in these two  
situations?


If you've set the document's window controller as File's Owner, then  
*it* will get the 'awakeFromNib' instead of the document.


Also, as usual when an application mysteriously fails to do  
something, it's vital to check the log for exception error messages  
-- something I typically forget to do.


Does any of that suggest anything helpful?


___

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://lists.apple.com/mailman/options/cocoa-dev/airedale%40tularosa.net

This email sent to aired...@tularosa.net




___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: IBLibraryObjectTemplate

2010-01-14 Thread David Blanton

Well here it is:

<>



and there is no way to delete it.

Delete in the Edit menu is disabled, delete key does not do it ...

How does one delete this ?

-db
On Jan 14, 2010, at 12:53 PM, Kevin Cathey wrote:

The IBLibraryObjectTemplate is part of InterfaceBuilderKit, the  
framework used to create plugins for Interface Builder. Each  
IBLibraryObjectTemplate corresponds to an entry that appears in the  
library at runtime. For more, see:
http://developer.apple.com/mac/library/documentation/DeveloperTools/Conceptual/IBPlugInGuide/Plug-inQuickStart/Plug-inQuickStart.html#/ 
/apple_ref/doc/uid/TP40004323-CH9-SW9


What has probably happened in your case is that you have  
accidentally added an IBLibraryObjectTemplate object to one of your  
nibs, and not linked against InterfaceBuilderKit, hence the warning  
about the unknown class. I'm assuming you don't want the  
IBLibraryObjectTemplate, so to get rid of it, just find the file  
with the stray IBLibraryObjectTemplate, delete, and you'll be good  
to go. A quick way to do this is: use the search field in Interface  
Builder to search for "IBLibraryObjectTemplate", and that will show  
you which objects (if any) are library object templates.


Kevin


On 14 Jan 2010, at 12:51, David Blanton wrote:

This appeared automagically in my .xib. Can anyone tell me what  
this is and how it got there:


-db

2010-01-14 11:50:44.021 Customize It[9646:813] Unknown class  
IBLibraryObjectTemplate in Interface Builder file.

___

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://lists.apple.com/mailman/options/cocoa-dev/cathey%40apple.com

This email sent to cat...@apple.com






___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: NSDocument

2010-01-14 Thread David Blanton

I do not have an object whose set to MyDocument.

On Jan 14, 2010, at 2:34 PM, Charles Jenkins wrote:

I'm a noob, but I'm gonna give my interpretation anyway and let the  
experts have a chance to correct my misunderstanding.


I think Matt means that if you use IB to look at your MyDocument.nib  
(or .xib), in the window where you see File's Owner and other stuff,  
you should NOT see another NSObject whose Class is set to  
'MyDocument'. If you have that, then your app will instantiate  
MyDocument, which will load the NIB file, which will instantiate  
another MyDocument--and weirdness ensues.


On 2010-01-14 16:19, David Blanton wrote:
Thank you for commenting but now I am really confused.  When a  
project is created from the document based template it contains  
files MyDocument.h and MyDocument.m which define the interface and  
implementation for a class MyDocument that inherits from NSDocument.


Whne built and and run if any one of many init methods are  
implemented and awakeFromNib is implemented these are called.


So, I do not understand what you have said.

- db

On Jan 14, 2010, at 1:53 PM, Matt Neuburg wrote:

On Thu, 14 Jan 2010 12:57:57 -0700, David Blanton >

said:

When my document based app starts up the awakeFromNib method in my
NSDocument subclass is called.

When I choose Open a new NSDocument is instanced but this does not
call awakeFromNib.

Am I missing a setting?

I need awakeFromNib to be called for any instance on my NSDocument
sublass.

I am in dire straits on this on,  any help ...appreciated.


In a standard doc-based app, there is no NSDocument instance in  
the nib. So
naturally no NSDocument instance ever awakes from a nib. So  
naturally
awakeFromNib is never called. The fact that your NSDocument  
subclass's
awakeFromNib is *ever* called suggests that you have already done  
something

very odd.

Of course I could just be confused, but it sounds to me like you  
might be
asking the wrong question. Is the question how to perform  
initializations as
a document is opened? The Document-Based Applications Overview  
contains a

discussion of this question.

m.

--
matt neuburg, phd = m...@tidbits.com, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
http://www.tidbits.com/matt/default.html#applescriptthings







___

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://lists.apple.com/mailman/options/cocoa-dev/cjenkins%40tec-usa.com

This email sent to cjenk...@tec-usa.com



___

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://lists.apple.com/mailman/options/cocoa-dev/airedale%40tularosa.net

This email sent to aired...@tularosa.net




___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSDocument

2010-01-14 Thread David Blanton
No.  This is a vanilla document based app with two nibs, MainMenu and  
MyDocument as created by the project template.


The document window is in MyDocument.xib.


On Jan 14, 2010, at 2:41 PM, Jeffrey Oleander wrote:


On Thu, 2010/01/14, David Blanton  wrote:
From: David Blanton 
Subject: Re: NSDocument
To: "Matt Neuburg" 
Cc: cocoa-dev@lists.apple.com
Date: Thursday, 2010 January 14, 15:19
Thank you for commenting but now I am
really confused.  When a project is created from the
document based template it contains files MyDocument.h and
MyDocument.m which define the interface and implementation
for a class MyDocument that inherits from NSDocument.

Whne built and and run if any one of many init methods are
implemented and awakeFromNib is implemented these are
called.

So, I do not understand what you have said.


I'm not sure what you already know and don't know.

The nib (or the xib from which the nib is generated)
contains resources.  Typically, and application has
a Main Menu nib, which may also contain definitions
for a window.  But an app can have many nibs, each
of which defines different resources.

The main nib gets loaded automagically; the others
only get loaded when they're requested.

The window(s) for your NSDocument sub-class may be
in the main nib or in another.







___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSDocument

2010-01-14 Thread David Blanton

Ok. So I diagnose that MyDocument.xib was somehow hosed.

I deleted my main view which was embedded in a scroll view.

Added a custom view set its class to my class MainView.

Embedded MainView in a scroll view.

Compiled and ran.

And guess what, awakeFromNib in MyDocument.m which is a sub class of  
NSDocument is now being called when I choose open.


Go figure.

Now I still need to delete LibraryObjectTemplate (which mysteriously  
appeared, see separate post) but cannot delete noway no how.


Thanks for the comments.

-db

On Jan 14, 2010, at 3:24 PM, Klaus Backert wrote:



On 14 Jan 2010, at 22:51, David Blanton wrote:

No.  This is a vanilla document based app with two nibs, MainMenu  
and MyDocument as created by the project template.


The document window is in MyDocument.xib.


What is specified as the class of file's owner in the nib/xib file:  
(a subclass of) NSDocument  or (a subclass of) NSWindowController?  
You can set and see this in the inspector's identity panel.


Klaus

___

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://lists.apple.com/mailman/options/cocoa-dev/airedale%40tularosa.net

This email sent to aired...@tularosa.net




___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Scrolling

2010-01-15 Thread David Blanton
A custom view sub-classed from NSView when embedded in an NSScrollView  
has its drawRect method called when the NSScrollers are manipulated by  
the user.


Is there a method further up the (NSResponder?) chain where scoll  
activity can be overridden? And if so, is there an example or sample  
to which I can be referred?


-db
___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Scrolling

2010-01-15 Thread David Blanton

Answered my own question .. trackKnob

I knew this but its behavior was not understood ergo the question.


What would code tracking the knob look like?  I want something like  
(but what would mouseStilldown be?)


- (void)trackKnob:(NSEvent *)theEvent {

while(mouseStillDown)
{
[super trackKnob];

// do something with _curValue
}

do something no that mouse is released

}

Has anyone done something like this?

-db


On Jan 15, 2010, at 9:42 AM, David Blanton wrote:

A custom view sub-classed from NSView when embedded in an  
NSScrollView has its drawRect method called when the NSScrollers are  
manipulated by the user.


Is there a method further up the (NSResponder?) chain where scoll  
activity can be overridden? And if so, is there an example or sample  
to which I can be referred?


-db
___

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://lists.apple.com/mailman/options/cocoa-dev/airedale%40tularosa.net

This email sent to aired...@tularosa.net




___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Scrolling [SOLVED]

2010-01-15 Thread David Blanton
Never mind.  Figured it all out.  If anyone is interested ping me off- 
list.


-db
___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Scrolling [SOLVED]

2010-01-15 Thread David Blanton

Thanks for the heads up Kyle.

The solution was to override trackKnob and in it set a flag that  
scrolling was in play.  Then in my drawRect I check the flag to do  
appropriate scrolling.  Then in coming back from [super trackKnob] I  
knw scrolling is done so I can clear the flag;



- (void)trackKnob:(NSEvent *)theEvent {

m_mainView->m_scrolling = YES;   
m_mainView->m_main.m_data.SetData("fst", 1);
[super trackKnob:theEvent]; 
m_mainView->m_main.m_data.RemoveData("fst");
m_mainView->m_scrolling = NO;
[m_mainView setNeedsDisplay:YES];
if([self frame].size.height > 15)
{
NSLog(@"V Scroller %1.4f", _curValue);
}
else
{
NSLog(@"H Scroller %1.4f", _curValue);
}
}


- (void)drawRect:(NSRect)rect {
[super drawRect:rect];

... 
if(m_scrolling)
{
NSLog(@"drawRect scrolling");

float v = 100*[m_vScroller floatValue];
float h = 100*(1-[m_hScroller floatValue]);
m_main.m_bitmap.SetOrigin(h, v);
}


...

}

On Jan 15, 2010, at 11:58 AM, Kyle Sluder wrote:


Mailing list archives are very useful resources to developers, since
they capture a lot of searches for related terminology that doesn't
appear in the official documentation. Mailing list archives also tend
to strip out email addresses, making it hard for people who encounter
your thread to contact you about the solution. Please share your
solution with the list, it's silently appreciated by many a web
searcher. :)

--Kyle Sluder

On Fri, Jan 15, 2010 at 10:22 AM, David Blanton  
 wrote:
Never mind.  Figured it all out.  If anyone is interested ping me  
off-list.


-db
___

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://lists.apple.com/mailman/options/cocoa-dev/kyle.sluder%40gmail.com

This email sent to kyle.slu...@gmail.com






___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Scrolling [SOLVED]

2010-01-15 Thread David Blanton

Hi Graham -

We generate a bitmap sized to [view visibleRect] so we have to do it  
this way.  Our model is portable, we use it on Windows (which is where  
it was architected). The scrolling is very fast.


As of now we have added a number of elements to our bitmap which can  
be sized and rotated, all very fast.  We have no concerns with the  
performance or the underlying architecture.


We will release a Mac and Windows product (simultaneously) with  
identical features and platform specific UI.  In fact our Mac product  
has no competition..


Thanks for the heads up.

-db

On Jan 15, 2010, at 3:47 PM, Graham Cox wrote:



On 16/01/2010, at 9:19 AM, David Blanton wrote:


- (void)drawRect:(NSRect)rect {
[super drawRect:rect];

... 
if(m_scrolling)
{
NSLog(@"drawRect scrolling");

float v = 100*[m_vScroller floatValue];
float h = 100*(1-[m_hScroller floatValue]);
m_main.m_bitmap.SetOrigin(h, v);
}


...

}



David, It's my belief that your drawing architecture is flawed.  
There should be no need/reason to modify the bitmap that you're  
displaying in the view when it scrolls. Instead, the dirty rects  
tell you which portion of the bitmap needs to be drawn/created.  
Think of the bitmap as your data model (even though it contains  
pixels). It has no business knowing the state of the view.


--Graham







___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Unembed Objects

2010-01-18 Thread David Blanton
I have embeded two views in a split view then embeded that result with  
another view in a split view to get a resulting vert splitter and horz  
splitter.


Now I would like to Uembed an cannot no matter what selections I do  
get Uembed to enable in the IB Layout Menu.


Any suggestions ? Please .

-db

___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Moderated post on self going out of scope

2010-01-18 Thread David Blanton
I posted this with two images from the debugger but it is awaiting  
moderator screening.


In a view IBAction I instance a C++ class. As soon as the class is  
instanced,  self in the variables window, goes to 0x0 !


This worked fine until I embedded the view win a split view!

Now moving the instantiation of the C++ class to the interface it  
works again!


This seems to be a bug.

Comments please, I have a long night ahead!

___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Moderated post on self going out of scope

2010-01-18 Thread David Blanton

Good tips Ken ... I am on it!

On Jan 18, 2010, at 8:28 PM, Ken Thomases wrote:


On Jan 18, 2010, at 9:17 PM, David Blanton wrote:

In a view IBAction I instance a C++ class. As soon as the class is  
instanced,  self in the variables window, goes to 0x0 !


Try logging the value of self, rather than relying on the debugger  
display.  The debugger can sometimes be wrong.


Otherwise, make sure the constructor of your C++ class isn't  
trashing memory.  Sounds like writing past the bounds of a stack  
variable.


If you're doing placement new, you might also be messing that up.

You could try compiling with -fstack-protector-all to try to detect  
stack smashers closer to where/when they happen.


Regards,
Ken






___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Moderated post on self going out of scope

2010-01-18 Thread David Blanton
Ok. The C++ constructor does nothing more than assign a member  
variable by calling a function.


And, the NSLog of self breaks as well!

Hmmm !


On Jan 18, 2010, at 8:32 PM, David Blanton wrote:


Good tips Ken ... I am on it!

On Jan 18, 2010, at 8:28 PM, Ken Thomases wrote:


On Jan 18, 2010, at 9:17 PM, David Blanton wrote:

In a view IBAction I instance a C++ class. As soon as the class is  
instanced,  self in the variables window, goes to 0x0 !


Try logging the value of self, rather than relying on the debugger  
display.  The debugger can sometimes be wrong.


Otherwise, make sure the constructor of your C++ class isn't  
trashing memory.  Sounds like writing past the bounds of a stack  
variable.


If you're doing placement new, you might also be messing that up.

You could try compiling with -fstack-protector-all to try to detect  
stack smashers closer to where/when they happen.


Regards,
Ken






___

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://lists.apple.com/mailman/options/cocoa-dev/airedale%40tularosa.net

This email sent to aired...@tularosa.net





___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Moderated post on self going out of scope

2010-01-18 Thread David Blanton

Oh I forgot to do -fstack-protector-all where do I set that?


On Jan 18, 2010, at 8:28 PM, Ken Thomases wrote:


On Jan 18, 2010, at 9:17 PM, David Blanton wrote:

In a view IBAction I instance a C++ class. As soon as the class is  
instanced,  self in the variables window, goes to 0x0 !


Try logging the value of self, rather than relying on the debugger  
display.  The debugger can sometimes be wrong.


Otherwise, make sure the constructor of your C++ class isn't  
trashing memory.  Sounds like writing past the bounds of a stack  
variable.


If you're doing placement new, you might also be messing that up.

You could try compiling with -fstack-protector-all to try to detect  
stack smashers closer to where/when they happen.


Regards,
Ken






___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Moderated post on self going out of scope

2010-01-18 Thread David Blanton
So I set stack-protector-all as "other C++ flags" and got  
_stack_chk_fail



So this means the C++ constructor is corupting the stack?

-db
On Jan 18, 2010, at 8:28 PM, Ken Thomases wrote:


On Jan 18, 2010, at 9:17 PM, David Blanton wrote:

In a view IBAction I instance a C++ class. As soon as the class is  
instanced,  self in the variables window, goes to 0x0 !


Try logging the value of self, rather than relying on the debugger  
display.  The debugger can sometimes be wrong.


Otherwise, make sure the constructor of your C++ class isn't  
trashing memory.  Sounds like writing past the bounds of a stack  
variable.


If you're doing placement new, you might also be messing that up.

You could try compiling with -fstack-protector-all to try to detect  
stack smashers closer to where/when they happen.


Regards,
Ken






___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Moderated post on self going out of scope

2010-01-19 Thread David Blanton

Yes, the C++  Class is in a BSD Static library.

I am checking the compiler options etc now.

I'll let you know the result.

-db


On Jan 18, 2010, at 10:09 PM, Ken Thomases wrote:


On Jan 18, 2010, at 9:50 PM, David Blanton wrote:

So I set stack-protector-all as "other C++ flags" and got  
_stack_chk_fail



So this means the C++ constructor is corupting the stack?


Sounds like it.  I think the backtrace should indicate where the  
corruption was detected.


Is the C++ class implementation in a library?  Does it have  
different compiler options set than the Objective-C++ file that's  
using it?


If one module thinks the C++ class takes N bytes (on the stack in  
this case) and the module with the constructor thinks it takes M  
bytes, then you can get a result like you're seeing.  The  
constructor code, compiled under one set of assumptions, stores data  
as appropriate for those assumptions.  The client code, compiled  
under a different set of assumptions, may not set aside the number  
of bytes required by the constructor's behavior.


Of course, it may just be a garden variety programmer logic error.   
Have you got all warnings enabled?  Are you addressing all the  
warnings the compiler reports?


You could also show the class declaration, the constructor  
definition, and the method that's instantiating an instance of the  
class (and getting its stack smashed).


Regards,
Ken






___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


View Handling

2010-01-22 Thread David Blanton
I have two views that need to occupy the same space and have their  
visibility toggled via an action.


I first overlaid one on the other setting it hidden, all done in IB.

Then in code set one hidden the other visible at which time it dawned  
on me that one view was contained in the other and that hiding the  
containing view hide both.


So my question. "What is the 'proper' means of handling this situation?"

I could guess:

1. Remove View 1 from window content view
2. Add View 2 to window content view
3. Position View 2.


But this seems awkward.

Suggestions please.

-db

___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: View Handling

2010-01-22 Thread David Blanton

NSTabView w/o tabs ... yeah that's the ticket!

Thanks.

-db

On Jan 22, 2010, at 4:45 PM, Scott Anguish wrote:


NSTabView with tabs that aren’t visible?

On Jan 22, 2010, at 4:57 PM, David Blanton wrote:

I have two views that need to occupy the same space and have their  
visibility toggled via an action.


I first overlaid one on the other setting it hidden, all done in IB.

Then in code set one hidden the other visible at which time it  
dawned on me that one view was contained in the other and that  
hiding the containing view hide both.


So my question. "What is the 'proper' means of handling this  
situation?"


I could guess:

1. Remove View 1 from window content view
2. Add View 2 to window content view
3. Position View 2.


But this seems awkward.

Suggestions please.

-db

___

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://lists.apple.com/mailman/options/cocoa-dev/scott%40cocoadoc.com

This email sent to sc...@cocoadoc.com







___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


NSComboBox or Better Choice

2010-01-25 Thread David Blanton
I would like to display an image and descriptive text is some sort of  
popup list such as an NSComboBox.


Can the NSComboBoxCell draw method  be overridden to display an image  
along with text?


Or, what is the best way to accomplish a pop up list of images and  
descriptive text?


-db



___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


NSTabView

2010-01-25 Thread David Blanton
I have a fixed size NSTabView that displays 4 NSTabViewITems very  
nicely.


It is possible that the application may want to add more NSTabViewItems.

Is there a flag to set (somewhere) so that added items will not be  
truncated to the view but display >> like Safari indicating more items  
and then displaying them in a menu?


-db

___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Observed behaviour - Is this expected

2010-01-25 Thread David Blanton

Class A is a subclass of NSView
Class B is a subclass of Class A

Class A and Class B are in a NIB.

Class A as an Object - the blue cube
Class B as a view in a window.

When the program runs:

Class A's init method is called
Class B's awakeFromNib is called
Class A's awakeFromNib is called

NOTE that Class B's init method is not called

My problem is I want to  reference outlets defined in Class A in Class  
B awakeFromNib but they are nil at Class B awakeFromNib time.



I was under the impression that at awakeFromNib time all outlets in  
all NIB objects are wired up.


So what do I not understand?

-db

___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Observed behaviour - Is this expected

2010-01-25 Thread David Blanton


On Jan 25, 2010, at 8:51 PM, Kyle Sluder wrote:

On Mon, Jan 25, 2010 at 7:43 PM, David Blanton  
 wrote:

Class A is a subclass of NSView
Class B is a subclass of Class A

Class A and Class B are in a NIB.


Classes don't live in nibs. You mean an object of class A and an
object of class B live in the nib.


Class A as an Object - the blue cube
Class B as a view in a window.


So your instance of A and your instance of B are entirely unrelated.


Well, dosen't

@interface ClassB : ClassA

say they are related?






When the program runs:

Class A's init method is called
Class B's awakeFromNib is called
Class A's awakeFromNib is called


Class B will have been initialized with -initWithFrame:, as documented
in the Resource Programming Guide:
http://developer.apple.com/mac/library/DOCUMENTATION/Cocoa/Conceptual/LoadingResources/CocoaNibs/CocoaNibs.html



I have a breakpoint on Class B's initWithFrame and it is never hit ...

@implementation ClassB

- (id) initWithFrame:(NSRect)frame
{
self = [super initWithFrame:frame];
if (self != nil)
{

}
return self;
}



As the documentation explains, your instance of class A is encoded as
an object placeholder, whereas your instance of class B has been
encoded as a custom view placeholder.

--Kyle Sluder




___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Observed behaviour - Is this expected

2010-01-25 Thread David Blanton
OK.  What I wanted was to have only one reference to the outlets in  
the 'base class' that can be used in the sub classes.


I did not realize I had to connect the outlets defined in the base  
class through the sub class.


I have the behavior I was expecting now.

Thanks Kyle for the pointer to the CocoaNibs.html

-db


On Jan 25, 2010, at 8:51 PM, Kyle Sluder wrote:

On Mon, Jan 25, 2010 at 7:43 PM, David Blanton  
 wrote:

Class A is a subclass of NSView
Class B is a subclass of Class A

Class A and Class B are in a NIB.


Classes don't live in nibs. You mean an object of class A and an
object of class B live in the nib.


Class A as an Object - the blue cube
Class B as a view in a window.


So your instance of A and your instance of B are entirely unrelated.



When the program runs:

Class A's init method is called
Class B's awakeFromNib is called
Class A's awakeFromNib is called


Class B will have been initialized with -initWithFrame:, as documented
in the Resource Programming Guide:
http://developer.apple.com/mac/library/DOCUMENTATION/Cocoa/Conceptual/LoadingResources/CocoaNibs/CocoaNibs.html

As the documentation explains, your instance of class A is encoded as
an object placeholder, whereas your instance of class B has been
encoded as a custom view placeholder.

--Kyle Sluder





___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSTabView

2010-01-26 Thread David Blanton
Ok, so there is no flag to set.  So how would one deal with the  
situation I described?

I want to see all the tab items ... are there multiple rows?
Any help or suggestions, please.

-db


On Jan 25, 2010, at 11:46 PM, Scott Anguish wrote:



On Jan 25, 2010, at 10:34 PM, David Blanton wrote:

I have a fixed size NSTabView that displays 4 NSTabViewITems very  
nicely.


It is possible that the application may want to add more  
NSTabViewItems.


Is there a flag to set (somewhere) so that added items will not be  
truncated to the view but display >> like Safari indicating more  
items and then displaying them in a menu?


No.



___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


NSSlider

2010-01-28 Thread David Blanton

I cannot discern a method that tracks the knob on and NSSlider.

Is it possible to track an NSSlider?

-db
___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSSlider

2010-01-28 Thread David Blanton

Continuous Check Box did the trick .. Thanks!

-db
On Jan 28, 2010, at 10:11 AM, Jens Alfke wrote:



On Jan 28, 2010, at 9:05 AM, David Blanton wrote:


I cannot discern a method that tracks the knob on and NSSlider.


Check the "continuous" checkbox in IB (or set the object property of  
the same name) and your target will get called while the user drags,  
as soon as the position changes.


—Jens



___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Rosetta Quandry

2010-02-02 Thread David Blanton

I run my app on my Intel MacBook Pro.

Get Info shows it as Universal.

I have a customer who must turn Rosetta on else the app crashes.

Is there any rhyme or reason to this?

-db

___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Rosetta Quandry

2010-02-02 Thread David Blanton
Yes, I have the crash log that is generated when launching with  
Rosetta off which I include here for list perusal. Interestingly, I  
just got off the phone with an Apple Consulting Engineer who let me  
know that there have been problems (mostly video) with the 27" iMac  
where this problem manifests itself. There have been two firmware  
updates.  we have seen this problem ONLY on 27" iMacs.  Makes ya wonder!


Process: Convert it [160]
Path:/Applications/realConvert it.app/Contents/MacOS/ 
Convert it

Identifier:  com.BriTonLeap.convertitmac
Version: 1.44 (7309)
Code Type:   X86 (Native)
Parent Process:  launchd [98]

Date/Time:   2010-02-01 18:12:24.886 -0600
OS Version:  Mac OS X 10.6.2 (10C2234)
Report Version:  6

Interval Since Last Report:  557183 sec
Crashes Since Last Report:   100
Per-App Interval Since Last Report:  1716 sec
Per-App Crashes Since Last Report:   12
Anonymous UUID:  8481F5B9-3ADA-4E03- 
B92E-3BD0AE4CD4E3


Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x, 0x
Crashed Thread:  0  Dispatch queue: com.apple.main-thread

Application Specific Information:
abort() called

Thread 0 Crashed:  Dispatch queue: com.apple.main-thread
0   libSystem.B.dylib   0x97852732 __kill + 10
1   libSystem.B.dylib   0x97852724 kill$UNIX2003 + 32
2   libSystem.B.dylib   0x978e598d raise + 26
3   libSystem.B.dylib   0x978fba44 abort + 93
4   libstdc++.6.dylib 	0x95628fda  
__gnu_cxx::__verbose_terminate_handler() + 433
5   libstdc++.6.dylib 	0x9562717a  
__cxxabiv1::__terminate(void (*)()) + 10
6   libstdc++.6.dylib 	0x956271ba  
__cxxabiv1::__unexpected(void (*)()) + 0
7   libstdc++.6.dylib 	0x956272b8  
__gxx_exception_cleanup(_Unwind_Reason_Code, _Unwind_Exception*) + 0
8   libstdc++.6.dylib 	0x95627658 operator new(unsigned  
long) + 101
9   libstdc++.6.dylib 	0x95627703 operator new[](unsigned  
long) + 17

10  com.BriTonLeap.convertitmac 0xd79e 0x1000 + 51102
11  com.BriTonLeap.convertitmac   	0x0006be3b  
LinkedList::RemoveAt(__POSITION*) + 1333
12  com.BriTonLeap.convertitmac   	0x0006cc8b  
LinkedList::RemoveAt(__POSITION*) + 4997

13  com.BriTonLeap.convertitmac 0x0002f520 0x1000 + 189728
14  com.BriTonLeap.convertitmac 0x0002fc26 0x1000 + 191526
15  com.BriTonLeap.convertitmac 0x00022e26 0x1000 + 138790
16  com.apple.Foundation0x95bfc270 _nsnote_callback + 345
17  com.apple.CoreFoundation  	0x974f69a9 __CFXNotificationPost +  
905
18  com.apple.CoreFoundation  	0x974f63da  
_CFXNotificationPostNotification + 186
19  com.apple.Foundation  	0x95bf1094 -[NSNotificationCenter  
postNotificationName:object:userInfo:] + 128
20  com.apple.Foundation  	0x95bfe471 -[NSNotificationCenter  
postNotificationName:object:] + 56
21  com.apple.AppKit  	0x9155c73a -[NSApplication  
_postDidFinishNotification] + 125
22  com.apple.AppKit  	0x9155c64a -[NSApplication  
_sendFinishLaunchingNotification] + 74
23  com.apple.AppKit  	0x916b3595 - 
[NSApplication(NSAppleEventHandling) _handleAEOpen:] + 274
24  com.apple.AppKit  	0x916b31b5 - 
[NSApplication(NSAppleEventHandling) _handleCoreEvent:withReplyEvent:]  
+ 101
25  com.apple.Foundation  	0x95c31404 -[NSAppleEventManager  
dispatchRawAppleEvent:withRawReply:handlerRefCon:] + 511
26  com.apple.Foundation  	0x95c311c8  
_NSAppleEventManagerGenericHandler + 228
27  com.apple.AE  	0x9067ff3a  
aeDispatchAppleEvent(AEDesc const*, AEDesc*, unsigned long, unsigned  
char*) + 166
28  com.apple.AE  	0x9067fe39  
dispatchEventAndSendReply(AEDesc const*, AEDesc*) + 43

29  com.apple.AE0x9067fd46 aeProcessAppleEvent + 197
30  com.apple.HIToolbox 0x96677301 AEProcessAppleEvent + 50
31  com.apple.AppKit0x9152cd02 _DPSNextEvent + 1420
32  com.apple.AppKit  	0x9152c306 -[NSApplication  
nextEventMatchingMask:untilDate:inMode:dequeue:] + 156

33  com.apple.AppKit0x914ee49f -[NSApplication run] + 821
34  com.apple.AppKit0x914e6535 NSApplicationMain + 574
35  com.BriTonLeap.convertitmac 0x2b92 0x1000 + 7058
36  com.BriTonLeap.convertitmac 0x2ab9 0x1000 + 6841



On Feb 2, 2010, at 8:48 PM, Nick Zitzmann wrote:



On Feb 2, 2010, at 8:07 PM, David Blanton wrote:


I run my app on my Intel MacBook Pro.

Get Info shows it as Universal.

I have a customer who must turn Rosetta on else the app crashes.

Is there any rhyme or reason to this?


Assuming you meant to put an "or" between the "on" and "else", did  
you ask the user for the crash log and anything that gets logged to  
the 

Re: Rosetta Quandry

2010-02-02 Thread David Blanton
I can't answer that just now as this is a joint development effort and  
some of the libs I link I am not intimately familiar with.  They are C+ 
+.


So you surmise and exception is being raised in x86 code and not ppc  
code. Interesting.


Thanks, I now have a path to travel.

-db

On Feb 2, 2010, at 9:20 PM, Nick Zitzmann wrote:



On Feb 2, 2010, at 9:11 PM, David Blanton wrote:

Yes, I have the crash log that is generated when launching with  
Rosetta off which I include here for list perusal. Interestingly, I  
just got off the phone with an Apple Consulting Engineer who let me  
know that there have been problems (mostly video) with the 27" iMac  
where this problem manifests itself. There have been two firmware  
updates.  we have seen this problem ONLY on 27" iMacs.  Makes ya  
wonder!


It looks like you're using some C++ code. Have you installed any C++  
exception handlers? I suspect you've got an exception that is being  
thrown for whatever reason and is not being caught, and it's causing  
a crash.


Nick Zitzmann
<http://www.chronosnet.com/>








___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Rosetta Quandry

2010-02-02 Thread David Blanton
No 3rd pty.   All libs we link are ours and all our projects /  
targets  specify universal 32-bit.



On Feb 2, 2010, at 9:55 PM, Richard Penwell wrote:

This is most likely because you are referencing a Framework that is  
PPC only.  The code for your application may be universal, but if  
the system detects that one of the dependancies is PPC, it will use  
Rosetta to run the PPC in your fat binary binding to that  
framework.  Are you using any 3rd party frameworks?


What does the crash look like?


Richard

On Feb 2, 2010, at 10:48 PM, Nick Zitzmann wrote:



On Feb 2, 2010, at 8:07 PM, David Blanton wrote:


I run my app on my Intel MacBook Pro.

Get Info shows it as Universal.

I have a customer who must turn Rosetta on else the app crashes.

Is there any rhyme or reason to this?


Assuming you meant to put an "or" between the "on" and "else", did  
you ask the user for the crash log and anything that gets logged to  
the console at the time of the crash?


Nick Zitzmann
<http://www.chronosnet.com/>



___

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://lists.apple.com/mailman/options/cocoa-dev/almightylinuxgod%40me.com

This email sent to almightylinux...@me.com







___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Rosetta Quandry

2010-02-02 Thread David Blanton

Jens-

Your narrative of the stack is spot on.

I tracked this down to a node allocation in LinkedList setting is data  
value to a string of type Str from a lib I use (I compile it, have the  
source).  With this lib I have found problems with ownership of chc  
buffers.  I modified the =operator that was being called to set the  
node value so that in the RemoveAt we remove something we own.


Haven't tested this on 27" iMac yet, will do so tomorrow.


One clarification.  This error occurs with Rosetta off, setting  
Rosetta on allow the program to run.  I am highly suspect of the 27"  
iMac since Apple has done two firmware update, held shipment for three  
weeks at on time, and I only get this error on three customer's 27"  
iMacs.


-db

On Feb 2, 2010, at 10:52 PM, Jens Alfke wrote:



On Feb 2, 2010, at 8:11 PM, David Blanton wrote:

4   libstdc++.6.dylib 	0x95628fda  
__gnu_cxx::__verbose_terminate_handler() + 433
5   libstdc++.6.dylib 	0x9562717a  
__cxxabiv1::__terminate(void (*)()) + 10
6   libstdc++.6.dylib 	0x956271ba  
__cxxabiv1::__unexpected(void (*)()) + 0
7   libstdc++.6.dylib 	0x956272b8  
__gxx_exception_cleanup(_Unwind_Reason_Code, _Unwind_Exception*) + 0
8   libstdc++.6.dylib 	0x95627658 operator new(unsigned  
long) + 101
9   libstdc++.6.dylib 	0x95627703 operator new[] 
(unsigned long) + 17

10  com.BriTonLeap.convertitmac 0xd79e 0x1000 + 51102
11  com.BriTonLeap.convertitmac   	0x0006be3b  
LinkedList::RemoveAt(__POSITION*) + 1333
12  com.BriTonLeap.convertitmac   	0x0006cc8b  
LinkedList::RemoveAt(__POSITION*) + 4997

13  com.BriTonLeap.convertitmac 0x0002f520 0x1000 + 189728
14  com.BriTonLeap.convertitmac 0x0002fc26 0x1000 + 191526
15  com.BriTonLeap.convertitmac 0x00022e26 0x1000 + 138790
16  com.apple.Foundation0x95bfc270 _nsnote_callback + 345


So, a Cocoa notification handler method somewhere in your code is  
calling a C++ method on a LinkedList class, which calls operator new  
to allocate memory, and that's throwing an exception. (It's probably  
an out-of-memory exception; that's about the only exception operator  
new will throw.) There's no 'catch' block anywhere on the stack, so  
the C++ runtime aborts the process.


The top possibilities, in sort-of descending order of likelihood  
(IMHO) are:
(a) The call to operator new is passing a ridiculously huge size  
that exceeds the amount of free address space. This can infamously  
happen if the size calculation comes up negative, since the size  
parameter is unsigned.
(b) The process has actually run out of address space (a 32-bit  
process has between 2 and 3 GB of free space for malloc), maybe due  
to some terrible memory leak.
(c) The process's heap is corrupt, but in such a way that malloc  
doesn't detect the corruption but instead thinks there's no free  
space.


Why does this only happen in Rosetta? Probably some random factor  
that triggers the bug when running x86 but not PPC. Maybe the bug  
depends on little-endian storage, or the particular stack layout...


—Jens




___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSFullUserName() always returns the user name at app launch?

2010-02-04 Thread David Blanton
No.  They are logged n a user A,  changing the name to user B is  
meaningless until they log out / login in.


My guess anyway.

On Feb 4, 2010, at 9:26 AM, Joar Wingfors wrote:



On 4 feb 2010, at 00.27, Laurent Daudelin wrote:

I'm using NSFullUserName() to get the user name of the currently  
logged user and from my application, the user can open the Accounts  
preference pane to edit it. Problem is, after the user changes his  
user name, another call to NSFullUserName() still returns the  
original user name. Is this a bug or what?



Not sure, but it sounds like something you should file a bug report  
about in any case:





BTW, supporting 10.4 (preventing the user of  
NSPreferencePanesDirectory, how can one can safely builds the path  
to "Accounts.prefPane" and make sure it will work even if the  
system runs under a different language than English?



The file system on Mac OS X is always in English, even though it  
might be presented localized to the user.



j o a r


___

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://lists.apple.com/mailman/options/cocoa-dev/airedale%40tularosa.net

This email sent to aired...@tularosa.net





___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


selectItemWithObjectValue

2010-02-19 Thread David Blanton

I get this warning, but I never call these methods:


2010-02-19 09:56:29.975 Customize It[338:10b] *** -[NSComboBoxCell  
selectItemWithObjectValue:] should not be called when usesDataSource  
is set to YES
2010-02-19 09:56:29.976 Customize It[338:10b] *** -[NSComboBoxCell  
indexOfItemWithObjectValue:] should not be called when usesDataSource  
is set to YES



I do call

[self setStringValue:@"Normal"];
[self selectItemWithObjectValue:@"Normal"];

where self is a subclass of NSComboBox.  According to the docs this is  
one way of setting a combo box value that works for both internal and  
external data sources.


So, I am wondering why the warning ... I like to clear all warnings :)

-db


From the docs:

And this code initializes the combo box’s text field to “Red” and  
selects it from the list if available. Note that this works for combo  
boxes with either internal or external data sources:


[myComboBox setStringValue:@"Red"];
[myComboBox 
selectItemWithObjectValue:@"Red"];___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: selectItemWithObjectValue

2010-02-19 Thread David Blanton
Not really, as I call selectWithObjectValue  on an NSComboBox and the  
warning is on an NSComboboxCell


but so what , I am doing just what the docs say and I get the  
warning ... that is the essence of the question



On Feb 19, 2010, at 1:48 PM, Kyle Sluder wrote:

On Fri, Feb 19, 2010 at 9:24 AM, David Blanton  
 wrote:

I get this warning, but I never call these methods:
2010-02-19 09:56:29.975 Customize It[338:10b] *** -[NSComboBoxCell
selectItemWithObjectValue:] should not be called when  
usesDataSource is set

to YES
I do call
   [self selectItemWithObjectValue:@"Normal"];


You contradict yourself. ;-)

--Kyle Sluder





___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Application Menu - Preferences

2010-02-24 Thread David Blanton
In an NSDocument app where should or how should the Application  
Preferences menu item be connected?


-db

___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Application Menu - Preferences

2010-02-24 Thread David Blanton

Good Tip.  Thanks.

What I was really getting at is how to set the target / action for  
when the item is selected.  Here is what I did,  so if this is way off  
base please let me know.


I sub-classed NSMenuItem and set the Preferences menu item to this  
class.


In the awakeFromNib I set the target and action.

Am I doing too much?  Is there a 'less code' approach?

-db

On Feb 24, 2010, at 1:46 PM, Paul Bruneau wrote:



On Feb 24, 2010, at 3:28 PM, David Blanton wrote:

In an NSDocument app where should or how should the Application  
Preferences menu item be connected?


This is kind of old, and its main focus is bindings, but it gives  
you everything you need I think


http://developer.apple.com/cocoa/cocoabindings.html






___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Application Menu - Preferences

2010-02-24 Thread David Blanton

First, thanks to all for a great discussion / learning experience !

It seems cleaner to me to put the preferences window in a separate  
NIB and have the app delegate create the window controller that  
loads the separate NIB.


Is the approach I have taken ... works great !


On Feb 24, 2010, at 2:39 PM, Quincey Morris wrote:


On Feb 24, 2010, at 12:58, David Blanton wrote:

What I was really getting at is how to set the target / action for  
when the item is selected.  Here is what I did,  so if this is way  
off base please let me know.


I sub-classed NSMenuItem and set the Preferences menu item to this  
class.


In the awakeFromNib I set the target and action.

Am I doing too much?  Is there a 'less code' approach?


Maybe I'm missing a detail of your requirements, but this seems like  
the hard way.


Simply set the Preferences menu item target to First Responder (i.e.  
nil) and its action to a method name of your choosing. Implement  
that method in your application delegate. The action travels up the  
responder chain to the application and then finally to the  
application delegate, where your method will be found.


Your application delegate can then do whatever is necessary to  
display the preferences (such as creating a window controller the  
first time, and telling it to display the window).


Note: Paul suggested a slightly different way, connecting the action  
to something in the NIB file. That works fine too, but the drawback  
with such an approach is that you have to load up your main menu NIB  
file with additional windows and views. It seems cleaner to me to  
put the preferences window in a separate NIB and have the app  
delegate create the window controller that loads the separate NIB.



___

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://lists.apple.com/mailman/options/cocoa-dev/airedale%40tularosa.net

This email sent to aired...@tularosa.net





___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


How to call on id

2010-02-24 Thread David Blanton

I have an ivar tyoed as id as

id  m_view

at some point m_view gets set to a particular view

I would like to send messages to m_view as [m_view selector] but since  
it is not typed I get the message


'struct objc_object' has no member named 'selector'

How does one work with / around this issue?

-db

___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How to call on id

2010-02-24 Thread David Blanton

I misspoke earlier.

What I want to do is access an an ivar in m_view such as m_cpp wher  
m_cpp is an instance of a C++ class and then call functions on m_cpp  
such as


m_view->m_cpp.Function()

but I get 'struct objc_object' has no member named 'm_cppr'

My apologies for not being precise earlier !




On Feb 24, 2010, at 8:31 PM, David Blanton wrote:


I have an ivar tyoed as id as

id  m_view

at some point m_view gets set to a particular view

I would like to send messages to m_view as [m_view selector] but  
since it is not typed I get the message


'struct objc_object' has no member named 'selector'

How does one work with / around this issue?

-db

___

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://lists.apple.com/mailman/options/cocoa-dev/airedale%40tularosa.net

This email sent to aired...@tularosa.net





___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How to call on id

2010-02-24 Thread David Blanton

Yeah!  2)  looks like the answer ... I  am trying now ... Thanks!

-db

On Feb 24, 2010, at 8:52 PM, Andrew Farmer wrote:


On 24 Feb 2010, at 19:43, David Blanton wrote:

I misspoke earlier.

What I want to do is access an an ivar in m_view such as m_cpp wher  
m_cpp is an instance of a C++ class and then call functions on  
m_cpp such as


m_view->m_cpp.Function()

but I get 'struct objc_object' has no member named 'm_cppr'


Your best bet is to either:

1. Declare m_cpp as @public in the class's @interface, cast m_view  
to the correct class, and access m_cpp as shown above, or - better  
yet -


2. Define an accessor method on the class and use it: [m_view  
mCppAccessorThing].Function();





___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


NSColorPanel changeColor not called

2010-02-24 Thread David Blanton

changeColor is listed as a delegate method for NSColorPanel

Here is my code

- (IBAction)color:(id)sender {

NSColorPanel* cp;
cp = [NSColorPanel sharedColorPanel];
[cp setDelegate:self];
[cp setContinuous:YES];
NSLog(@"%@",[cp delegate]);
[NSApp runModalForWindow:cp];
[cp orderOut:cp];
}

- (void)changeColor:(id)sender {

NSLog(@"changeColor");
}

and console output showing the delegate

2010-02-24 23:40:33.810 Customize It[7097:813] 

but changeColor is never called


Am I missing something obvious?

-db
___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSColorPanel changeColor not called

2010-02-24 Thread David Blanton

Well, no.

I have run it

modal from a modal panel
non-modal from a modal panel
non-modal from a non-modal panel

changeColor is never called.

I am stumped and going to pour a glass of wine and play a game of  
chess !


- db

On Feb 24, 2010, at 11:53 PM, Graham Cox wrote:



On 25/02/2010, at 5:44 PM, David Blanton wrote:


Am I missing something obvious?



Generally apps don't run the color panel modally. I believe there is  
a way to do it, I've seen it in some apps with an added OK/Cancel  
button, though it seems rare and weird. It may be that running it  
this way works differently, or maybe what you're doing is just  
unsupported.


Either way, running the panel 'normally' , i.e. as a modeless  
floater, should work.


--Graham






___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSColorPanel changeColor not called

2010-02-25 Thread David Blanton
Yes,  I had done that before also to no avail.  But thinking I might  
have been tired and erred I have done it again.
Still does not work.  I am including the code and a link to a debug  
picture that shows all is set correctly (as far as I can tell).

Would someone be willing to run this code and post results?
Might Apple comment or weigh in on this?

- db

The code: (in this example I moved cp to be an ivar thinking there was  
some scope issue)



NSColorPanel* cp;


- (IBAction)color:(id)sender {


cp = [NSColorPanel sharedColorPanel];
[cp setDelegate:self];
[cp setTarget:self];
[cp setAction:@selector(changeColor:)];
[cp setContinuous:YES];
[NSApp runModalForWindow:cp];
[cp orderOut:cp];
}

- (void)changeColor:(id)sender {

NSLog(@"changeColor");
}

- (void)windowWillClose:(NSNotification *)notification {

[NSApp stopModalWithCode:0];
}


A link to an annotated picture of the variables

http://crusaderrabbit.net/NSColorPanel.jpg






On Feb 25, 2010, at 12:30 AM, Graham Cox wrote:

Ah, your reply prompted me to review the documentation, which I  
believe is in error.


It's not the delegate that gets sent this message, it's the panel's  
target. use -setTarget: instead. -changeColor: is also sent to the  
responder chain regardless.


The documentation lists -changeColor: under "delegate methods" but  
the panel only inherits the delegate methods of NSWindow, etc.


--Graham





On 25/02/2010, at 6:21 PM, David Blanton wrote:


Well, no.

I have run it

modal from a modal panel
non-modal from a modal panel
non-modal from a non-modal panel

changeColor is never called.

I am stumped and going to pour a glass of wine and play a game of  
chess !


- db

On Feb 24, 2010, at 11:53 PM, Graham Cox wrote:



On 25/02/2010, at 5:44 PM, David Blanton wrote:


Am I missing something obvious?



Generally apps don't run the color panel modally. I believe there  
is a way to do it, I've seen it in some apps with an added OK/ 
Cancel button, though it seems rare and weird. It may be that  
running it this way works differently, or maybe what you're doing  
is just unsupported.








___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


NSDeviceResolution

2010-02-25 Thread David Blanton
[window deviceDescription] is to return an NSDictionary of device  
description data


NSDeviceResolution key is to return an NSString representing an NSSIze

Calling NSSizeFromString on this returned string causes and exception

-[NSConcreteValue getCString:maxLength:encoding:]: unrecognized  
selector sent to instance 0x130165e0


here is the code

- (NSSize)deviceDPI {

NSDictionary* dd = [m_window deviceDescription];
NSString* v = [dd valueForKey:NSDeviceResolution];
NSSize sz = NSSizeFromString(v);
return sz;
}


v is @"{72, 72}" when print-object is called on it in the debugger


I do not see anything wrong with the code ... do you?

-db
___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSColorPanel changeColor not called [work around]

2010-02-25 Thread David Blanton
I replaced calling NSColorPanel from a button click by using an  
NSColorWell and setting an action on it.


Looks more Mac like as you see the current color before getting the  
picker


Still would like to know why changeColor isn't called, eh Apple?

-db



On Feb 25, 2010, at 9:30 AM, David Blanton wrote:

Yes,  I had done that before also to no avail.  But thinking I might  
have been tired and erred I have done it again.
Still does not work.  I am including the code and a link to a debug  
picture that shows all is set correctly (as far as I can tell).

Would someone be willing to run this code and post results?
Might Apple comment or weigh in on this?

- db

The code: (in this example I moved cp to be an ivar thinking there  
was some scope issue)



NSColorPanel* cp;


- (IBAction)color:(id)sender {


cp = [NSColorPanel sharedColorPanel];
[cp setDelegate:self];
[cp setTarget:self];
[cp setAction:@selector(changeColor:)];
[cp setContinuous:YES];
[NSApp runModalForWindow:cp];
[cp orderOut:cp];
}

- (void)changeColor:(id)sender {

NSLog(@"changeColor");
}

- (void)windowWillClose:(NSNotification *)notification {

[NSApp stopModalWithCode:0];
}


A link to an annotated picture of the variables

http://crusaderrabbit.net/NSColorPanel.jpg






On Feb 25, 2010, at 12:30 AM, Graham Cox wrote:

Ah, your reply prompted me to review the documentation, which I  
believe is in error.


It's not the delegate that gets sent this message, it's the panel's  
target. use -setTarget: instead. -changeColor: is also sent to the  
responder chain regardless.


The documentation lists -changeColor: under "delegate methods" but  
the panel only inherits the delegate methods of NSWindow, etc.


--Graham





On 25/02/2010, at 6:21 PM, David Blanton wrote:


Well, no.

I have run it

modal from a modal panel
non-modal from a modal panel
non-modal from a non-modal panel

changeColor is never called.

I am stumped and going to pour a glass of wine and play a game of  
chess !


- db

On Feb 24, 2010, at 11:53 PM, Graham Cox wrote:



On 25/02/2010, at 5:44 PM, David Blanton wrote:


Am I missing something obvious?



Generally apps don't run the color panel modally. I believe there  
is a way to do it, I've seen it in some apps with an added OK/ 
Cancel button, though it seems rare and weird. It may be that  
running it this way works differently, or maybe what you're doing  
is just unsupported.








___

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://lists.apple.com/mailman/options/cocoa-dev/airedale%40tularosa.net

This email sent to aired...@tularosa.net





___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSDeviceResolution

2010-02-25 Thread David Blanton

I did the below ... duh, all good now!

On Feb 25, 2010, at 2:50 PM, Greg Parker wrote:


NSValue* v = [dd valueForKey:NSDeviceResolution];
NSSize sz = [v sizeValue];


___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


NSMenuItem Action

2010-02-27 Thread David Blanton

What is the best practice for connecting menu items to their actions?

Is it IB, is programatically?

If IB what is the process?

- db

___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSMenuItem Action

2010-02-27 Thread David Blanton

Thanks for the 2 cents ... hope my app will turn it into many dollars!

-db

On Feb 27, 2010, at 12:50 PM, Steven Degutis wrote:

Generally connecting them in IB works just fine. Sometimes this  
won't be possible, though, and you should use code to do that (like  
when creating items in code). But, keep in mind that the First  
Responder is in every NIB file, and works amazingly when you have a  
menu item that exists in a NIB, and know what action it sends, but  
do NOT know what target it sends it to until runtime. Read more  
about First Responder in Apple's docs, naturally.


-Steven's 2¢

On Sat, Feb 27, 2010 at 2:40 PM, David Blanton  
 wrote:

What is the best practice for connecting menu items to their actions?

Is it IB, is programatically?

If IB what is the process?

- db

___

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://lists.apple.com/mailman/options/cocoa-dev/steven.degutis%40gmail.com

This email sent to steven.degu...@gmail.com



--
Steven Degutis
http://www.thoughtfultree.com/
http://www.degutis.org/


___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


  1   2   3   >