Re: XML serialization and deserialization

2008-07-25 Thread Chris Hanson

On Jul 24, 2008, at 11:16 PM, Phil wrote:

On Fri, Jul 25, 2008 at 6:06 PM, Oleg Krupnov  
<[EMAIL PROTECTED]> wrote:

I have read it now and I believe the guide suggests that i archive my
object tree in a binary byte stream, not an XML. There are no
implementations of NSCoder that would output XML, are there?



NSKeyedArchiver can, see it's -setOutputFormat: method.


What NSKeyedArchiver outputs is a keyed archive structured as an XML  
property list.  It's not the kind of XML that Oleg is referring to.


Oleg: That's the sort of thing you'd have to implement yourself.   
However, you may be able to leverage NSCoding in your implementation,  
by making your XML archiver & unarchiver subclasses of NSCoder.


 -- Chris

___

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 [EMAIL PROTECTED]


Re: Folder has limited permissions.

2008-07-25 Thread Macarov Anatoli

When user has a standard account (not administrator), he/she doesn't have 
rights to create a file in the Directory /Applications/. I try to create a file 
with the help of function authopen. This code doesn't work:

FILE *pFile = popen("/usr/libexec/authopen -stdoutpipe 
sys.openfile.readwritecreate./applications/tolea.txt", "w"); 
if(pFile == NULL){
NSLog(@"NOT Create");
}else{
NSLog(@"Create");
char *data = "Create";
pwrite(data, 1, size(data), pFile); 
}
pclose(pFile);

How would be the correct way to do?




  
Вы уже с Yahoo!? 
Испытайте обновленную и улучшенную. Yahoo! Почту! http://ru.mail.yahoo.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 [EMAIL PROTECTED]


Re: NSString sizeWithAttributes inaccuracy

2008-07-25 Thread Manfred Schwind
he problem is that on very large strings sizeWithAttributes comes up  
short [no pun intended]


How much too short? Is it less than 1 pixel?


float tiw = [self stringPixelWidth:[records 
objectAtIndex:i]];
if(tiw > maxWidth){
maxWidth = tiw;
}
[...]
[[[myTableView tableColumns] objectAtIndex:0] 
setWidth:maxWidth];


I think table columns are expected to have integer widths, so you have  
to round up to the next integer, e.g. like that:


[[[myTableView tableColumns] objectAtIndex:0] setWidth:ceilf(maxWidth)];

Mani
--
http://mani.de - friendly software
iVolume - listen to music freehand
LittleSecrets - the encrypted notepad



___

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 [EMAIL PROTECTED]


Re: Drawing a drop-shadow around a view

2008-07-25 Thread Ian Jackson

Hi Graham,

if I understand your question, then I wanted to do something like this  
a while back. I got something off the internet, though I can't  
remember where.  Here's the source that I incorporated into my code.  
It's been ages since I added it in, so I can't remember whether this  
takes care of everything or not. I think it does.


Ian.

P.S. if anyone recognises this code as theirs, then I apologise.



SEDrawingClipView.m
Description: Binary data




On 25/07/2008, at 1:43 PM, Graham Cox wrote:

I have a view embedded in a NSScrollView. When the view is small  
there's a large expanse of grey visible. I'd like to draw a drop- 
shadow around the view in this situation to help it stand out  
slightly from the background. What's a good approach to do this?



tia,

cheers, 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/bianface%40gmail.com

This email sent to [EMAIL PROTECTED]


___

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 [EMAIL PROTECTED]

Retrieving the current -[NSShadow set]

2008-07-25 Thread Keith Duncan
I need a way of retrieving the current NSShadow as previously -set  
without having to pass it as an explicit argument. I've looked through  
the NSGraphicsContext header and docs but I can't find any way of  
getting it.


Oddly, I can't find any way of getting the current NSColor either so I  
must be missing something.


Keith Duncan
[EMAIL PROTECTED], 33software.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 [EMAIL PROTECTED]


Re: Retrieving the current -[NSShadow set]

2008-07-25 Thread Graham Cox
I don't think there is a way. Quartz is pretty much a one-way street -  
you set stuff, tell it to draw and it does. Much of its internal state  
is not readable, at least not publicly.


The "need" to do this suggests a possible problem with your design.  
What are you trying to do?


cheers, Graham





On 25 Jul 2008, at 9:54 pm, Keith Duncan wrote:

I need a way of retrieving the current NSShadow as previously -set  
without having to pass it as an explicit argument. I've looked  
through the NSGraphicsContext header and docs but I can't find any  
way of getting it.


Oddly, I can't find any way of getting the current NSColor either so  
I must be missing something.


Keith Duncan
[EMAIL PROTECTED], 33software.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/graham.cox%40bigpond.com

This email sent to [EMAIL PROTECTED]


___

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 [EMAIL PROTECTED]


Calling setLineFragment on typesetter

2008-07-25 Thread Manoj Patwardhan
I have two line fragments in a line and the first one contains an  
inline image. In the willSetLineFragment method of my typesetter  
subclass, while processing the second line fragment, I need to go back  
and fix the baseline offset in the first line fragment. To do that I  
call setLineFragment of the typesetter. As soon as I do that, the  
inline image in that fragment no longer gets drawn. Instead, a small  
square appears in its place. The characters are drawn fine. If I don't  
call setLineFragment to adjust the first line fragment, while in the  
willSetLineFragment method that is processing the second fragment, it  
is fine.


Since I absolutely need to call setLineFragment from inside  
willSetLineFragment in order to re-adjust the baseline for the first  
line fragment, what else do I need to do to so that the inline image  
in the first line fragment still gets drawn.


Thanks!
Manoj Patwardhan
___

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 [EMAIL PROTECTED]


Re: Retrieving the current -[NSShadow set]

2008-07-25 Thread Keith Duncan
The "need" to do this suggests a possible problem with your design.  
What are you trying to do?


I'm refactoring a method I found online that takes an explicit  
NSShadow argument. I felt that was a poor design as most of the the  
drawing properties are implicit in nature; color, transform and shadow  
are all a property of the current NSGraphicsContext and they should be  
respected in drawing rountines that require them.


However as you point out, there doesn't seem to be a way to retrieve  
them specifically.


Keith Duncan
[EMAIL PROTECTED], 33software.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 [EMAIL PROTECTED]


Re: Retrieving the current -[NSShadow set]

2008-07-25 Thread Michael Ash
On Fri, Jul 25, 2008 at 9:57 AM, Keith Duncan <[EMAIL PROTECTED]> wrote:
>> The "need" to do this suggests a possible problem with your design. What
>> are you trying to do?
>
> I'm refactoring a method I found online that takes an explicit NSShadow
> argument. I felt that was a poor design as most of the the drawing
> properties are implicit in nature; color, transform and shadow are all a
> property of the current NSGraphicsContext and they should be respected in
> drawing rountines that require them.

They *are* respected in drawing routines that require them. If you set
a shadow, then call a drawing routine, that shadow is respected.

So if your function needs to draw using a shadow, and you don't want
to pass it in, all you need to do is set the shadow before you call
it.

Mike
___

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 [EMAIL PROTECTED]


Re: Retrieving the current -[NSShadow set]

2008-07-25 Thread Keith Duncan

Here's the code:

//  Created by Sean Patrick O'Brien on 4/1/08.
//  Copyright 2008 MolokoCacao. All rights reserved.
- (void)fillWithInnerShadow:(NSShadow *)shadow {
[NSGraphicsContext saveGraphicsState];

NSShadow *shadowCopy = [shadow copy];

NSSize offset = shadowCopy.shadowOffset;
CGFloat radius = shadowCopy.shadowBlurRadius;

	NSRect bounds = NSInsetRect(self.bounds, -(ABS(offset.width) +  
radius), -(ABS(offset.height) + radius));


offset.height += bounds.size.height;
shadowCopy.shadowOffset = offset;

NSAffineTransform *transform = [NSAffineTransform transform];
	[transform translateXBy:0 yBy:([[NSGraphicsContext currentContext]  
isFlipped] ? 1 : -1) * bounds.size.height];


NSBezierPath *drawingPath = [NSBezierPath bezierPathWithRect:bounds];
[drawingPath setWindingRule:NSEvenOddWindingRule];

[drawingPath appendBezierPath:self];
[drawingPath transformUsingAffineTransform:transform];

[self addClip];
[shadowCopy set];

[[NSColor blackColor] set];
[drawingPath fill];

[shadowCopy release];

[NSGraphicsContext restoreGraphicsState];
}

Keith Duncan
[EMAIL PROTECTED], 33software.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 [EMAIL PROTECTED]


Re: Folder has limited permissions.

2008-07-25 Thread Kyle Sluder
On Fri, Jul 25, 2008 at 4:55 AM, Macarov Anatoli
<[EMAIL PROTECTED]> wrote:
> How would be the correct way to do?

Obligatory: why do you want to do this?  From a user-experience point
of view, putting things in /Applications is reserved for Installer.app
and drag-installs using the Finder.  Particularly, putting text files
in /Applications is a big no-no.  Put your application data in the
appropriate Application Support folder.  (I understand that you may
just be using that as an illustration.)

--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 [EMAIL PROTECTED]


Re: NSTableView NSTrackingArea and mouse clicks

2008-07-25 Thread Corbin Dunn


On Jul 24, 2008, at 6:16 PM, [EMAIL PROTECTED] wrote:

i have an NSTableView that uses a data source (no bindings, but i  
don't think this is relevant). one column uses a custom cell that is  
actually a subclass of NSTokenFieldCell (but i don't think this is  
relevant either). i draw this cell differently depending on whether  
or not the row it is in is the table's selected row. (and i only  
allow one row at a time to be selected.)


if i don't use any NSTrackingAreas, everything works as i want/expect.

however, if i set up some tracking rects for my custom cell, then  
things don't work properly. i am using the techniques from the  
sample PhotoSearch app. by "don't work properly," what i mean is  
that if i select a row by clicking in one of the NSTrackingAreas,  
the cell draws as if the row isn't selected. if i don't click inside  
one of the tracking rects, but click elsewhere in the row, then my  
custom cell draws properly, ie in its highlighted state.


since this is my first use of NSTrackingArea, i wouldn't be  
surprised if its something i'm doing. are there known interactions  
between NSTrackingArea a clicks in the tracking area? can anyone  
suggest how i can proceed?


No; none --- it is probably something wrong with your cell drawing  
code. Can you post it here? I'll take a look at it.


corbin (I wrote that demo -- note, I think there are a few bugs in the  
tracking area code of the demo that I need to fix up, but this isn't  
one of them)

___

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 [EMAIL PROTECTED]


Folder sharing attributes

2008-07-25 Thread Peter Alshuth

Hi all,

I was wondering how I can retrieve information about a particular  
folder if this folder is shared or not. I looked into the  
fileAttributesAtPath method of the NSFileManager class but cannot find  
any entries regarding the sharing status.


How can I retrieve this information and also how can I enable/disable  
the sharing settings for a folder? Apparently, I cannot use  
AppleScript to check the box in the UI of the Finder "Get Info"  
window, too.


Thanks,
Peter

___

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 [EMAIL PROTECTED]


Loading kernal Extension from Cocoa

2008-07-25 Thread sheen mac
Hi All,

I want to load Kernal Extension (kext) on run time.I load
it using shell command(kextload).The kext file I included
in the bundle. I loaded it from there. But Its asking password
when executing the command using security framework ( 
AuthorizationExecuteWithPrivileges) . Any way to load kext without
asking password?.

I found some app asking password only first time. After 
 its working without asking password.

Thanks In Advance,
Sheen


  
___

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 [EMAIL PROTECTED]


Re: Loading kernal Extension from Cocoa

2008-07-25 Thread Kyle Sluder
On Fri, Jul 25, 2008 at 11:35 AM, sheen mac <[EMAIL PROTECTED]> wrote:
> Any way to load kext without
> asking password?.

Nope.  To allow a program to install a kernel extension without user
authentication would be absurd.

--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 [EMAIL PROTECTED]


Re: Folder sharing attributes

2008-07-25 Thread Kyle Sluder
On Fri, Jul 25, 2008 at 11:27 AM, Peter Alshuth <[EMAIL PROTECTED]> wrote:
> I was wondering how I can retrieve information about a particular folder if
> this folder is shared or not.

Use FSGetCatalogInfo (part of CoreServices).  The FSCatalogInfo struct
has a "sharingFlags" field.

http://developer.apple.com/documentation/Carbon/Reference/File_Manager/Reference/reference.html#//apple_ref/c/func/FSGetCatalogInfo

--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 [EMAIL PROTECTED]


NSOutlineView with Multiple Core Data Entities

2008-07-25 Thread Garrett Bjerkhoel
I have a NSOutlineView hooked up to a NSTreeController, which has  
multiple entities inside of it. I would like to know how to set it up  
having each entity having its own "group". I have downloaded Jonathan  
Dann's example, which compiles but freezes. I can see how his Core  
Data model works, but I already have mine set.


Do I need to have both of my entities have a parent entity in which my  
NSTreeController reads from that one parent entity?


I have searched Google with this subject name with no luck...

Thanks,
Garrett
___

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 [EMAIL PROTECTED]


Re: Cleaning up my Data Model

2008-07-25 Thread Richard Gutierrez
Thanks for the response...

Ultimately what I am trying to do is determine which objects are bound to which 
array controllers. I understand that if I delete an array controller, all of 
the bindings associated with that array controller will be removed, but I need 
to know which items are associated with that array controller so I can re-bind 
them to the new array controllers that I am creating.

Basically, I am re-structuring my data model to get myself better organized. I 
need to transfer the bindings for my objects from my old array controllers to 
my new array controllers without leaving any objects that were bound to my old 
array controllers "unbound" when I delete the old array controllers.

My problem is that I cannot see which items are bound to my old array 
controllers without going through them one by one, which can take forever with 
the amount of objects I have. Is there an easier way to see all bound objects 
to an array controller?
___

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 [EMAIL PROTECTED]


NSCollectionView

2008-07-25 Thread mahaboob pa
Hi,
I'm working with NSCollectionView. I have some formated files, containing
different colors and fonts, that want to be used as template. I succeeded to
displayed it in the CollectionView. Now I used TextView as an editor. I want
to select one item from the CollectionView by a single by highlighting a
color and also I want to display it in the editor by double click. How can I
do this ? Please help me?
___

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 [EMAIL PROTECTED]


Re: NSString sizeWithAttributes inaccuracy

2008-07-25 Thread Jacob Ole Juul Kolding

It's more than one pixel.
First time i noticed it was with a string of about 140 chars which gut  
truncated about 10 chars.


Jacob Kolding
[EMAIL PROTECTED]


On Jul 25, 2008, at 11:19 AM, Manfred Schwind wrote:

he problem is that on very large strings sizeWithAttributes comes  
up short [no pun intended]


How much too short? Is it less than 1 pixel?


float tiw = [self stringPixelWidth:[records 
objectAtIndex:i]];
if(tiw > maxWidth){
maxWidth = tiw;
}
[...]
[[[myTableView tableColumns] objectAtIndex:0] 
setWidth:maxWidth];


I think table columns are expected to have integer widths, so you  
have to round up to the next integer, e.g. like that:


[[[myTableView tableColumns] objectAtIndex:0]  
setWidth:ceilf(maxWidth)];


Mani
--
http://mani.de - friendly software
iVolume - listen to music freehand
LittleSecrets - the encrypted notepad





___

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 [EMAIL PROTECTED]


Re: NSString sizeWithAttributes inaccuracy

2008-07-25 Thread Jacob Ole Juul Kolding

IIRC from my debugging sessions sizeWithAttributes already does that?

Jacob Kolding
[EMAIL PROTECTED]

On Jul 25, 2008, at 1:47 AM, Aki Inoue wrote:

Try using -boundingRectWithSize:options:attributes instead with  
NSStringDrawingUsesDeviceMetics.


Aki

On 2008/07/24, at 14:23, Jacob Ole Juul Kolding wrote:


Hello List

I'm working on an app where I have a NSTableView with one column  
containing strings.
I want this column to automatically resize itself within the  
ScrollView to fit the width of the widest string.


In order to do this I came up with the following code:

-(void)calculateCellTextAttribs{

	NSFont* font = myTableView tableColumns] objectAtIndex:0]  
dataCell] font]; 	

myCellAttributes = [[NSMutableDictionary alloc] init];
[myCellAttributes setObject:font forKey:NSFontAttributeName];
}

-(float)stringPixelWidth:(NSString*) theString{
NSSize extent = [theString sizeWithAttributes:myCellAttributes];
return 1.1*extent.width;
}

-(void)updateTable{
[myTableView reloadData];

if([records count]){ //records is a NSArray of NSString

float maxWidth = 0;
int i = 0;
for(i = 0; i < [records count]; i++){
float tiw = [self stringPixelWidth:[records 
objectAtIndex:i]];
if(tiw > maxWidth){
maxWidth = tiw;
}
}

[[[myTableView tableColumns] objectAtIndex:0] 
setWidth:maxWidth];
}
}

The problem is that on very large strings sizeWithAttributes comes  
up short [no pun intended]

Hence the 1.1 return multiplier in stringPixelWidth.

Does anyone know why this happens or if there is a simpler way to  
achieve my goal?


Any help appreciated!

Jacob Kolding
[EMAIL PROTECTED]





___

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/aki%40apple.com

This email sent to [EMAIL PROTECTED]




___

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 [EMAIL PROTECTED]


NSenu and memory ownership

2008-07-25 Thread Wesley Smith
Hi List,
I have a question regarding memory ownership and NSMenus.  Let's say I
have an application with a nib file containing the usual menu items
like File, Edit, Window etc.  If, during the execution of my app, I
swap out the Window menu with another NSMenu object generated during
runtime, who owns what memory.  Do I take ownership of the NSMenu
object that used to be the Window menu and thus have to free it later?
 Does the AppMenu NSMenu take ownership of the newly created Window
NSMenu, freeing me from having to free it?  How does this play out?

I'm doing this on Tiger, so the GC stuff in Leopard doesn't come in to
play.  I've read a good chunk of the menu related Cocoa docs, but
didn't find anything about this.  Thanks for any help in advance.
wes
___

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 [EMAIL PROTECTED]


Senior Cocoa Developer Needed

2008-07-25 Thread Darren Tessitore
Dear Group,

A client of mine in the San Diego area is looking for a Senior Mac Cocoa
developer.

They are a start-up company and they are looking for a true leader to help
bring them to the next level.  They need someone who can make it happen and
doesn't need any direction at all.   You will be reporting directly to the
CTO.  The salary range is $110k - $160k +.  100% medical coverage for you
and your family and 100% relocation assistance.

If you are interested in finding out more please let me know.  This position
is going to fill fast.

Best,

Darren

Darren Tessitore | Director of Recruiting | Heynow Software | Windham, NH
[EMAIL PROTECTED] | www.Heynow.com | Direct: 617.515.6619 | Fax:
212.504.0811
___

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 [EMAIL PROTECTED]


defer loading window using bundles in XCode 3 Leopard

2008-07-25 Thread julius

Hi,
I want to defer loading a window/panel plus controller and related  
code by using bundles.

I've looked at the Bundle programming guide
http://developer.apple.com/documentation/CoreFoundation/Conceptual/CFBundles/Tasks/creating.html#/ 
/apple_ref/doc/uid/20001122

and the Code Loading Programming Topics for Cocoa
http://developer.apple.com/documentation/Cocoa/Conceptual/LoadingCode/LoadingCode.html#/ 
/apple_ref/doc/uid/1052

None of the advice appears to relate to XCode 3.0  in Leopard.
is that right or am I failing to understand what it is saying?
Perhaps there is some XCode 3 specific documentation I should be  
looking at?


Any help or advice would be invaluable as I'm on the point of  
abandoning the attempt.

Thanks
Julius


http://juliuspaintings.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 [EMAIL PROTECTED]


NSTableView/NSOutlineView column resizing failing

2008-07-25 Thread Eric Long
Hi,

I have an NSOutlineView that is set to uniformly resize its table columns.
Under prior to 10.5, this works fine, but when running on 10.5.x the columns
do not resize.

I don't have any special resizing code in place, just depending on the
normal mechanism for handling column resizing when the window is resized.

The table itself grows.  You can manually resize the columns.

The columns are manipulated when the window loads.  I tried even calling
setColumnAutoresizingStyle after, but that had no effect.

Anyone have an ideas about what could be going wrong?

Like I said, same app resizes fine on 10.4.x.

Thanks,


Eric


___

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 [EMAIL PROTECTED]


Re: defer loading window using bundles in XCode 3 Leopard

2008-07-25 Thread Kyle Sluder
On Fri, Jul 25, 2008 at 1:38 PM, julius <[EMAIL PROTECTED]> wrote:
> I want to defer loading a window/panel plus controller and related code by
> using bundles.

Do you really not want to include the code inside your executable?
Bundles are typically used by the application developer when the
existence of the code must be conditional or is not known at compile
time, like OS-version-dependent features or enabling third-party
plugins.  If your aim is to use bundles to keep code out of your
executable, don't.  It doesn't give you anything; your code still sits
in quadruplicate on the disk whether it's part of your main executable
or a dylib.  Keep whatever object instances you can in a lazily-loaded
nib, but don't undergo the hassle of using bundles for no reason.

--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 [EMAIL PROTECTED]


Re: defer loading window using bundles in XCode 3 Leopard

2008-07-25 Thread julius

Kyle Hi
On 25 Jul 2008, at 18:49, Kyle Sluder wrote:

On Fri, Jul 25, 2008 at 1:38 PM, julius  
<[EMAIL PROTECTED]> wrote:
I want to defer loading a window/panel plus controller and related  
code by

using bundles.


Do you really not want to include the code inside your executable?
Bundles are typically used by the application developer when the
existence of the code must be conditional or is not known at compile
time, like OS-version-dependent features or enabling third-party
plugins.  If your aim is to use bundles to keep code out of your
executable, don't.  It doesn't give you anything; your code still sits
in quadruplicate on the disk whether it's part of your main executable
or a dylib.  Keep whatever object instances you can in a lazily-loaded
nib, but don't undergo the hassle of using bundles for no reason.

Thanks for the advice.
What I have seen on the web seemed to indicate that bundles are a  
really good way of splitting up code development etc.
I like keeping code compartamentalised and bundles looked like a good  
way to do it.
But I also have the memory of someone else being advised on this list  
to keep away from bundles.
That plus the hastle of working with what to me looks  like out of  
date documentation

I think you have made my mind up for me.
Thanks.
Julius


http://juliuspaintings.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 [EMAIL PROTECTED]


Problem drawing multiple parallel lines

2008-07-25 Thread Mark Teagarden
Hi,

I¹m trying to draw a simple game board similar to a chinese checkerboard.
As a first attempt I set up a routine to draw 10 parallel lines of the same
length, 16 pixels apart along the x axis and continuing NE at a 60 degree
angle.  I used NSBezierPath moveTo / lineTo to do this.  The program draws
the lines, but each line is progressively thinner and thinner; if I had to
guess I¹d say the first line is 3 px wide and the last, 0.5.  Even if I
alter the code so that on each iteration of the loop the default width is
set to my desired width (0.5 px), the same thing happens.  Can anyone offer
an explanation of why?  Obviously Quartz is capable of drawing the type of
line I want, because the last ones look correct.  Why the line width
gradient?

Thanks,
Mark

___

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 [EMAIL PROTECTED]


Re: NSenu and memory ownership

2008-07-25 Thread Caleb Strockbine
On Friday, July 25, 2008, at 01:43PM, Wesley Smith wrote:

>I have a question regarding memory ownership and NSMenus.  Let's say I
>have an application with a nib file containing the usual menu items
>like File, Edit, Window etc.  If, during the execution of my app, I
>swap out the Window menu with another NSMenu object generated during
>runtime, who owns what memory.  Do I take ownership of the NSMenu
>object that used to be the Window menu and thus have to free it later?

There's nothing special about NSMenus with respect to memory management --
just follow the same oft-repeated rules you would use with any objective-C 
object.
Those rules are here:

http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/Concepts/ObjectOwnership.html#//apple_ref/doc/uid/2043

Removing a menu with -removeItem: or -removeItemAtIndex: doesn't return
anything, and in any case you didn't alloc, copy, or retain anything, so you
don't have to worry about releasing anything. There's an example here:

http://developer.apple.com/documentation/Cocoa/Conceptual/MenuList/Articles/RemovingMenu.html


> Does the AppMenu NSMenu take ownership of the newly created Window
>NSMenu, freeing me from having to free it?  How does this play out?

If you create the menu, then you'll need to release it when you're done with it,
i.e. after you insert it into the main menu. You don't need to worry about what
the main menu does with it when you insert it; that's not your business. It 
might
retain the menu, or it might make a copy, or it might do something entirely
different.

cheers,

Caleb.
___

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 [EMAIL PROTECTED]


re: Core Data Debugging

2008-07-25 Thread Ben Trumbull
I use Core Data to store the information and it all runs pretty 
smoothly, that is until the app has been running for 15-20mins and I 
start getting Core Data save errors such as "CoreData does not support

persistent cross-store relationships"


This happens when you save objects to a store that have relationships 
directly to objects that are not also saved in that store.


The error should have a user info dictionary which contains some more 
useful information like the source object and the flawed destination 
objectID.


You could also try switching to the SQLite store, and see what error 
it produces.


If it works fine for 15 minutes before failing, it could be a memory 
management related problem.  You can start with setting some env 
variables:


export NSZombieEnabled=YES;export CFZombieLevel=9; export 
MallocScribble=1;export MallocPreScribble=1;export MallocGuardEdges=1


and if that doesn't help, move on to libgmalloc:

export DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib;export 
MALLOC_FILL_SPACE=1;

--

-Ben
___

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 [EMAIL PROTECTED]


Re: Problem drawing multiple parallel lines

2008-07-25 Thread Andy Lee

Can you show your code?

--Andy

On Jul 25, 2008, at 2:24 PM, Mark Teagarden wrote:


Hi,

I’m trying to draw a simple game board similar to a chinese  
checkerboard.
As a first attempt I set up a routine to draw 10 parallel lines of  
the same
length, 16 pixels apart along the x axis and continuing NE at a 60  
degree
angle.  I used NSBezierPath moveTo / lineTo to do this.  The program  
draws
the lines, but each line is progressively thinner and thinner; if I  
had to
guess I’d say the first line is 3 px wide and the last, 0.5.  Even  
if I
alter the code so that on each iteration of the loop the default  
width is
set to my desired width (0.5 px), the same thing happens.  Can  
anyone offer
an explanation of why?  Obviously Quartz is capable of drawing the  
type of

line I want, because the last ones look correct.  Why the line width
gradient?

Thanks,
Mark

___

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 [EMAIL PROTECTED]


Re: NSOutlineView with Multiple Core Data Entities

2008-07-25 Thread Jonathan Dann


On 25 Jul 2008, at 17:21, Garrett Bjerkhoel wrote:

I have a NSOutlineView hooked up to a NSTreeController, which has  
multiple entities inside of it. I would like to know how to set it  
up having each entity having its own "group". I have downloaded  
Jonathan Dann's example, which compiles but freezes. I can see how  
his Core Data model works, but I already have mine set.


Haha! That's great, sorry about that. I'm interested to know where it  
freezes, can you tell me more so I can fix it, please!


Can you explain what you model looks like in a little more detail, and  
what you mean by each entity having its own group.  Do you want a  
single group node entity or multiple group nodes as well as multiple  
child node entities?


Do I need to have both of my entities have a parent entity in which  
my NSTreeController reads from that one parent entity?




If I understand you correctly, the general concept it to have a single  
abstract "TreeNode" entity.  This is the entity that the tree  
controller concerns itself with, you then can make as many concrete  
entities as you like that inherit from your abstract one.


Jonathan

www.espresso-served-here.com

smime.p7s
Description: S/MIME cryptographic signature
___

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 [EMAIL PROTECTED]

Re: Drawing a drop-shadow around a view

2008-07-25 Thread Jonathan Dann
How odd I came across this yesterday on my travels! The site for this  
source is


http://www.bergdesign.com/missing_cocoa_docs/nsclipview.html

Jonathan

www.espresso-served-here.com

On 25 Jul 2008, at 11:13, Ian Jackson wrote:


Hi Graham,

if I understand your question, then I wanted to do something like  
this a while back. I got something off the internet, though I can't  
remember where.  Here's the source that I incorporated into my code.  
It's been ages since I added it in, so I can't remember whether this  
takes care of everything or not. I think it does.


Ian.

P.S. if anyone recognises this code as theirs, then I apologise.




On 25/07/2008, at 1:43 PM, Graham Cox wrote:

I have a view embedded in a NSScrollView. When the view is small  
there's a large expanse of grey visible. I'd like to draw a drop- 
shadow around the view in this situation to help it stand out  
slightly from the background. What's a good approach to do this?



tia,

cheers, Graham


smime.p7s
Description: S/MIME cryptographic signature
___

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 [EMAIL PROTECTED]

DO Chat Example

2008-07-25 Thread Justin Giboney
I am working on a chat program that I could use to explain and demonstrate
Distributed Objects (cause I think they are really cool). I have two
applications, the server, which is intended to not be seen by the
students, and the client, which is intended to be built by the students.

It works so far... well mostly. It isn't very consistent. I don't have a
lot of experience with ports, and I was hoping that someone could look at
it and see if they can find out why some messages go through while others
don't.

Here are the projects:
www.justingiboney.com/code/DOChat.zip
www.justingiboney.com/code/DOChatServer.zip

Some side notes.
1) I am still new to Cocoa, so my code may need some perfection. Please
let me know what I can do better.
2) This was built using Xcode 2.2




___

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 [EMAIL PROTECTED]


Re: defer loading window using bundles in XCode 3 Leopard

2008-07-25 Thread Kyle Sluder
On Fri, Jul 25, 2008 at 2:19 PM, julius <[EMAIL PROTECTED]> wrote:
> What I have seen on the web seemed to indicate that bundles are a really
> good way of splitting up code development etc.
> I like keeping code compartamentalised and bundles looked like a good way to
> do it.

This is not what bundles are intended for.  Bundles are ways of
loading code at runtime.  The reasons for doing so are dictated by
program requirements, not the development environment.  From a
development perspective, when your code gets loaded into your process
should be orthogonal to your environment.  Nothing prevents you from
splitting your code into multiple projects that all get compiled into
one executable in the end, achieving your compartmentalization without
abusing the dynamic loader.

> But I also have the memory of someone else being advised on this list to
> keep away from bundles.
> That plus the hastle of working with what to me looks  like out of date
> documentation

You may be right; it's certainly incomplete.  One thing it
historically hasn't addressed well is the use of macros such as
@executable_path and @loader_path.  I *still* can't find mention of
@executable_path in the official documentation, despite its
criticality for certain functionality.

> I think you have made my mind up for me.

Never let anyone decide for you.  I'm more than happy to inform your
decisions, but I'm just some dude on the Intertron.  :)

> Thanks.

Good luck!
--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 [EMAIL PROTECTED]


Re: NSTableView NSTrackingArea and mouse clicks

2008-07-25 Thread [EMAIL PROTECTED]

corbin,
thanx for the reply. i was pretty sure it wasn't my drawing code and 
after some more "playing around" i'm convinced of that.


i've narrowed down my problem (and i can reproduce it in the 
PhotoSearch demo -- see below).


the -[NSCell setHighlighted:] message does NOT get sent to a cell if 
a click occurs inside an NSTrackingArea for the cell/view.


to see this problem in the PhotoSearch demo app, add the following 3 
lines to the bottom of -[ImagePreviewCell 
addTrackingAreasForView:inRect:withUserInfo:mouseLocation:] :


cellFrame.size.width /=  2;
	NSTrackingArea *area2 = [[NSTrackingArea alloc] 
initWithRect:cellFrame options:options owner:controlView 
userInfo:userInfo];

[controlView addTrackingArea:area2];
[area2 release];

also add an override of setHighlighted as follows:

- (void) setHighlighted: (BOOL) value
{
NSLog(@"%s:   %d", __func__, value);

[super setHighlighted: value];
}

you can verify that the new tracking area is working because if you 
move the mouse into it, the info button changes. but if u click in 
this second tracking area, your override of setHighlighted does NOT 
get called.


offhand, i would say that this doesn't sound like a bug in 
PhotoSearch, but rather a bug in the toolbox. would you agree? if you 
think this is a bug in PhotoSearch, can you suggest a solution? if 
this is in fact a toolbox bug, let me know and i'll report in radar; 
and also, could you suggest a work-around?


thanx,
ken




At 7:44 AM -0700 7/25/08, Corbin Dunn wrote:

On Jul 24, 2008, at 6:16 PM, [EMAIL PROTECTED] wrote:

i have an NSTableView that uses a data source (no bindings, but i 
don't think this is relevant). one column uses a custom cell that 
is actually a subclass of NSTokenFieldCell (but i don't think this 
is relevant either). i draw this cell differently depending on 
whether or not the row it is in is the table's selected row. (and i 
only allow one row at a time to be selected.)


if i don't use any NSTrackingAreas, everything works as i want/expect.

however, if i set up some tracking rects for my custom cell, then 
things don't work properly. i am using the techniques from the 
sample PhotoSearch app. by "don't work properly," what i mean is 
that if i select a row by clicking in one of the NSTrackingAreas, 
the cell draws as if the row isn't selected. if i don't click 
inside one of the tracking rects, but click elsewhere in the row, 
then my custom cell draws properly, ie in its highlighted state.


since this is my first use of NSTrackingArea, i wouldn't be 
surprised if its something i'm doing. are there known interactions 
between NSTrackingArea a clicks in the tracking area? can anyone 
suggest how i can proceed?


No; none --- it is probably something wrong with your cell drawing 
code. Can you post it here? I'll take a look at it.


corbin (I wrote that demo -- note, I think there are a few bugs in 
the tracking area code of the demo that I need to fix up, but this 
isn't one of them)


___

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 [EMAIL PROTECTED]


Re: NSOutlineView with Multiple Core Data Entities

2008-07-25 Thread Garrett Bjerkhoel
Here is a rough sketch of my datamodel. If you like I can take a  
screenshot and post a link to it.

Client
---Project
Todo
Writeoff
---Item

By each entity having its own group, I am refering to say Mail.app how  
it has "MAILBOXES", then "REMINDERS", or in iTunes "DEVICES", and  
"LIBRARY". My intention was to have multiple group nodes as well as  
multiple child nodes.


On regards to your project, here you go:
Once it loads, nothing is clickable :(

In the debugger, this is what it says:
2008-07-25 12:35:01.031 SortedTree[1526:10b] *** -[ESTreeNode  
isSpecialGroup]: unrecognized selector sent to instance 0x133d20


On Jul 25, 2008, at 12:33 PM, Jonathan Dann wrote:



On 25 Jul 2008, at 17:21, Garrett Bjerkhoel wrote:

I have a NSOutlineView hooked up to a NSTreeController, which has  
multiple entities inside of it. I would like to know how to set it  
up having each entity having its own "group". I have downloaded  
Jonathan Dann's example, which compiles but freezes. I can see how  
his Core Data model works, but I already have mine set.


Haha! That's great, sorry about that. I'm interested to know where  
it freezes, can you tell me more so I can fix it, please!


Can you explain what you model looks like in a little more detail,  
and what you mean by each entity having its own group.  Do you want  
a single group node entity or multiple group nodes as well as  
multiple child node entities?


Do I need to have both of my entities have a parent entity in which  
my NSTreeController reads from that one parent entity?




If I understand you correctly, the general concept it to have a  
single abstract "TreeNode" entity.  This is the entity that the tree  
controller concerns itself with, you then can make as many concrete  
entities as you like that inherit from your abstract one.


Jonathan

www.espresso-served-here.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 [EMAIL PROTECTED]


Re: NSTableView NSTrackingArea and mouse clicks

2008-07-25 Thread Corbin Dunn

Hi ken,

It took me a minute to realize it, but what you describe below makes  
sense. Let me clarify what preparedCellAtColumn:row: does; this is the  
main funnel point that NSTableView uses to get a cell to do any  
operations (ie: drawing, type selection, etc). NSTableView's  
implementation gives you a cell set up with the correct state (ie:  
selected, etc).


Now, what does the TrackableOutlineView app do? It *copies* this cell  
(and any state it had), and returns that copy in  
preparedCellAtColumn:row:. So, you mouse in, it copies the cell and  
starts returning that cell. If you click down, well, NSTableView never  
gets a chance to set the state, since you override  
preparedCellAtColumn:row:.


Make sense? It is working correctly; it's not a bug in PhotoSearch or  
the framework (also -- we use the term AppKit or framework, but  
"toolbox" refers to another framework).


Of course, you want it to not work that way. You want it to reflect  
the state that NSTableView sets. So, a quick hack:


- (NSCell *)preparedCellAtColumn:(NSInteger)column row:(NSInteger)row {
// We check if the selectedCell is nil or not -- the selectedCell  
is a cell that is currently being edited or tracked. We don't want to  
return our override if we are in that state.
if ([self selectedCell] == nil && (row == iMouseRow) && (column  
== iMouseCol)) {
NSCell *superCell = [super preparedCellAtColumn:column  
row:row];

[iMouseCell setHighlighted:[superCell isHighlighted]];
return iMouseCell;
} else {
return [super preparedCellAtColumn:column row:row];
}
}

.corbin


thanx for the reply. i was pretty sure it wasn't my drawing code and  
after some more "playing around" i'm convinced of that.


i've narrowed down my problem (and i can reproduce it in the  
PhotoSearch demo -- see below).


the -[NSCell setHighlighted:] message does NOT get sent to a cell if  
a click occurs inside an NSTrackingArea for the cell/view.


to see this problem in the PhotoSearch demo app, add the following 3  
lines to the bottom of -[ImagePreviewCell  
addTrackingAreasForView:inRect:withUserInfo:mouseLocation:] :


cellFrame.size.width /=  2;
	NSTrackingArea *area2 = [[NSTrackingArea alloc]  
initWithRect:cellFrame options:options owner:controlView  
userInfo:userInfo];

[controlView addTrackingArea:area2];
[area2 release];

also add an override of setHighlighted as follows:

- (void) setHighlighted: (BOOL) value
{
NSLog(@"%s:   %d", __func__, value);

[super setHighlighted: value];
}

you can verify that the new tracking area is working because if you  
move the mouse into it, the info button changes. but if u click in  
this second tracking area, your override of setHighlighted does NOT  
get called.


offhand, i would say that this doesn't sound like a bug in  
PhotoSearch, but rather a bug in the toolbox. would you agree? if  
you think this is a bug in PhotoSearch, can you suggest a solution?  
if this is in fact a toolbox bug, let me know and i'll report in  
radar; and also, could you suggest a work-around?


thanx,
ken




At 7:44 AM -0700 7/25/08, Corbin Dunn wrote:

On Jul 24, 2008, at 6:16 PM, [EMAIL PROTECTED] wrote:

i have an NSTableView that uses a data source (no bindings, but i  
don't think this is relevant). one column uses a custom cell that  
is actually a subclass of NSTokenFieldCell (but i don't think this  
is relevant either). i draw this cell differently depending on  
whether or not the row it is in is the table's selected row. (and  
i only allow one row at a time to be selected.)


if i don't use any NSTrackingAreas, everything works as i want/ 
expect.


however, if i set up some tracking rects for my custom cell, then  
things don't work properly. i am using the techniques from the  
sample PhotoSearch app. by "don't work properly," what i mean is  
that if i select a row by clicking in one of the NSTrackingAreas,  
the cell draws as if the row isn't selected. if i don't click  
inside one of the tracking rects, but click elsewhere in the row,  
then my custom cell draws properly, ie in its highlighted state.


since this is my first use of NSTrackingArea, i wouldn't be  
surprised if its something i'm doing. are there known interactions  
between NSTrackingArea a clicks in the tracking area? can anyone  
suggest how i can proceed?


No; none --- it is probably something wrong with your cell drawing  
code. Can you post it here? I'll take a look at it.


corbin (I wrote that demo -- note, I think there are a few bugs in  
the tracking area code of the demo that I need to fix up, but this  
isn't one of them)




___

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/ar

Re: Cleaning up my Data Model

2008-07-25 Thread Kai
Yes, there is: IB 3.1 (coming with Xcode 3.1) lists all "Referencing  
Bindings" pointing to an object under the "Connections" tab.


Hope this helps.
Kai


On 25.7.2008, at 18:06, Richard Gutierrez wrote:


Thanks for the response...

Ultimately what I am trying to do is determine which objects are  
bound to which array controllers. I understand that if I delete an  
array controller, all of the bindings associated with that array  
controller will be removed, but I need to know which items are  
associated with that array controller so I can re-bind them to the  
new array controllers that I am creating.


Basically, I am re-structuring my data model to get myself better  
organized. I need to transfer the bindings for my objects from my  
old array controllers to my new array controllers without leaving  
any objects that were bound to my old array controllers "unbound"  
when I delete the old array controllers.


My problem is that I cannot see which items are bound to my old  
array controllers without going through them one by one, which can  
take forever with the amount of objects I have. Is there an easier  
way to see all bound objects to an array controller?

___

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/kai%40granus.net

This email sent to [EMAIL PROTECTED]


___

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 [EMAIL PROTECTED]


Re: NSOutlineView with Multiple Core Data Entities

2008-07-25 Thread Jonathan Dann
Ah yeah, that bug is intentional!  The model uses an abstract TreeNode  
entity, which the tree controller is set to; however when you want  
concrete LeafNode and GroupNode entities (or sub-entities thereof) you  
need to create your own -add: methods so you can insert the correct  
entity into the tree.  As the tree controller has its entity set to  
TreeNode (abstract, so it can work will all sub-entity types), when  
calling -add: and addChild: it simply tries to insert an abstract  
entity.  Only the GroupNode responds to -isSpecialGroup, hence the  
exception.


I put those buttons, linked to -add: and -addChild:, in the project to  
emphasise that these no longer work when you want a non-trivial tree  
structure with multiple entities in the same tree.


What I do for the case you want is have an -insertGroupNode: method  
which creates the correct entity and inserts it into the tree at the  
index path you want.  For the default groups I do that in code,  
setting their -displayNames and setting -isSpecialGroup to YES so that  
the NSOutlineView delegate method -outlineView:isGroupItem: can  
interrogate the all the GroupNodes and will draw it in the correct way  
(like MAILBOXES, etc) when -isSpecialGroup returns YES.


In a shipping app I'd bracket such calls (when you don't know what  
type of node your dealing with) with a -respondsToSelector: or - 
isKindOfClass: call.


Sorry for the confusion. Hope this clears it up.

Jonathan

www.espresso-served-here.com

On 25 Jul 2008, at 21:30, Garrett Bjerkhoel wrote:

Here is a rough sketch of my datamodel. If you like I can take a  
screenshot and post a link to it.

Client
---Project
Todo
Writeoff
---Item

By each entity having its own group, I am refering to say Mail.app  
how it has "MAILBOXES", then "REMINDERS", or in iTunes "DEVICES",  
and "LIBRARY". My intention was to have multiple group nodes as well  
as multiple child nodes.


On regards to your project, here you go:
Once it loads, nothing is clickable :(

In the debugger, this is what it says:
2008-07-25 12:35:01.031 SortedTree[1526:10b] *** -[ESTreeNode  
isSpecialGroup]: unrecognized selector sent to instance 0x133d20


On Jul 25, 2008, at 12:33 PM, Jonathan Dann wrote:



On 25 Jul 2008, at 17:21, Garrett Bjerkhoel wrote:

I have a NSOutlineView hooked up to a NSTreeController, which has  
multiple entities inside of it. I would like to know how to set it  
up having each entity having its own "group". I have downloaded  
Jonathan Dann's example, which compiles but freezes. I can see how  
his Core Data model works, but I already have mine set.


Haha! That's great, sorry about that. I'm interested to know where  
it freezes, can you tell me more so I can fix it, please!


Can you explain what you model looks like in a little more detail,  
and what you mean by each entity having its own group.  Do you want  
a single group node entity or multiple group nodes as well as  
multiple child node entities?


Do I need to have both of my entities have a parent entity in  
which my NSTreeController reads from that one parent entity?




If I understand you correctly, the general concept it to have a  
single abstract "TreeNode" entity.  This is the entity that the  
tree controller concerns itself with, you then can make as many  
concrete entities as you like that inherit from your abstract one.


Jonathan

www.espresso-served-here.com






smime.p7s
Description: S/MIME cryptographic signature
___

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 [EMAIL PROTECTED]

Re: NSTableView NSTrackingArea and mouse clicks

2008-07-25 Thread [EMAIL PROTECTED]

hi corbin,
i understand ur explanation and it makes sense. and i see that the 
fix works in PhotoSearch. unfortunately, it doesn't solve all my 
problems. but at this point, i believe i may have a draw problem as 
i'm seeing the highlight being drawn twice.


thanx,
ken

ps. i used the term toolbox because i wasn't sure if this was 
foundation or appkit, and just used an old term wrongly. sorry.




At 1:42 PM -0700 7/25/08, Corbin Dunn wrote:

Hi ken,

It took me a minute to realize it, but what you describe below makes 
sense. Let me clarify what preparedCellAtColumn:row: does; this is 
the main funnel point that NSTableView uses to get a cell to do any 
operations (ie: drawing, type selection, etc). NSTableView's 
implementation gives you a cell set up with the correct state (ie: 
selected, etc).


Now, what does the TrackableOutlineView app do? It *copies* this 
cell (and any state it had), and returns that copy in 
preparedCellAtColumn:row:. So, you mouse in, it copies the cell and 
starts returning that cell. If you click down, well, NSTableView 
never gets a chance to set the state, since you override 
preparedCellAtColumn:row:.


Make sense? It is working correctly; it's not a bug in PhotoSearch 
or the framework (also -- we use the term AppKit or framework, but 
"toolbox" refers to another framework).


Of course, you want it to not work that way. You want it to reflect 
the state that NSTableView sets. So, a quick hack:


- (NSCell *)preparedCellAtColumn:(NSInteger)column row:(NSInteger)row {
// We check if the selectedCell is nil or not -- the 
selectedCell is a cell that is currently being edited or tracked. We 
don't want to return our override if we are in that state.
if ([self selectedCell] == nil && (row == iMouseRow) && (column 
== iMouseCol)) {

NSCell *superCell = [super preparedCellAtColumn:column row:row];
[iMouseCell setHighlighted:[superCell isHighlighted]];
return iMouseCell;
} else {
return [super preparedCellAtColumn:column row:row];
}
}

.corbin

thanx for the reply. i was pretty sure it wasn't my drawing code 
and after some more "playing around" i'm convinced of that.


i've narrowed down my problem (and i can reproduce it in the 
PhotoSearch demo -- see below).


the -[NSCell setHighlighted:] message does NOT get sent to a cell 
if a click occurs inside an NSTrackingArea for the cell/view.


to see this problem in the PhotoSearch demo app, add the following 
3 lines to the bottom of -[ImagePreviewCell 
addTrackingAreasForView:inRect:withUserInfo:mouseLocation:] :


cellFrame.size.width /=  2;
	NSTrackingArea *area2 = [[NSTrackingArea alloc] 
initWithRect:cellFrame options:options owner:controlView 
userInfo:userInfo];

[controlView addTrackingArea:area2];
[area2 release];

also add an override of setHighlighted as follows:

- (void) setHighlighted: (BOOL) value
{
NSLog(@"%s:   %d", __func__, value);

[super setHighlighted: value];
}

you can verify that the new tracking area is working because if you 
move the mouse into it, the info button changes. but if u click in 
this second tracking area, your override of setHighlighted does NOT 
get called.


offhand, i would say that this doesn't sound like a bug in 
PhotoSearch, but rather a bug in the toolbox. would you agree? if 
you think this is a bug in PhotoSearch, can you suggest a solution? 
if this is in fact a toolbox bug, let me know and i'll report in 
radar; and also, could you suggest a work-around?


thanx,
ken




At 7:44 AM -0700 7/25/08, Corbin Dunn wrote:

On Jul 24, 2008, at 6:16 PM, [EMAIL PROTECTED] wrote:

i have an NSTableView that uses a data source (no bindings, but i 
don't think this is relevant). one column uses a custom cell that 
is actually a subclass of NSTokenFieldCell (but i don't think 
this is relevant either). i draw this cell differently depending 
on whether or not the row it is in is the table's selected row. 
(and i only allow one row at a time to be selected.)


if i don't use any NSTrackingAreas, everything works as i want/expect.

however, if i set up some tracking rects for my custom cell, then 
things don't work properly. i am using the techniques from the 
sample PhotoSearch app. by "don't work properly," what i mean is 
that if i select a row by clicking in one of the NSTrackingAreas, 
the cell draws as if the row isn't selected. if i don't click 
inside one of the tracking rects, but click elsewhere in the row, 
then my custom cell draws properly, ie in its highlighted state.


since this is my first use of NSTrackingArea, i wouldn't be 
surprised if its something i'm doing. are there known 
interactions between NSTrackingArea a clicks in the tracking 
area? can anyone suggest how i can proceed?


No; none --- it is probably something wrong with your cell drawing 
code. Can you post it here? I'll take a look at it.


corbin (I wrote that demo -- note, I think there are a few bugs in 
the tracking area code

Re: defer loading window using bundles in XCode 3 Leopard

2008-07-25 Thread Adam R. Maxwell
 
On Friday, July 25, 2008, at 12:40PM, "Kyle Sluder" <[EMAIL PROTECTED]> wrote:
>On Fri, Jul 25, 2008 at 2:19 PM, julius <[EMAIL PROTECTED]> wrote:
>> What I have seen on the web seemed to indicate that bundles are a really
>> good way of splitting up code development etc.
>> I like keeping code compartamentalised and bundles looked like a good way to
>> do it.
>
>This is not what bundles are intended for.  Bundles are ways of
>loading code at runtime.  The reasons for doing so are dictated by
>program requirements, not the development environment.  From a
>development perspective, when your code gets loaded into your process
>should be orthogonal to your environment.  Nothing prevents you from
>splitting your code into multiple projects that all get compiled into
>one executable in the end, achieving your compartmentalization without
>abusing the dynamic loader.

I don't think this is an abuse of bundles, even though it's may not be that 
common anymore.  If you look at 
http://www.stone.com/The_Cocoa_Files/Thanks_A_Bundle_.html or the source for 
CVL [1], I think you'll find bundles used in this way.

>> But I also have the memory of someone else being advised on this list to
>> keep away from bundles.
>> That plus the hastle of working with what to me looks  like out of date
>> documentation
>
>You may be right; it's certainly incomplete.  One thing it
>historically hasn't addressed well is the use of macros such as
>@executable_path and @loader_path.  I *still* can't find mention of
>@executable_path in the official documentation, despite its
>criticality for certain functionality.

Really?  
http://www.google.com/search?hl=en&q=site%3Adeveloper.apple.com+%40executable_path&btnG=Search
 turns up a number of relevant things, as does a full-text search of "All Doc 
Sets" in Xcode.  "Dynamic Library Design Guidelines" covers both of these (or 
at least it mentions them :).

-- 
Adam

[1] http://www.sente.ch/software/cvl/
___

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 [EMAIL PROTECTED]


Can't get NSScrollView to resize properly

2008-07-25 Thread Greg
I'm trying to accomplish something that I thought should have been  
very basic, but for some reason is turning out to be much more of a  
hassle than I anticipated.


I have a square with stuff in it (various controls, etc), this square  
should resize in width, but not height, and should be anchored to the  
top-left corner of the screen.


I wish to place said square inside of a scroll view so that when the  
user stretches the window to by making it wider, the things inside the  
square resize width-wise, but *NOT* height wise.  At the same time I  
wish this square to remain anchored to the top-left corner of the  
window.


When the window becomes too small for the square's height, I wish for  
scrollers to magically appear allowing the square to be scrolled, and  
furthermore, I wish for the square to resize in size to accommodate  
the space that the vertical scroller occupies, and resize again back  
to its original size when the vertical scroll disappears.


This seems like it would be the most basic use of an NSScrollView, yet  
my poor self has spent the past hour trying to get it to work with no  
success.  The square either does not remain anchored to the top-left  
corner when the window is resized, or it does not resize when the  
scroller appears.


Help!

- Greg
___

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 [EMAIL PROTECTED]


NSView colors

2008-07-25 Thread Ashley Perrien
I have a custom NSView that contains as an instance variable a color.  
If I set the color in init as lineColor = [NSColor blueColor]; all is  
well. If instead I use [NSColor colorWithCalibratedRed: 0.5 green: 0.5  
blue: 1.0 alpha: 1.0], the program crashes if I try and access or  
change the color later. The initial draw using it is just fine. But  
the next time it's redrawn or if I change the color, everything  
crashes. I have the exact same problem in 2 completely different  
applications. I'd like to be able to initialize the colors with  
something other than the default redColor, blueColor, etc. I've also  
tried one or two of the other ways to specify values and have had the  
same problem. Any ideas on what's going on?


Ashley Perrien
___

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 [EMAIL PROTECTED]


Re: NSView colors

2008-07-25 Thread Greg

Are you retaining that NSColor object to make sure it sticks around?

- Greg

On Jul 25, 2008, at 5:40 PM, Ashley Perrien wrote:

I have a custom NSView that contains as an instance variable a  
color. If I set the color in init as lineColor = [NSColor  
blueColor]; all is well. If instead I use [NSColor  
colorWithCalibratedRed: 0.5 green: 0.5 blue: 1.0 alpha: 1.0], the  
program crashes if I try and access or change the color later. The  
initial draw using it is just fine. But the next time it's redrawn  
or if I change the color, everything crashes. I have the exact same  
problem in 2 completely different applications. I'd like to be able  
to initialize the colors with something other than the default  
redColor, blueColor, etc. I've also tried one or two of the other  
ways to specify values and have had the same problem. Any ideas on  
what's going on?


Ashley Perrien
___

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/greg 
%40kinostudios.com


This email sent to [EMAIL PROTECTED]


___

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 [EMAIL PROTECTED]


Re: Problem drawing multiple parallel lines

2008-07-25 Thread Mark Teagarden

Herewith, the code:

NSBezierPath * apath;
apath = [[NSBezierPath alloc] init];
[[NSColor grayColor] set];
for(i=0;i<12;i++){
[apath setLineWidth:0.15];
	[apath moveToPoint: NSMakePoint(borders.origin.x 
+20+16*i,borders.origin.y+20)];
	[apath lineToPoint: NSMakePoint(borders.origin.x 
+420+16*i,borders.origin.y+320)];

[apath stroke];
}
___

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 [EMAIL PROTECTED]


Re: Retrieving the current -[NSShadow set]

2008-07-25 Thread Michael Ash
On Fri, Jul 25, 2008 at 10:16 AM, Keith Duncan <[EMAIL PROTECTED]> wrote:
> Here's the code:
>
> //  Created by Sean Patrick O'Brien on 4/1/08.
> //  Copyright 2008 MolokoCacao. All rights reserved.
> - (void)fillWithInnerShadow:(NSShadow *)shadow {
>[NSGraphicsContext saveGraphicsState];
>
>NSShadow *shadowCopy = [shadow copy];
>
>NSSize offset = shadowCopy.shadowOffset;
>CGFloat radius = shadowCopy.shadowBlurRadius;
>
>NSRect bounds = NSInsetRect(self.bounds, -(ABS(offset.width) +
> radius), -(ABS(offset.height) + radius));
>
>offset.height += bounds.size.height;
>shadowCopy.shadowOffset = offset;
>
>NSAffineTransform *transform = [NSAffineTransform transform];
>[transform translateXBy:0 yBy:([[NSGraphicsContext currentContext]
> isFlipped] ? 1 : -1) * bounds.size.height];
>
>NSBezierPath *drawingPath = [NSBezierPath bezierPathWithRect:bounds];
>[drawingPath setWindingRule:NSEvenOddWindingRule];
>
>[drawingPath appendBezierPath:self];
>[drawingPath transformUsingAffineTransform:transform];
>
>[self addClip];
>[shadowCopy set];
>
>[[NSColor blackColor] set];
>[drawingPath fill];
>
>[shadowCopy release];
>
>[NSGraphicsContext restoreGraphicsState];
> }

Since this code doesn't use the shadow for all drawing, it makes
little sense to use the shadow set in the drawing context, since you
have a bunch of drawing that won't use it. Passing the shadow in makes
perfect sense to me.

I don't recommend it, but you *could* refactor this code to use the
currently set shadow. The non-shadowed code can push the graphics
context state, set a no-effect shadow, draw, then pop the state to get
back to the old shadow.

Mike
___

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 [EMAIL PROTECTED]


Re: Drawing a drop-shadow around a view

2008-07-25 Thread Ian Jackson

Ah yes,

Perhaps I should add that address in the comments at the top of the  
class for future reference. I see that the shadow stuff isn't in that  
original code, but it all seems to go hand in hand. The complete lack  
of commenting in the drawRect method strongly implies that I am  
responsible for that part. Apologies to anyone looking at the code,  
for all the unrelated stuff that I added in for my app. It was 5 past  
bedtime when I sent it.


Anyway, hopefully with that link, along with the extra bit at the  
bottom about how to incorporate the code, this should all help draw  
shadows.


Ian.

On 26/07/2008, at 7:36 AM, Jonathan Dann wrote:

How odd I came across this yesterday on my travels! The site for  
this source is


http://www.bergdesign.com/missing_cocoa_docs/nsclipview.html

Jonathan

www.espresso-served-here.com

On 25 Jul 2008, at 11:13, Ian Jackson wrote:


Hi Graham,

if I understand your question, then I wanted to do something like  
this a while back. I got something off the internet, though I can't  
remember where.  Here's the source that I incorporated into my  
code. It's been ages since I added it in, so I can't remember  
whether this takes care of everything or not. I think it does.


Ian.

P.S. if anyone recognises this code as theirs, then I apologise.




On 25/07/2008, at 1:43 PM, Graham Cox wrote:

I have a view embedded in a NSScrollView. When the view is small  
there's a large expanse of grey visible. I'd like to draw a drop- 
shadow around the view in this situation to help it stand out  
slightly from the background. What's a good approach to do this?



tia,

cheers, 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 [EMAIL PROTECTED]


Re: Problem drawing multiple parallel lines

2008-07-25 Thread Quincey Morris

On Jul 25, 2008, at 15:08, Mark Teagarden wrote:


NSBezierPath * apath;
apath = [[NSBezierPath alloc] init];
[[NSColor grayColor] set];
for(i=0;i<12;i++){
[apath setLineWidth:0.15];
	[apath moveToPoint: NSMakePoint(borders.origin.x 
+20+16*i,borders.origin.y+20)];
	[apath lineToPoint: NSMakePoint(borders.origin.x 
+420+16*i,borders.origin.y+320)];

[apath stroke];
}


You're adding a subpath to the path every iteration, so previously  
drawn subpaths are getting redrawn -- the first one 12 times, the  
second one 11 times, and so on.


Anti-aliasing, in combination with a fractional line width, is causing  
the line "spreading" effect.


You need [apath removeAllPoints] inside the loop after [apath stroke],  
or move [apath stroke] outside the loop.



___

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 [EMAIL PROTECTED]


Re: defer loading window using bundles in XCode 3 Leopard

2008-07-25 Thread Kyle Sluder
On Fri, Jul 25, 2008 at 5:28 PM, Adam R. Maxwell <[EMAIL PROTECTED]> wrote:
> I don't think this is an abuse of bundles, even though it's may not be that 
> common anymore.  If you look at 
> http://www.stone.com/The_Cocoa_Files/Thanks_A_Bundle_.html or the source for 
> CVL [1], I think you'll find bundles used in this way.

Note though that the article you reference is about developing an
add-in for optional functionality, which is also what CVL uses bundles
for.  A lot of applications do this, especially ones like the Adobe
CS3 suite.  But that's often because the functionality they're
bundling exists on the same side of the architectural divide as
third-party plugins.

>>I *still* can't find mention of
>>@executable_path in the official documentation, despite its
>>criticality for certain functionality.
>
> Really?  
> http://www.google.com/search?hl=en&q=site%3Adeveloper.apple.com+%40executable_path&btnG=Search
>  turns up a number of relevant things, as does a full-text search of "All Doc 
> Sets" in Xcode.  "Dynamic Library Design Guidelines" covers both of these (or 
> at least it mentions them :).

As of a few months ago, there was only one mention of @executable_path
in the docs, and none prior to that.  @loader_path was nicely
documented, though.  Before posting I Googled "@executable_path" and
"@executable_path macro" and the only hits on the first page were for
mailing list posts, source code, or other outside references, which is
the only way I discovered the macro in the first place.

--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 [EMAIL PROTECTED]


bug in PhotoSearch

2008-07-25 Thread [EMAIL PROTECTED]

corbin,
i think there is another bug in PhotoSearch. in TrackableOutlineView 
mouseEntered, the call to [iMouseCell mouseEntered:] should be 
outside the if block that sets iMouseCell if needed.


also, is there a specific reason for caching the cell in iMouseCell? 
i've done away with the caching in my app (and thus also don't have 
to override preparedCellAtColumn:row:), and now all my problems have 
gone away? my guess is that u were caching the cell for performance 
reasons... is that correct? or am i opening myself up for a future 
problem?


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 [EMAIL PROTECTED]


Re: Retrieving the current -[NSShadow set]

2008-07-25 Thread Keith Duncan
I don't recommend it, but you *could* refactor this code to use the  
currently set shadow.


That's actually the original question. How does one do this?

Keith Duncan
[EMAIL PROTECTED], 33software.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 [EMAIL PROTECTED]


Re: Problem drawing multiple parallel lines

2008-07-25 Thread Mark Teagarden

Thanks very much Quincy.  That did the trick!

Mark

On Jul 25, 2008, at 5:32 PM, Quincey Morris wrote:


On Jul 25, 2008, at 15:08, Mark Teagarden wrote:


NSBezierPath * apath;
apath = [[NSBezierPath alloc] init];
[[NSColor grayColor] set];
for(i=0;i<12;i++){
[apath setLineWidth:0.15];
	[apath moveToPoint: NSMakePoint(borders.origin.x 
+20+16*i,borders.origin.y+20)];
	[apath lineToPoint: NSMakePoint(borders.origin.x 
+420+16*i,borders.origin.y+320)];

[apath stroke];
}


You're adding a subpath to the path every iteration, so previously  
drawn subpaths are getting redrawn -- the first one 12 times, the  
second one 11 times, and so on.


Anti-aliasing, in combination with a fractional line width, is  
causing the line "spreading" effect.


You need [apath removeAllPoints] inside the loop after [apath  
stroke], or move [apath stroke] outside the loop.



___

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/magfura2%40mac.com

This email sent to [EMAIL PROTECTED]


___

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 [EMAIL PROTECTED]


Re: Retrieving the current -[NSShadow set]

2008-07-25 Thread David Duncan

On Jul 25, 2008, at 3:59 PM, Keith Duncan wrote:


That's actually the original question. How does one do this?



You don't. If I were doing this, I would simply pass the shadow  
parameters into the function (and create conveniences for myself if I  
were so inclined).


The ability for NSShadow to provide you with its shadow parameters is  
in part due to its implementation, as it needs to retain these values  
in order to implement -set. From the Quartz side of things, -set  
effectively equates to a call to CGContextSetShadowWithColor() which  
sets all of these parameters at once. But there is no method to  
retrieve these parameters from either the NSGraphicsContext or  
underlying CGContextRef.

--
David Duncan
Apple DTS Animation and Printing
[EMAIL PROTECTED]



___

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 [EMAIL PROTECTED]


Re: defer loading window using bundles in XCode 3 Leopard

2008-07-25 Thread Adam R. Maxwell
 
On Friday, July 25, 2008, at 03:33PM, "Kyle Sluder" <[EMAIL PROTECTED]> wrote:
>On Fri, Jul 25, 2008 at 5:28 PM, Adam R. Maxwell <[EMAIL PROTECTED]> wrote:
>> I don't think this is an abuse of bundles, even though it's may not be that 
>> common anymore.  If you look at 
>> http://www.stone.com/The_Cocoa_Files/Thanks_A_Bundle_.html or the source for 
>> CVL [1], I think you'll find bundles used in this way.
>
>Note though that the article you reference is about developing an
>add-in for optional functionality, which is also what CVL uses bundles
>for.  A lot of applications do this, especially ones like the Adobe
>CS3 suite.  But that's often because the functionality they're
>bundling exists on the same side of the architectural divide as
>third-party plugins.

A main point of Stone's article is that you can decrease launch times and avoid 
bloating your main code base by using loadable bundles (at least, that's how I 
read the intro and conclusions).  I admit that I may have misremembered CVL's 
source, but I believe the CVL inspector panels that are implemented as plugins 
are not really ``optional functionality'' in the way that 3rd party plugins 
are: they're shipped with it as an integral part.  I do think it's a waste of 
time to force-fit bundles into a design, but the OP can figure out if that's 
the case.

>>>I *still* can't find mention of
>>>@executable_path in the official documentation, despite its
>>>criticality for certain functionality.
>>
>> Really?  
>> http://www.google.com/search?hl=en&q=site%3Adeveloper.apple.com+%40executable_path&btnG=Search
>>  turns up a number of relevant things, as does a full-text search of "All 
>> Doc Sets" in Xcode.  "Dynamic Library Design Guidelines" covers both of 
>> these (or at least it mentions them :).
>
>As of a few months ago, there was only one mention of @executable_path
>in the docs, and none prior to that.  

Quite possible, but even that's not what you wrote earlier.

-- 
Adam


___

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 [EMAIL PROTECTED]


Re: Newb Question re Messaging and Return Values

2008-07-25 Thread Kevin Elliott


On Jul 24, 2008, at 4:04 PM, Brad Gibbs wrote:

Looking at my problem further, I'm thinking I should make webServer  
a delegate of each of the devices.  That would allow me to  
encapsulate the HTTP Posts and Gets for all of the devices in a  
single class.  A device's methods could invoke the webServer  
delegate when they need to send information to the server or get  
information back.  The webServer delegate would return the response  
to the device method that called the webServer method and that  
method could parse the response and update the UI directly or  
through an NSNotification.


Does this sound right?


Depends on what exactly you mean.  If your planning to have lot of  
device and one webServer, then I'd say no.  Delegate work well with a  
one to one relationship, not necessarily a one to many relationship.   
What's the purpose of the webServer vs. device objects?  Why do you  
need a webServer object instead of just doing the work in the device  
objects (this is not necessarily a criticism, just clarifying roles)?

___

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 [EMAIL PROTECTED]


Re: defer loading window using bundles in XCode 3 Leopard

2008-07-25 Thread Jeff Johnson

On Jul 25, 2008, at 5:33 PM, Kyle Sluder wrote:


I *still* can't find mention of
@executable_path in the official documentation, despite its
criticality for certain functionality.


Really?  http://www.google.com/search?hl=en&q=site% 
3Adeveloper.apple.com+%40executable_path&btnG=Search turns up a  
number of relevant things, as does a full-text search of "All Doc  
Sets" in Xcode.  "Dynamic Library Design Guidelines" covers both  
of these (or at least it mentions them :).


As of a few months ago, there was only one mention of @executable_path
in the docs, and none prior to that.  @loader_path was nicely
documented, though.  Before posting I Googled "@executable_path" and
"@executable_path macro" and the only hits on the first page were for
mailing list posts, source code, or other outside references, which is
the only way I discovered the macro in the first place.

--Kyle Sluder


I have a local copy of the documentation on Tiger. The docs are  
pretty old at this point, but I see that @executable_path is  
discussed in the documents "Framework Programming Guide", "Dynamic  
Library Programming Topics", and "Mach-O Programming Topics".


-Jeff

___

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 [EMAIL PROTECTED]


Simple Modal Password Dialog

2008-07-25 Thread Arthur Coleman
I know that I must be missing something simple, but I have been unable  
to figure out how to password protect a simple application that I'm  
writing.  I create an new xib file add a panel and I'm able to come up  
after my app loads but I haven't been able to figure out how to make  
the dialog modal.  I'm sure there must be some easy way to do this  
since I see it on so many applications.


Thanks for any help,

Arthur

___

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 [EMAIL PROTECTED]


Re: NSenu and memory ownership

2008-07-25 Thread Wesley Smith
> Removing a menu with -removeItem: or -removeItemAtIndex: doesn't return
> anything, and in any case you didn't alloc, copy, or retain anything, so you
> don't have to worry about releasing anything.

While this is true, I'm using - (NSMenuItem *)itemWithTitle:(NSString
*)aString to get the item if it exists and using that pointer from
then on out instead of replacing it.  So, let's say I want to modify
the File menu, if I have a pointer to it when the app closes, should I
be worried about freeing it if it was generated from a nib file and
not procedurally by me in the code?

thanks,
wes
___

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 [EMAIL PROTECTED]


Getting the Alert volume

2008-07-25 Thread Mudi Dandan
I need to get the Alert Volume set in Preferences so that I can  
respect the user's setting when playing alerts with NSSound.
I have found GetSysBeepVolume() in CarbonSound/Sound.h but  
unfortunately it's deprecated since 10.5.

Any idea how to get that value ?

-Mudi
___

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 [EMAIL PROTECTED]


Problem when archiving data: [_NSViewGState encodeWithCoder:] unrecognized selector

2008-07-25 Thread JArod Wen

Hi Jedis,

Problem showed when I was trying to archive the following data  
object(in debug model: po items):


{type = mutable-small, count = 3,  
values = (
	0 : {type = immutable, count =  
5, capacity = 6, pairs = (
	2 : {contents = "w (D)"} =  

	3 : {contents = "r (S)"} =  

	4 : {contents = "time"} = 0x77dbe90 [0xa01dc174]>{value = +0.0, type = kCFNumberFloat64Type}
	6 : {contents = "e (A)"} = 0x47e9f0 [0xa01dc174]>{value = +0.76225443599111997184, type =  
kCFNumberFloat64Type}
	7 : {contents = "q (P)"} = NSPoint:  
{316, 179}

)}
	1 : {type = immutable, count =  
5, capacity = 6, pairs = (
	2 : {contents = "w (D)"} =  

	3 : {contents = "r (S)"} =  

	4 : {contents = "time"} = 0x5aa7bf0 [0xa01dc174]>{value = +1., type =  
kCFNumberFloat64Type}
	6 : {contents = "e (A)"} = 0x77f1010 [0xa01dc174]>{value = +0.60900385903412623811, type =  
kCFNumberFloat64Type}
	7 : {contents = "q (P)"} = NSPoint:  
{370, 195}

)}
	2 : {type = immutable, count = 5,  
capacity = 6, pairs = (
	2 : {contents = "w (D)"} =  

	3 : {contents = "r (S)"} =  

	4 : {contents = "time"} = 0x475a60 [0xa01dc174]>{value = +2., type =  
kCFNumberFloat64Type}
	6 : {contents = "e (A)"} = 0x77f1010 [0xa01dc174]>{value = +0.60900385903412623811, type =  
kCFNumberFloat64Type}
	7 : {contents = "q (P)"} = NSPoint:  
{370, 195}

)}
)}

These data are from a table, which contains four columns:  
time(NSNumber), w(D)(distanceObj), r(S)(shapeObj), e(A)(NSNumber), and  
q(P)(NSPoint). distanceObj and shapeObj are defined as following:


@interface distanceObj: NSObject {
NSPoint origin;
NSPoint terminus;
NSNumber * magnitude;
}
@property (readwrite, assign) NSPoint origin;
@property (readwrite, assign) NSPoint terminus;
@property (readwrite, assign) NSNumber* magnitude;

@end

@interface shapeObj: NSObject {
NSNumber * count;
NSPoint *  points;;
}

@property (readwrite, assign) NSNumber * count;
@property (readwrite, assign) NSPoint *  points;
@end

The methods for encoding and decoding in distanceObj and shapeObj have  
been implemented:


- (id)initWithCoder:(NSCoder *)coder{
[super init];
[coder decodeValueOfObjCType:@encode(NSPoint) at:&origin];
[coder decodeValueOfObjCType:@encode(NSPoint) at:&terminus];
[coder decodeValueOfObjCType:@encode(NSNumber *) at:&magnitude];
return self;
}

- (void)encodeWithCoder:(NSCoder *)coder{
[coder encodeValueOfObjCType:@encode(NSPoint) at:&origin];
[coder encodeValueOfObjCType:@encode(NSPoint) at:&terminus];
[coder encodeValueOfObjCType:@encode(NSNumber *) at:&magnitude];
}

- (id)initWithCoder:(NSCoder *)coder{
[super init];
[self setCount:[coder decodeObject]];
[coder decodeValueOfObjCType:@encode(NSPoint *) at:&points];
return self;
}

- (void)encodeWithCoder:(NSCoder *)coder{
[coder encodeObject:count];
[coder decodeValueOfObjCType:@encode(NSPoint *) at:&points];
}

When the application was running on

[NSArchiver archiveRootObject:[[[appController tableController]  
tableSource] items] toFile:[sheet filename]];


There would be two errors and then failed to write into file:

2008-07-25 18:01:27.198 Roboplasm[2353:813] *** -[_NSViewGState  
encodeWithCoder:]: unrecognized selector sent to instance 0x7752480
2008-07-25 18:01:27.821 Roboplasm[2353:813] *** -[_NSViewGState  
encodeWithCoder:]: unrecognized selector sent to instance 0x7752480


Since I didn't find any object in the data to be written has the type  
of NSViewGState, I am really confused about this error. Anyone can  
give me any suggestions?


Thanks in advance!

---
JArod Wen




___

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 [EMAIL PROTECTED]


Re: bug in PhotoSearch

2008-07-25 Thread Corbin Dunn


On Jul 25, 2008, at 3:52 PM, [EMAIL PROTECTED] wrote:


corbin,
i think there is another bug in PhotoSearch. in TrackableOutlineView  
mouseEntered, the call to [iMouseCell mouseEntered:] should be  
outside the if block that sets iMouseCell if needed.


If you have multiple tracking areas per cell, then yes, that probably  
is required. sounds like a good fix!





also, is there a specific reason for caching the cell in iMouseCell?  
i've done away with the caching in my app (and thus also don't have  
to override preparedCellAtColumn:row:), and now all my problems have  
gone away? my guess is that u were caching the cell for performance  
reasons... is that correct? or am i opening myself up for a future  
problem?


Yes; tableview uses a single cell to "stamp" out each row in a given  
column. you might have trouble with the properties getting set if  
something else triggers that cell on a different row to redraw while  
the mouse is over the current cell.


corbin
___

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 [EMAIL PROTECTED]


Re: Retrieving the current -[NSShadow set]

2008-07-25 Thread Michael Ash
On Fri, Jul 25, 2008 at 6:59 PM, Keith Duncan <[EMAIL PROTECTED]> wrote:
>> I don't recommend it, but you *could* refactor this code to use the
>> currently set shadow.
>
> That's actually the original question. How does one do this?

I have a tough time understanding why you ask this question right
after you snipped out the answer to it. Go look at the bits you
removed again.

Mike
___

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 [EMAIL PROTECTED]


Re: Simple Modal Password Dialog

2008-07-25 Thread Andy Lee
As with many such topics, the Xcode documentation window is your  
friend.  A full-text search for "modal" was fruitful for me.


A Google search targeted at developer.apple.com was even more  
fruitful.  A search for "modal window site:developer.apple.com" had  
this as the first result:




"How Modal Windows Work"

--Andy


On Jul 25, 2008, at 3:40 PM, Arthur Coleman wrote:

I know that I must be missing something simple, but I have been  
unable to figure out how to password protect a simple application  
that I'm writing.  I create an new xib file add a panel and I'm able  
to come up after my app loads but I haven't been able to figure out  
how to make the dialog modal.  I'm sure there must be some easy way  
to do this since I see it on so many applications.


Thanks for any help,

Arthur

___

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 [EMAIL PROTECTED]


(Newb question?) Launching app on dock icon file drop?

2008-07-25 Thread Jacob Ole Juul Kolding
I been searching for quite a while and reading the source code for  
DockScript by still no luck.
Can anyone tell me how to make an Cocoa app launch when a file is drag  
'n droped on it's icon?


Any pointer greatly appreciated!

Jacob Kolding
[EMAIL PROTECTED]





___

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 [EMAIL PROTECTED]


Repositioning a content view w/in a window

2008-07-25 Thread R.L. Grigg
I've created a NSWindow and set a content view. That displays fine,  
but I need to be able to fine tune the position of the content view  
within the window.


In the docs for NSWindow -setContentView it says:

"You can modify the content view’s coordinate system through its  
bounds rectangle, but can’t alter its frame rectangle (that is, its  
size or location) directly."


What can I use to move the content view's location up/down or left/ 
right within the window?

Xcode 3.1, OSX 10.5.4

Russ

___

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 [EMAIL PROTECTED]


Re: Can't get NSScrollView to resize properly

2008-07-25 Thread Greg
Thanks to Ryan Brown and Rainer Brockerhoff for assisting with the  
solution to this problem.


Two solutions were invented, one that used a NSTextView, and one that  
simply flips the NSClipView.  You can get both of them here:


http://www.kinostudios.com/ScrollView_madness.zip

- Greg

On Jul 25, 2008, at 5:33 PM, Greg wrote:

I'm trying to accomplish something that I thought should have been  
very basic, but for some reason is turning out to be much more of a  
hassle than I anticipated.


I have a square with stuff in it (various controls, etc), this  
square should resize in width, but not height, and should be  
anchored to the top-left corner of the screen.


I wish to place said square inside of a scroll view so that when the  
user stretches the window to by making it wider, the things inside  
the square resize width-wise, but *NOT* height wise.  At the same  
time I wish this square to remain anchored to the top-left corner of  
the window.


When the window becomes too small for the square's height, I wish  
for scrollers to magically appear allowing the square to be  
scrolled, and furthermore, I wish for the square to resize in size  
to accommodate the space that the vertical scroller occupies, and  
resize again back to its original size when the vertical scroll  
disappears.


This seems like it would be the most basic use of an NSScrollView,  
yet my poor self has spent the past hour trying to get it to work  
with no success.  The square either does not remain anchored to the  
top-left corner when the window is resized, or it does not resize  
when the scroller appears.


Help!

- Greg
___

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/greg 
%40kinostudios.com


This email sent to [EMAIL PROTECTED]


___

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 [EMAIL PROTECTED]


Re: Repositioning a content view w/in a window

2008-07-25 Thread Andrew Merenbach

Hi!

The content view of a window is, as far as I should think, going to  
extend to the window's boundaries.  Thus you can't move it up/down or  
left/right -- but you can put your content within a *subview* of that  
content view, then position it as necessary.


Cheers,
Andrew


On Jul 25, 2008, at 6:08 PM, R.L. Grigg wrote:

I've created a NSWindow and set a content view. That displays fine,  
but I need to be able to fine tune the position of the content view  
within the window.


In the docs for NSWindow -setContentView it says:

"You can modify the content view’s coordinate system through its  
bounds rectangle, but can’t alter its frame rectangle (that is, its  
size or location) directly."


What can I use to move the content view's location up/down or left/ 
right within the window?

Xcode 3.1, OSX 10.5.4

Russ

___

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/andrew.merenbach%40ucla.edu

This email sent to [EMAIL PROTECTED]




smime.p7s
Description: S/MIME cryptographic signature
___

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 [EMAIL PROTECTED]

Re: Repositioning a content view w/in a window

2008-07-25 Thread R.L. Grigg

Thats a clever approach! I'll try it.
Thx!
Russ

On Jul 25, 2008, at 6:10 PM, Andrew Merenbach wrote:


Hi!

The content view of a window is, as far as I should think, going to  
extend to the window's boundaries.  Thus you can't move it up/down  
or left/right -- but you can put your content within a *subview* of  
that content view, then position it as necessary.


Cheers,
Andrew


On Jul 25, 2008, at 6:08 PM, R.L. Grigg wrote:

I've created a NSWindow and set a content view. That displays fine,  
but I need to be able to fine tune the position of the content view  
within the window.


In the docs for NSWindow -setContentView it says:

"You can modify the content view’s coordinate system through its  
bounds rectangle, but can’t alter its frame rectangle (that is, its  
size or location) directly."


What can I use to move the content view's location up/down or left/ 
right within the window?

Xcode 3.1, OSX 10.5.4

Russ



___

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 [EMAIL PROTECTED]


Re: Drawing a drop-shadow around a view

2008-07-25 Thread Graham Cox

Thanks Ian, just what I was looking for.

Graham



On 26 Jul 2008, at 8:18 am, Ian Jackson wrote:

Anyway, hopefully with that link, along with the extra bit at the  
bottom about how to incorporate the code, this should all help draw  
shadows.


___

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 [EMAIL PROTECTED]


Re: NSView colors

2008-07-25 Thread Graham Cox
I suspect you are just assigning your ivar without retaining the  
colour. It gets autoreleased and so crashes when you access it later  
(stale reference).


blueColor probably continues to work because (as an internal  
optimisation) it just so happens that that is a singleton and isn't  
autoreleased, so even though you only have a weak reference to it, it  
remains valid.


A review of memory management in general should set you straight.

http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/

cheers, Graham



On 26 Jul 2008, at 7:40 am, Ashley Perrien wrote:

I have a custom NSView that contains as an instance variable a  
color. If I set the color in init as lineColor = [NSColor  
blueColor]; all is well. If instead I use [NSColor  
colorWithCalibratedRed: 0.5 green: 0.5 blue: 1.0 alpha: 1.0], the  
program crashes if I try and access or change the color later. The  
initial draw using it is just fine. But the next time it's redrawn  
or if I change the color, everything crashes. I have the exact same  
problem in 2 completely different applications. I'd like to be able  
to initialize the colors with something other than the default  
redColor, blueColor, etc. I've also tried one or two of the other  
ways to specify values and have had the same problem. Any ideas on  
what's going on?


Ashley Perrien
___

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/graham.cox%40bigpond.com

This email sent to [EMAIL PROTECTED]


___

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 [EMAIL PROTECTED]


Re: (Newb question?) Launching app on dock icon file drop?

2008-07-25 Thread Andrew Merenbach

Hi, Jacob,

If it is a document-based program, the easiest method is to set up  
your Info.plist (generally configured through Xcode) to support  
various document types (in the role of "editor" for these types).   
Creating a "droplet"-type program shouldn't be much more difficult --  
you'd need to set your program to be a "viewer" instead of an "editor."


I and others could use a little more information, I suspect.  What is  
your scenario?


Cheers,
Andrew

On Jul 25, 2008, at 4:51 PM, Jacob Ole Juul Kolding wrote:

I been searching for quite a while and reading the source code for  
DockScript by still no luck.
Can anyone tell me how to make an Cocoa app launch when a file is  
drag 'n droped on it's icon?


Any pointer greatly appreciated!

Jacob Kolding
[EMAIL PROTECTED]





___

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/andrew.merenbach%40ucla.edu

This email sent to [EMAIL PROTECTED]




smime.p7s
Description: S/MIME cryptographic signature
___

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 [EMAIL PROTECTED]

Re: (Newb question?) Launching app on dock icon file drop?

2008-07-25 Thread Ken Thomases

On Jul 25, 2008, at 6:51 PM, Jacob Ole Juul Kolding wrote:

I been searching for quite a while and reading the source code for  
DockScript by still no luck.
Can anyone tell me how to make an Cocoa app launch when a file is  
drag 'n droped on it's icon?


Well, it does so by default -- if the drop is permitted.  The Dock  
decides if the drop is permitted based on the document types that the  
application claims to handle in its Info.plist file.


http://developer.apple.com/documentation/MacOSX/Conceptual/ 
BPRuntimeConfig/Articles/ConfigApplications.html
http://developer.apple.com/documentation/Cocoa/Conceptual/Documents/ 
Concepts/DocTypePList.html


By the way, you can force the Dock to accept the drop, regardless of  
the claimed document types, by holding down Command and Option.


Cheers,
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 [EMAIL PROTECTED]


Re: Repositioning a content view w/in a window

2008-07-25 Thread Graham Cox
Well, it's the usual approach. The content view is something that the  
window owns to act purely as the root of its view hierarchy - there's  
usually not much to be gained by fiddling with it or putting your own  
content there directly. For example, when you drag a custom view (or  
any view) into a window in Interface Builder, it's actually adding it  
as a subview of the implied contentView, which you never see in IB.


cheers, Graham



On 26 Jul 2008, at 11:16 am, R.L. Grigg wrote:


Thats a clever approach!


___

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 [EMAIL PROTECTED]


Re: Repositioning a content view w/in a window

2008-07-25 Thread Michael Ash
On Fri, Jul 25, 2008 at 9:42 PM, Graham Cox <[EMAIL PROTECTED]> wrote:
> Well, it's the usual approach. The content view is something that the window
> owns to act purely as the root of its view hierarchy - there's usually not
> much to be gained by fiddling with it or putting your own content there
> directly. For example, when you drag a custom view (or any view) into a
> window in Interface Builder, it's actually adding it as a subview of the
> implied contentView, which you never see in IB.

In fact I would go so far as to say that if you ever use
-setContentView:, you are very probably doing it wrong. It is, for the
most part, not a very useful call, and you can accomplish the same
thing more naturally, easily, and flexibly by adding the view as a
subview to the content view instead.

Mike
___

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 [EMAIL PROTECTED]


Re: Problem when archiving data: [_NSViewGState encodeWithCoder:] unrecognized selector

2008-07-25 Thread Kyle Sluder
On Fri, Jul 25, 2008 at 6:29 PM, JArod Wen <[EMAIL PROTECTED]> wrote:
> Since I didn't find any object in the data to be written has the type of
> NSViewGState, I am really confused about this error. Anyone can give me any
> suggestions?

This is usually a case of failing to retain an object you own.  If it
gets deallocated underneath your feet, an object of a different class
may wind up in the same place in memory, but your old pointers don't
know that.  Often, because of the way the compiler has generated your
code, it's consistently an object of a certain but completely
unrelated class.

--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 [EMAIL PROTECTED]


Re: Repositioning a content view w/in a window

2008-07-25 Thread Henry McGilton (Starbase)



On Jul 25, 2008, at 6:50 PM, Michael Ash wrote:

On Fri, Jul 25, 2008 at 9:42 PM, Graham Cox <[EMAIL PROTECTED]>  
wrote:
Well, it's the usual approach. The content view is something that  
the window
owns to act purely as the root of its view hierarchy - there's  
usually not
much to be gained by fiddling with it or putting your own content  
there
directly. For example, when you drag a custom view (or any view)  
into a
window in Interface Builder, it's actually adding it as a subview  
of the

implied contentView, which you never see in IB.


In fact I would go so far as to say that if you ever use
-setContentView:, you are very probably doing it wrong. It is, for the
most part, not a very useful call, and you can accomplish the same
thing more naturally, easily, and flexibly by adding the view as a
subview to the content view instead.


Well, I would not go quite that far, although I agree with you
in principle for normal everyday stuff.I have some applications
which create bare windows --- no borders, controls, resizers,
shadows, and so on.The view that replaces the default window
content view does all the drawing.I don't see any value in
having a content view whose only purpose in life is to act as
a container for my drawing view.

But I agree that these are unusual cases . . .

Cheers,
. . . . . . . .Henry


===+
  Henry McGilton, Boulevardier |Trilithon Software
   Objective-C/Java Composer   | Seroia Research
---+
  mailto:[EMAIL PROTECTED]   |   http://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 [EMAIL PROTECTED]


Re: NSenu and memory ownership

2008-07-25 Thread I. Savant

While this is true, I'm using - (NSMenuItem *)itemWithTitle:(NSString
*)aString to get the item if it exists and using that pointer from
then on out instead of replacing it.  So, let's say I want to modify
the File menu, if I have a pointer to it when the app closes, should I
be worried about freeing it if it was generated from a nib file and
not procedurally by me in the code?



A) Everything's freed when your app terminates, so it a little late to  
be worrying about memory management (it's while it's running that this  
truly matters).
B) Get it right anyway because proper memory management is the key to  
an app that doesn't suck.

C) Read this:

http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/Tasks/MemoryManagementRules.html

  Study it. Devote your life to its happiness. Castrate yourself and  
drink phenolbarbitol if it asks you to, if only to belong ...


--
I.S.


___

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 [EMAIL PROTECTED]


Re: Problem when archiving data: [_NSViewGState encodeWithCoder:] unrecognized selector

2008-07-25 Thread Ken Ferry
>   [coder encodeValueOfObjCType:@encode(NSNumber *) at:&magnitude];

This isn't encoding the number object, this is encoding the pointer to
the number object.  When you get it out of the archive, you get the
same pointer as you put in, but that pointer points to some random bit
of memory in your app, not the number.

Use [coder encodeObject:] to encode objects.

Also, you're probably also better off using NSKeyedArchiver than
NSArchiver, and using encodePoint:forKey:, encodeObject:forKey:, etc.
The non-keyed archiver is not formally deprecated, but it shouldn't
really be used in new code.  Newer Cocoa classes cannot generally be
encoded with the non-keyed archiver, and older classes do not
necessarily encode all of their data when written to a non-keyed
archive.  Every time you encode something new in an encodeWithCoder:
method to a non-keyed archiver, it breaks the ability of older
versions of the class to read the archiver.

-Ken

On Fri, Jul 25, 2008 at 6:59 PM, Kyle Sluder
<[EMAIL PROTECTED]> wrote:
> On Fri, Jul 25, 2008 at 6:29 PM, JArod Wen <[EMAIL PROTECTED]> wrote:
>> Since I didn't find any object in the data to be written has the type of
>> NSViewGState, I am really confused about this error. Anyone can give me any
>> suggestions?
>
> This is usually a case of failing to retain an object you own.  If it
> gets deallocated underneath your feet, an object of a different class
> may wind up in the same place in memory, but your old pointers don't
> know that.  Often, because of the way the compiler has generated your
> code, it's consistently an object of a certain but completely
> unrelated class.
>
> --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/kenferry%40gmail.com
>
> This email sent to [EMAIL PROTECTED]
>
___

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 [EMAIL PROTECTED]


Re: Repositioning a content view w/in a window

2008-07-25 Thread Kyle Sluder
On Fri, Jul 25, 2008 at 11:08 PM, Henry McGilton (Starbase)
<[EMAIL PROTECTED]> wrote:
> I don't see any value in
> having a content view whose only purpose in life is to act as
> a container for my drawing view.

Not that I have any knowledge about this unfortunately forgotten
feature, but I can foresee an implementation of HiDPI on the system's
part that swaps out the content views of the windows of every
application not marked as HiDPI aware with a custom view with
properly-set bounds/frame so the change is transparent.

--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 [EMAIL PROTECTED]


QTKit Error loading DesktopVideoOut.component

2008-07-25 Thread chaitanya pandit
Hi, In my application i use a QTMovieView to display/play movies, but  
whenever init a QTMvoveView i get the following log, Any idea what  
might be wrong?

Thanks for help.

Running…
=shlibs-removed,shlib- 
info=[num="116",name="AudioIPCPlugIn",kind="B",dyld- 
addr="0x15306000",reason="dyld",requested-state="E",state="E",path="/ 
System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/ 
AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn",description="/ 
System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/ 
AudioIPCPlugIn.bundle/Contents/MacOS/ 
AudioIPCPlugIn",loaded_addr="0x15306000",slide="0x15306000",prefix=""]
=shlibs-removed,shlib- 
info=[num="117",name="AppleHDAHALPlugIn",kind="B",dyld- 
addr="0x1530f000",reason="dyld",requested-state="E",state="E",path="/ 
System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/ 
AppleHDAHALPlugIn.bundle/Contents/MacOS/ 
AppleHDAHALPlugIn",description="/System/Library/Extensions/ 
AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/ 
AppleHDAHALPlugIn 
",loaded_addr="0x1530f000",slide="0x1530f000",prefix=""]
2008-07-26 00:34:31.163 diary[11433:813] Error loading /Library/ 
QuickTime/DesktopVideoOut.component/Contents/MacOS/DesktopVideoOut:   
dlopen(/Library/QuickTime/DesktopVideoOut.component/Contents/MacOS/ 
DesktopVideoOut, 262): no suitable image found.  Did find:
	/Library/QuickTime/DesktopVideoOut.component/Contents/MacOS/ 
DesktopVideoOut: mach-o, but wrong architecture
2008-07-26 00:34:31.173 diary[11433:813] Error loading /Library/ 
QuickTime/DesktopVideoOut.component/Contents/MacOS/DesktopVideoOut:   
dlopen(/Library/QuickTime/DesktopVideoOut.component/Contents/MacOS/ 
DesktopVideoOut, 262): no suitable image found.  Did find:
	/Library/QuickTime/DesktopVideoOut.component/Contents/MacOS/ 
DesktopVideoOut: mach-o, but wrong architecture
2008-07-26 00:34:31.187 diary[11433:813] Error loading /Library/ 
QuickTime/DesktopVideoOut.component/Contents/MacOS/DesktopVideoOut:   
dlopen(/Library/QuickTime/DesktopVideoOut.component/Contents/MacOS/ 
DesktopVideoOut, 262): no suitable image found.  Did find:
	/Library/QuickTime/DesktopVideoOut.component/Contents/MacOS/ 
DesktopVideoOut: mach-o, but wrong architecture
2008-07-26 00:34:31.197 diary[11433:813] Error loading /Library/ 
QuickTime/DesktopVideoOut.component/Contents/MacOS/DesktopVideoOut:   
dlopen(/Library/QuickTime/DesktopVideoOut.component/Contents/MacOS/ 
DesktopVideoOut, 262): no suitable image found.  Did find:
	/Library/QuickTime/DesktopVideoOut.component/Contents/MacOS/ 
DesktopVideoOut: mach-o, but wrong architecture
2008-07-26 00:34:46.347 diary[11433:813] Error loading /Library/ 
QuickTime/DesktopVideoOut.component/Contents/MacOS/DesktopVideoOut:   
dlopen(/Library/QuickTime/DesktopVideoOut.component/Contents/MacOS/ 
DesktopVideoOut, 262): no suitable image found.  Did find:
	/Library/QuickTime/DesktopVideoOut.component/Contents/MacOS/ 
DesktopVideoOut: mach-o, but wrong architecture
2008-07-26 00:34:46.350 diary[11433:813] Error loading /Library/ 
QuickTime/DesktopVideoOut.component/Contents/MacOS/DesktopVideoOut:   
dlopen(/Library/QuickTime/DesktopVideoOut.component/Contents/MacOS/ 
DesktopVideoOut, 262): no suitable image found.  Did find:
	/Library/QuickTime/DesktopVideoOut.component/Contents/MacOS/ 
DesktopVideoOut: mach-o, but wrong architecture
2008-07-26 00:34:46.363 diary[11433:813] Error loading /Library/ 
QuickTime/DesktopVideoOut.component/Contents/MacOS/DesktopVideoOut:   
dlopen(/Library/QuickTime/DesktopVideoOut.component/Contents/MacOS/ 
DesktopVideoOut, 262): no suitable image found.  Did find:
	/Library/QuickTime/DesktopVideoOut.component/Contents/MacOS/ 
DesktopVideoOut: mach-o, but wrong architecture
2008-07-26 00:34:46.365 diary[11433:813] Error loading /Library/ 
QuickTime/DesktopVideoOut.component/Contents/MacOS/DesktopVideoOut:   
dlopen(/Library/QuickTime/DesktopVideoOut.component/Contents/MacOS/ 
DesktopVideoOut, 262): no suitable image found.  Did find:
	/Library/QuickTime/DesktopVideoOut.component/Contents/MacOS/ 
DesktopVideoOut: mach-o, but wrong architecture




___

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 [EMAIL PROTECTED]


Re: Problem when archiving data: [_NSViewGState encodeWithCoder:] unrecognized selector

2008-07-25 Thread Ken Ferry
On Fri, Jul 25, 2008 at 9:33 PM, Ken Ferry <[EMAIL PROTECTED]> wrote:
>>   [coder encodeValueOfObjCType:@encode(NSNumber *) at:&magnitude];
>
> This isn't encoding the number object, this is encoding the pointer to
> the number object.  When you get it out of the archive, you get the
> same pointer as you put in, but that pointer points to some random bit
> of memory in your app, not the number.

I'm sorry, this is wrong.  Guess I shouldn't have replied so quickly
on reading this. :-) The object part ought to work.

You do have a line where you try to decode in encodeWithCoder where
you want to encode, and is the points property a C-array of points?
That is going to behave as I suggested.  You're just encoding a
pointer, not the points themselves.

What Kyle said also applies.

-Ken

>
> Use [coder encodeObject:] to encode objects.
>
> Also, you're probably also better off using NSKeyedArchiver than
> NSArchiver, and using encodePoint:forKey:, encodeObject:forKey:, etc.
> The non-keyed archiver is not formally deprecated, but it shouldn't
> really be used in new code.  Newer Cocoa classes cannot generally be
> encoded with the non-keyed archiver, and older classes do not
> necessarily encode all of their data when written to a non-keyed
> archive.  Every time you encode something new in an encodeWithCoder:
> method to a non-keyed archiver, it breaks the ability of older
> versions of the class to read the archiver.
>
> -Ken
>
> On Fri, Jul 25, 2008 at 6:59 PM, Kyle Sluder
> <[EMAIL PROTECTED]> wrote:
>> On Fri, Jul 25, 2008 at 6:29 PM, JArod Wen <[EMAIL PROTECTED]> wrote:
>>> Since I didn't find any object in the data to be written has the type of
>>> NSViewGState, I am really confused about this error. Anyone can give me any
>>> suggestions?
>>
>> This is usually a case of failing to retain an object you own.  If it
>> gets deallocated underneath your feet, an object of a different class
>> may wind up in the same place in memory, but your old pointers don't
>> know that.  Often, because of the way the compiler has generated your
>> code, it's consistently an object of a certain but completely
>> unrelated class.
>>
>> --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/kenferry%40gmail.com
>>
>> This email sent to [EMAIL PROTECTED]
>>
>
___

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 [EMAIL PROTECTED]


Re: Folder has limited permissions.

2008-07-25 Thread Andrew Farmer

On 25 Jul 08, at 01:55, Macarov Anatoli wrote:
When user has a standard account (not administrator), he/she doesn't  
have rights to create a file in the Directory /Applications/. I try  
to create a file with the help of function authopen. This code  
doesn't work:


FILE *pFile = popen("/usr/libexec/authopen -stdoutpipe  
sys.openfile.readwritecreate./applications/tolea.txt", "w");

if(pFile == NULL){
NSLog(@"NOT Create");
}else{
NSLog(@"Create");
char *data = "Create";
pwrite(data, 1, size(data), pFile);
}
pclose(pFile);

How would be the correct way to do?


Besides what everyone else said, lose the -stdoutpipe and use -w or -a  
(depending on your needs). -stdoutpipe uses SCM_RIGHTS, which is  
rather subtle and tricky to use.

___

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 [EMAIL PROTECTED]


Re: Getting the Alert volume

2008-07-25 Thread chaitanya pandit

try NSBeep();

- Chaitanya
On 25-Jul-08, at 6:13 PM, Mudi Dandan wrote:

I need to get the Alert Volume set in Preferences so that I can  
respect the user's setting when playing alerts with NSSound.
I have found GetSysBeepVolume() in CarbonSound/Sound.h but  
unfortunately it's deprecated since 10.5.

Any idea how to get that value ?

-Mudi
___

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/chaitanya%40expersis.com

This email sent to [EMAIL PROTECTED]


___

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 [EMAIL PROTECTED]


Re: Problem when archiving data: [_NSViewGState encodeWithCoder:] unrecognized selector

2008-07-25 Thread JArod Wen

Hi Ken and Kyle,

I am really sorry for this silly mistake in coding... It seems that  
the problem comes just from the decode line in encode method... Sorry  
for both of your valuable time!


And for the NSNumber, in fact I used encodeObject: but it thrown a  
EXC_BAD_ACCESS to me, then I changed to encodeValueOfObjCType. It  
should work for both of these methods in my opinion, so I think it may  
have some tricks related to my implementation.


Again, thanks for your kindness on my silly mistake!

On Jul 26, 2008, at 12:52 AM, Ken Ferry wrote:


On Fri, Jul 25, 2008 at 9:33 PM, Ken Ferry <[EMAIL PROTECTED]> wrote:
 [coder encodeValueOfObjCType:@encode(NSNumber *)  
at:&magnitude];


This isn't encoding the number object, this is encoding the pointer  
to

the number object.  When you get it out of the archive, you get the
same pointer as you put in, but that pointer points to some random  
bit

of memory in your app, not the number.


I'm sorry, this is wrong.  Guess I shouldn't have replied so quickly
on reading this. :-) The object part ought to work.

You do have a line where you try to decode in encodeWithCoder where
you want to encode, and is the points property a C-array of points?
That is going to behave as I suggested.  You're just encoding a
pointer, not the points themselves.

What Kyle said also applies.

-Ken



Use [coder encodeObject:] to encode objects.

Also, you're probably also better off using NSKeyedArchiver than
NSArchiver, and using encodePoint:forKey:, encodeObject:forKey:, etc.
The non-keyed archiver is not formally deprecated, but it shouldn't
really be used in new code.  Newer Cocoa classes cannot generally be
encoded with the non-keyed archiver, and older classes do not
necessarily encode all of their data when written to a non-keyed
archive.  Every time you encode something new in an encodeWithCoder:
method to a non-keyed archiver, it breaks the ability of older
versions of the class to read the archiver.

-Ken

On Fri, Jul 25, 2008 at 6:59 PM, Kyle Sluder
<[EMAIL PROTECTED]> wrote:
On Fri, Jul 25, 2008 at 6:29 PM, JArod Wen <[EMAIL PROTECTED]>  
wrote:
Since I didn't find any object in the data to be written has the  
type of
NSViewGState, I am really confused about this error. Anyone can  
give me any

suggestions?


This is usually a case of failing to retain an object you own.  If  
it
gets deallocated underneath your feet, an object of a different  
class

may wind up in the same place in memory, but your old pointers don't
know that.  Often, because of the way the compiler has generated  
your

code, it's consistently an object of a certain but completely
unrelated class.

--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/kenferry 
%40gmail.com


This email sent to [EMAIL PROTECTED]





---
JArod Wen




___

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 [EMAIL PROTECTED]


NSSpeechSynthesizer delegate method not called in OCUint

2008-07-25 Thread Sean DeNigris
Hi, I'm using OCUnit injected into my project executable in xCode to  
test a class that contains an NSSynthesizer.


The following didFinishSpeaking method gets called when I run the app  
normally, but not in the test.


- (id)init {
...
speechSynthesizer = [NSSpeechSynthesizer new];
[speechSynthesizer setDelegate:self];
...
}

- (void)speechSynthesizer:(NSSpeechSynthesizer*)sender  
didFinishSpeaking:(BOOL)success {

[startButton setEnabled:TRUE];
[stopButton setEnabled:FALSE];
}

// the offending test method
- (void)testButtons {
...
[controller stopIt:nil];

// The two asserts fail because the delegate was never called   
STAssertFalse([stopButton isEnabled], @"");
STAssertTrue([startButton isEnabled], @"");   
}

Any ideas?  Thanks!
___

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 [EMAIL PROTECTED]


Getting process table info from within a Cocoa app

2008-07-25 Thread Sumner Trammell
Hi. A daemon process is running independently of my Cocoa app.  Given a pid
file of the daemon process in a known location, say /var/run/somedaemon.pid,
I would like my Cocoa app to read that file and check the process table to
see if the daemon is actually running. If the daemon IS running, I want my
Cocoa app to change its Dock icon.
Is there a canonical Cocoa way of doing this? Using NSTask and NSPipe to run
/bin/ps seems like a kludge.

I couldn't find anything useful in the NSProcessInfo class docs or the
"Interacting with the Operating System" guide.


Thanks,
-s
___

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 [EMAIL PROTECTED]


Re: Getting process table info from within a Cocoa app

2008-07-25 Thread Andrew Farmer

On 25 Jul 08, at 22:58, Sumner Trammell wrote:
Hi. A daemon process is running independently of my Cocoa app.   
Given a pid
file of the daemon process in a known location, say /var/run/ 
somedaemon.pid,
I would like my Cocoa app to read that file and check the process  
table to
see if the daemon is actually running. If the daemon IS running, I  
want my

Cocoa app to change its Dock icon.
Is there a canonical Cocoa way of doing this? Using NSTask and  
NSPipe to run

/bin/ps seems like a kludge.


Not Cocoa, but take a look at what the kill() syscall does when given  
a signal of 0. This won't let you check WHAT process is running, but  
it will let you check whether SOME process is running with that PID,  
which is generally good enough.

___

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 [EMAIL PROTECTED]


Re: Getting process table info from within a Cocoa app

2008-07-25 Thread Chris Hanson

On Jul 25, 2008, at 10:58 PM, Sumner Trammell wrote:

Hi. A daemon process is running independently of my Cocoa app.   
Given a pid
file of the daemon process in a known location, say /var/run/ 
somedaemon.pid,
I would like my Cocoa app to read that file and check the process  
table to
see if the daemon is actually running. If the daemon IS running, I  
want my

Cocoa app to change its Dock icon.


Better would be to run the daemon through launchd, if you can, and  
have it set up a secure UNIX-domain socket via its launchd property  
list.  That will pass the path to the socket via an environment  
variable, and that socket can be used to communicate with the daemon  
-- or even launch it on demand.


  -- Chris

___

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 [EMAIL PROTECTED]