Re: Designing reports in Cocoa apps

2008-10-19 Thread René v Amerongen

Hi,

About,
On 19 okt 2008, at 01:51, Kyle Sluder wrote:


This method is also usually unusable for any sort of
charting or other non-traditional reporting.


What I did, to test something, was using NSimage to create an image.  
Save the representation, as jpeg f.e, in tmp and then read it back  
with DOM.


You can also do a lot with CSS to make it smooth, or easy client in  
depended colors, layout e.t.c.


The best way is to make a table with your list of requirements and  
check off how well both ways ( webkit / NSView ) are doing there job  
for each item.


René___

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]


what do you use to make icons and similar?

2008-10-19 Thread Roland King
I need a make a few icons and other graphics for my app, simple stuff  
like a small yellow triangle with an invisible background. I'm totally  
and completely graphically challenged which never helps. I can't find  
a simple (preferably free!) drawing program which will let me make  
stuff like this. What does everyone use for these things? 
___


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: what do you use to make icons and similar?

2008-10-19 Thread Jean-Daniel Dupas

Le 19 oct. 08 à 11:20, Roland King a écrit :

I need a make a few icons and other graphics for my app, simple  
stuff like a small yellow triangle with an invisible background. I'm  
totally and completely graphically challenged which never helps. I  
can't find a simple (preferably free!) drawing program which will  
let me make stuff like this. What does everyone use for these things? 
___




There is Gimp. It can do whatever you need, but you may have to learn  
how to use it (this is not the most intuitive software I know).
If you need simple graphics, you can also use the free vetor graphic  
editor: inkscape.


What do you want to do with your images ? icns are mainly used for  
Desktop Icon, for other application images (toolbar, button, ..), you  
can use tiff that is far more versatile.
If you want to create icns, just create your images in a standard  
format (tiff, png, etc…) and then use Icon Composer (from the Xcode  
tools) to create the icns version.



___

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: Designing reports in Cocoa apps

2008-10-19 Thread Bill Cheeseman
on 2008-10-18 7:51 PM, Kyle Sluder at [EMAIL PROTECTED] wrote:

 Others go the traditional route and write a custom NSView that they
 print.  You have to draw it yourself, but this gives you far more
 control -- particularly useful when you want to know about the paper
 size and orientation, or other variables specific to printing.  You'll
 get better results this way, but you'll probably put a lot more effort
 into it.

For the kind of report the op is talking about, it may require very little
effort. A financial summary is probably short, and it probably has a fixed
format. For a report like that, I simply build up a single
NSMutableAttributedString/NSTextStorage object containing the entire report
and its formatting, then display it on screen and print it in an NSView.
It's pretty easy to set up the printing margins, headers and footers, paper
sizing and so on in the print dialog using existing Cocoa facilities
(especially in Leopard).

--

Bill Cheeseman - [EMAIL PROTECTED]
Quechee Software, Quechee, Vermont, USA
www.quecheesoftware.com

PreFab Software - www.prefabsoftware.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]


mutatingNodes error when binding to an NSArray

2008-10-19 Thread Ken Tozier

Hi

I'm working my first NSOutlineView app and trying to programatically  
bind the the content property of an NSOutlineView to a mutable  
files array property of a class and keep getting the following error  
in the console.


*** -[PMProjectView _mutatingNodes]: unrecognized selector sent to  
instance 0x11d21ff0


My files view is significantly different than a simple Finder-like  
hierarchy so the example code here (http://developer.apple.com/documentation/Cocoa/Conceptual/OutlineView/Articles/UsingOutlineDataSource.html 
) was of only minimal help.


I did a Google, Apple dev and source code search for that method and  
came up empty. The NSOutlineView documentation makes no mention of  
this method so what is it looking for? As mentioned, this is my first  
attempt at using NSOutlineView, so I have no clue what could be  
causing this error.


Any help appreciated


Looking at the GDB back trace, the trouble seems to start in the  
following [PMProjectView initTable] method


- (void) initTable
{
NSTableColumn   *nameColumn;

NSTextFieldCell *nameCell;


NSRect  selfFrame   = [self frame],
conFrame;

// get content frame size
conFrame= NSMakeRect(0, 0, selfFrame.size.width, 0);

// create text cell
nameCell= [[NSTextFieldCell alloc] init];

// create the name column
nameColumn  = [[NSTableColumn alloc] initWithIdentifier: 
@name];
[nameColumn setDataCell: nameCell];
[nameColumn setMinWidth: 1000];
	[nameColumn bind: @value toObject: self withKeyPath: @files.name  
options: nil];


// create the table
table   = [[NSOutlineView alloc] initWithFrame: conFrame];

NSLog(@adding name column);
[table addTableColumn: nameColumn];

NSLog(@setting header view);
[table setHeaderView: nil];

[table setAutoresizingMask: NSViewWidthSizable | NSViewMaxYMargin];
[table setUsesAlternatingRowBackgroundColors: YES];
[table setFocusRingType: NSFocusRingTypeNone];
	[table setColumnAutoresizingStyle:  
NSTableViewLastColumnOnlyAutoresizingStyle];


// this line prints to the console
NSLog(@binding content);

// This is where it seems to be failing
	[table bind: @content toObject: self withKeyPath: @files options:  
nil];


// this line never prints
NSLog(@bound content ok);
}

Here's the relevant portion of the GDB backtrace:

#0  0x936f1ff4 in ___TERMINATING_DUE_TO_UNCAUGHT_EXCEPTION___ ()
#1  0x907a70fb in objc_exception_throw ()
#2  0x936f934a in -[NSObject doesNotRecognizeSelector:] ()
#3  0x936f794c in ___forwarding___ ()
#4  0x936f7a12 in __forwarding_prep_0___ ()
#5  0x98d7 in -[NSOutlineViewBinder  
_observeValueForKeyPath:ofObject:context:] ()
#6  0x965d in -[NSOutlineViewBinder  
observeValueForKeyPath:ofObject:change:context:] ()

#7  0x92fede77 in -[NSBinder _performConnectionEstablishedRefresh] ()
#8  0x92fe60e8 in -[NSObject(NSKeyValueBindingCreation)  
bind:toObject:withKeyPath:options:] ()
#9  0x000135f6 in -[PMProjectView initTable] (self=0x11d22430,  
_cmd=0x16c82) at /Users/kentozier/Desktop/PageManager Dev (Leopard)/ 
PMWidgetLab/PMProjectView.m:170


___

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: what do you use to make icons and similar?

2008-10-19 Thread Andy Lee

On Oct 19, 2008, at 5:20 AM, Roland King wrote:
I need a make a few icons and other graphics for my app, simple  
stuff like a small yellow triangle with an invisible background. I'm  
totally and completely graphically challenged which never helps. I  
can't find a simple (preferably free!) drawing program which will  
let me make stuff like this. What does everyone use for these things?


When the time comes to replace the ugly icons in my app, I plan to try  
NodeBox (I doubt I'll have the money to pay someone).  Daniel Jalkut  
got very nice results with it for his blog and for his FlexTime app,  
and it looks like a really fun way to learn Python while I'm at it:


http://www.red-sweater.com/blog/146/blog-redesign

--Andy

___

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: mutatingNodes error when binding to an NSArray

2008-10-19 Thread Ken Tozier
I should add that if i change to a normal NSTableView, I don't get  
that error and everything basically works (except for the expand  
collapse functionality) so it seems to be something specific to  
NSOutlineViews.


On Oct 19, 2008, at 7:26 AM, Ken Tozier wrote:


Hi

I'm working my first NSOutlineView app and trying to programatically  
bind the the content property of an NSOutlineView to a mutable  
files array property of a class and keep getting the following  
error in the console.


*** -[PMProjectView _mutatingNodes]: unrecognized selector sent to  
instance 0x11d21ff0


My files view is significantly different than a simple Finder-like  
hierarchy so the example code here (http://developer.apple.com/documentation/Cocoa/Conceptual/OutlineView/Articles/UsingOutlineDataSource.html 
) was of only minimal help.


I did a Google, Apple dev and source code search for that method and  
came up empty. The NSOutlineView documentation makes no mention of  
this method so what is it looking for? As mentioned, this is my  
first attempt at using NSOutlineView, so I have no clue what could  
be causing this error.


Any help appreciated


Looking at the GDB back trace, the trouble seems to start in the  
following [PMProjectView initTable] method


- (void) initTable
{
NSTableColumn   *nameColumn;

NSTextFieldCell *nameCell;


NSRect  selfFrame   = [self frame],
conFrame;

// get content frame size
conFrame= NSMakeRect(0, 0, selfFrame.size.width, 0);

// create text cell
nameCell= [[NSTextFieldCell alloc] init];

// create the name column
nameColumn  = [[NSTableColumn alloc] initWithIdentifier: 
@name];
[nameColumn setDataCell: nameCell];
[nameColumn setMinWidth: 1000];
	[nameColumn bind: @value toObject: self withKeyPath:  
@files.name options: nil];


// create the table
table   = [[NSOutlineView alloc] initWithFrame: conFrame];

NSLog(@adding name column);
[table addTableColumn: nameColumn];

NSLog(@setting header view);
[table setHeaderView: nil];

[table setAutoresizingMask: NSViewWidthSizable | NSViewMaxYMargin];
[table setUsesAlternatingRowBackgroundColors: YES];
[table setFocusRingType: NSFocusRingTypeNone];
	[table setColumnAutoresizingStyle:  
NSTableViewLastColumnOnlyAutoresizingStyle];


// this line prints to the console
NSLog(@binding content);

// This is where it seems to be failing
	[table bind: @content toObject: self withKeyPath: @files  
options: nil];


// this line never prints
NSLog(@bound content ok);
}

Here's the relevant portion of the GDB backtrace:

#0  0x936f1ff4 in ___TERMINATING_DUE_TO_UNCAUGHT_EXCEPTION___ ()
#1  0x907a70fb in objc_exception_throw ()
#2  0x936f934a in -[NSObject doesNotRecognizeSelector:] ()
#3  0x936f794c in ___forwarding___ ()
#4  0x936f7a12 in __forwarding_prep_0___ ()
#5  0x98d7 in -[NSOutlineViewBinder  
_observeValueForKeyPath:ofObject:context:] ()
#6  0x965d in -[NSOutlineViewBinder  
observeValueForKeyPath:ofObject:change:context:] ()

#7  0x92fede77 in -[NSBinder _performConnectionEstablishedRefresh] ()
#8  0x92fe60e8 in -[NSObject(NSKeyValueBindingCreation)  
bind:toObject:withKeyPath:options:] ()
#9  0x000135f6 in -[PMProjectView initTable] (self=0x11d22430,  
_cmd=0x16c82) at /Users/kentozier/Desktop/PageManager Dev (Leopard)/ 
PMWidgetLab/PMProjectView.m:170


___

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/kentozier%40comcast.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: what do you use to make icons and similar?

2008-10-19 Thread Roland King
forgot about GIMP, might try that. I found something called 'DrawIt',  
the free version of which is crippled to 5 layers but .. not really an  
issue for what I'm doing. What I'm creating here are some very small  
button icons and a few indicators, 30x30 pixels, small, with very  
simple shapes, that size things have to be pretty clear, not much room  
for fancy stuff. Gradient fill would be nice but I may just have to  
live without it.


I believe png are really what I'm trying to make here, they seem to be  
recommended.


Thanks for the tip.

On Oct 19, 2008, at 5:37 PM, Jean-Daniel Dupas wrote:


Le 19 oct. 08 à 11:20, Roland King a écrit :

I need a make a few icons and other graphics for my app, simple  
stuff like a small yellow triangle with an invisible background.  
I'm totally and completely graphically challenged which never  
helps. I can't find a simple (preferably free!) drawing program  
which will let me make stuff like this. What does everyone use for  
these things?___




There is Gimp. It can do whatever you need, but you may have to  
learn how to use it (this is not the most intuitive software I know).
If you need simple graphics, you can also use the free vetor graphic  
editor: inkscape.


What do you want to do with your images ? icns are mainly used for  
Desktop Icon, for other application images (toolbar, button, ..),  
you can use tiff that is far more versatile.
If you want to create icns, just create your images in a standard  
format (tiff, png, etc…) and then use Icon Composer (from the Xcode  
tools) to create the icns version.





___

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: what do you use to make icons and similar?

2008-10-19 Thread Benjamin Dobson
I believe png are really what I'm trying to make here, they seem to  
be recommended.


PNGs are not resolution independent, although they are perfectly  
acceptable. Saving as a TIFF then converting it to PDF with Preview  
works well for 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: Views, frames, and bounds

2008-10-19 Thread DKJ
I did read the section of the documentation you mentioned, but so far  
it hasn't helped.


I'll show you some of the code I was playing with. I'm just not  
understanding why I'm getting the results I do.


I used IB to create a subview in a window, by dragging a custom layout  
view from the Library. I then set its class to MyView.


In MyView I have this:

- (void)drawRect:(NSRect)rect {
[[NSColor redColor] set];
[NSBezierPath strokeRect:[self bounds]];
}

When I run the code I get a nice red rectangle in the window, just  
where I expected it. But when I replace bounds with frame, I get  
nothing.


That's the first puzzle. Maybe if I can understand what's happening  
here, the other puzzles will be resolved too!


dkj


On 18 Oct, 2008, at 22:06, Jamie Hardt wrote:


Do make sure you've read this: http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaViewsGuide/Coordinates/chapter_3_section_3.html#/ 
/apple_ref/doc/uid/TP40002978-CH10-SW9


The -frame and -bounds are two properties of an NSView, both  
rectangles.  The frame is the the position of the view within its  
superview, thus, if you add a subview B to a view A and make  
it's rect {0,0,100,100}, it'll be a 100x100 box in the lower-left  
corner of A.  The bounds give the visible rectangle of the NSView  
in its own coordinate system; by default it has an origin of (0,0)  
and the same dimensions as the frame you gave when you initialized  
it, but it can be modified later.  Thus, the bounds of view B can  
be {0,0,200,100} and this would cause the content of view B to be  
scrunched 2x from left to right.


When you give drawing commands in drawRect, all coordinates you give  
are with regard to the *bounds* of the view.  SO, if you took the  
hypothetical view B above and stroked from (0,0) to (100,0), the  
line would only go halfway across the view (50 pixels), as its   
bounds.size.width are 2x of its frame.size.width.


Hope this helps.  Post your code, as you might have the rects all  
right but may be doing something else incorrectly.


___

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: Passing Variables to AppleScript

2008-10-19 Thread has

Pierce Freeman wrote:

I am attempting to create a little application that will take an  
application
name from the user, and then close it for them.  I am attempting do  
this by
getting the string in Cocoa, then passing this to AppleScript... But  
I don't

know if Cocoa can pass variables to AppleScript.



There are ways of passing values to AppleScript, and there are ways of  
sending Apple events directly from ObjC.
Those are probably overkill for sending a basic 'quit' event though,  
which is a simple cut-n-paste solution. Here's what I use:


#include Carbon/Carbon.h

OSStatus QuitApplicationProcessWithPID(pid_t pid) {
   AppleEvent evt, res;
   AEDesc errDesc;
   OSStatus err;

   // build and send a 'quit' event
   err = AEBuildAppleEvent(kCoreEventClass, kAEQuitApplication,
   typeKernelProcessID,
   pid, sizeof(pid),
   kAutoGenerateReturnID,
   kAnyTransactionID,
   evt, NULL, );
   if (err) return err;
   err = AESendMessage(evt, res, kAEWaitReply, kAEDefaultTimeout);
   AEDisposeDesc(evt);
   // note: process may quit without replying
   if (err == connectionInvalid) return noErr;
   if (err) return err;
   // check if reply event contains an error number, e.g.  
userCanceledErr

   err = AEGetParamDesc(res, keyErrorNumber, typeSInt32, errDesc);
   if (err == noErr) {
   AEGetDescData(errDesc, err, sizeof(err));
   AEDisposeDesc(res);
   } else if (err == errAEDescNotFound)
   err = noErr;
   return err;
}


Use -[NSWorkspace launchedApplications] to look up the application's  
process id based on its name.


HTH

has
--
Control AppleScriptable applications from Python, Ruby and ObjC:
http://appscript.sourceforge.net

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Views, frames, and bounds

2008-10-19 Thread Graham Cox


On 20 Oct 2008, at 12:08 am, DKJ wrote:

When I run the code I get a nice red rectangle in the window, just  
where I expected it. But when I replace bounds with frame, I get  
nothing.


That's the first puzzle. Maybe if I can understand what's happening  
here, the other puzzles will be resolved too!



I can only suggest you're really over-thinking this, because the  
concept is really very simple.


The frame is where your view is within its parent. The bounds is your  
local co-ordinate system.


Let's say you have a simple view that is 100 x 100 pixels. When the  
view is asked to draw, it wants to draw in a rect 0,0 to 100,100. If  
that view is shifted within its window, you still want to be able to  
draw from 0,0 to 100,100. This is your bounds. In other words, moving  
the view doesn't change this, it always starts at 0,0.


The frame is where the view is in the parent - for simplicity let's  
say that's the window. The size is still the same, 100 x 100, but the  
origin will change depending on where the view is. It might be from  
50,50 to 150,150 for example. It's analogous to a window on screen -  
the window's local co-ordinates always start at 0,0 but the window can  
be dragged anywhere on the screen and the window content doesn't need  
to take that into account. Views take the same idea one step further,  
so you can draw a view's content without caring about its position.


Note - when drawing the content of a view, you very rarely need to  
know what the frame is. Only the bounds tends to matter. Also, the co- 
ordinate system is set up to be the bounds when the call to drawRect:  
is made.


If you substitute [self frame] for [self bounds] when drawing, it may  
or may not produce visible results depending on where your view is  
positioned. Since you are always drawing relative to the bounds, using  
the frame here is incorrect. For example if your frame's origin is  
50,50, drawing the frame rect will start at 50,50 relative to your  
bounds' origin. That could well be beyond the edge of the bounds and  
so you might see nothing.



In the simple case, the SIZE of the frame and the bounds is the same,  
but the position is different - the bounds will always have an origin  
of 0,0 no matter where the view is positioned.


However, the size of the frame and the bounds can also be different.  
This occurs when you have a scrollable view (where the bounds is  
larger than the frame, and so can be scrolled around) and also when  
there is a scaling factor (zoom).


hth,


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]


WebView crashes with JavaScript enabled

2008-10-19 Thread Benjamin Dobson

Hi all,

If I enable JavaScript in my WebView, it exits with status 2, after  
printing Debugger() was called! to the console. When I disable it,  
it works fine – but without JavaScript. My code (URL given as an  
example):


	[[webView mainFrame] loadRequest:[NSURLRequest requestWithURL:[NSURL  
URLWithString:@http://www.w3schools.com/js/js_examples.asp;]]];


That's it. Simply loading the page crashes the application. If this  
doesn't crash it, clicking on the Next link at the bottom will.___


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: WebView crashes with JavaScript enabled

2008-10-19 Thread Benjamin Dobson
And I forgot to mention – the application does not crash when started  
with Instruments.


On 19 Oct 2008, at 14:33:41, Benjamin Dobson wrote:


Hi all,

If I enable JavaScript in my WebView, it exits with status 2, after  
printing Debugger() was called! to the console. When I disable it,  
it works fine – but without JavaScript. My code (URL given as an  
example):


	[[webView mainFrame] loadRequest:[NSURLRequest requestWithURL: 
[NSURL URLWithString:@http://www.w3schools.com/js/ 
js_examples.asp]]];


That's it. Simply loading the page crashes the application. If this  
doesn't crash it, clicking on the Next link at the bottom will.


___

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: what do you use to make icons and similar?

2008-10-19 Thread Steve Christensen

On Oct 19, 2008, at 5:50 AM, Benjamin Dobson wrote:

I believe png are really what I'm trying to make here, they seem  
to be recommended.


PNGs are not resolution independent, although they are perfectly  
acceptable. Saving as a TIFF then converting it to PDF with Preview  
works well for me.


Please excuse me if I missed something earlier in the thread, but my  
understanding of TIFFs (and PNGs and JPEGs) is that they're all  
purely raster formats. Thus, how does saving a TIFF as a PDF get you  
resolution independence? (At least that's what I read you to be saying.)


steve

___

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: What is A class which must be subclassed ?

2008-10-19 Thread Michael Ash
On Sat, Oct 18, 2008 at 11:28 PM, Jerry Krinock [EMAIL PROTECTED] wrote:
 On 2008 Oct, 18, at 18:16, Michael Ash wrote:

 The question is ... does it make *sense* to create [an instance of the
 base class Foo].

 The answer is no.

 If the answer is no, then it's an abstract class.

 Is my answer a  ^sufficient^ condition so that I can state in my
 documentation that Foo is an abstract class ?

I think there are two conditions needed: is it pointless to
instantiate Foo, and is Foo designed to stop being pointless if it's
subclassed? Then you have an abstract class.

(An example of something that's pointless to instantiate but not
designed to be subclassed would be a Java-style utility class, where
the class is only used to expose function-like entities as
class/static methods.)

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: Views, frames, and bounds

2008-10-19 Thread Michael Ash
On Sat, Oct 18, 2008 at 11:04 PM, DKJ [EMAIL PROTECTED] wrote:
 I am unable to understand the relation between the frame and the bounds of
 an NSView. I've read the documentation in the View Programming Guide, and
 also played around with them myself in a practice project. In the latter, I
 tried drawing their rectangles in different colours, but couldn't get both
 to display. So I'm still at a loss. Can someone point me towards other
 documentation that might get through the fog?

Take a piece of graph paper. Draw a dot on the paper at coordinate
1,1. Now draw a rectangle from 5,5 to 15, 15. Call this rectangle
view. Now draw a dot inside view at 1,1. Notice how it's not at
the same location as the original dot.

View's frame is 5,5, 10,10. (Cocoa rectangles are origin/size, not
point/point.) View's bounds are the same, but expressed in the same
coordinates that put the second dot inside the view. Its bounds are
0,0, 10,10.

If you move view around the page, its frame changes but its bounds do not.

Does that make it more clear?

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: Views, frames, and bounds

2008-10-19 Thread Andy Lee

On Oct 19, 2008, at 9:08 AM, DKJ wrote:
That's the first puzzle. Maybe if I can understand what's happening  
here, the other puzzles will be resolved too!


Try placing two of your views in the window with different sizes and  
positions.  Add NSLog statements to your -drawRect: method that print  
the bounds and frame:


- (void)drawRect:(NSRect)rect {
NSLog(@frame: %@, NSStringFromRect([self frame]));
NSLog(@bounds: %@, NSStringFromRect([self bounds]));

[[NSColor redColor] set];
[NSBezierPath strokeRect:[self bounds]];
}

See if that helps.

--Andy

___

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: what do you use to make icons and similar?

2008-10-19 Thread John Joyce

:


I believe png are really what I'm trying to make here, they seem
to be recommended.


PNGs are not resolution independent, although they are perfectly
acceptable. Saving as a TIFF then converting it to PDF with Preview
works well for me.


Please excuse me if I missed something earlier in the thread, but my
understanding of TIFFs (and PNGs and JPEGs) is that they're all
purely raster formats. Thus, how does saving a TIFF as a PDF get you
resolution independence? (At least that's what I read you to be  
saying.)


steve



It doesn't and it cannot. PDF is only a container, that happens to  
support vector art well, but cannot vectorize a raster image. If you  
properly placed some vector art into a pdf you might be able to garner  
some sort of resolution independence, but it's probably not worth the  
effort, and definitely won't look as good in most cases as well  
designed/optimized icons.
Until displays approach something like 300dpi or higher, like print  
media, our eyes will be better served by icons hand-tooled for  
particular sizes.


Your safest bet is to make use of PNG. It supports transparency. If  
you need something in .icns format, make use of Icon Composer.
As for drawing/painting apps, don't be cheap! If you don't have skill,  
pay somebody to do it.

___

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: Views, frames, and bounds

2008-10-19 Thread DKJ





The penny has finally dropped. Thanks to all for your help.

dkj


___

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: what do you use to make icons and similar?

2008-10-19 Thread Benjamin Dobson


On 19 Oct 2008, at 16:22:44, Steve Christensen wrote:


On Oct 19, 2008, at 7:38 AM, Benjamin Dobson wrote:


On 19 Oct 2008, at 15:12:09, Steve Christensen wrote:


On Oct 19, 2008, at 5:50 AM, Benjamin Dobson wrote:

I believe png are really what I'm trying to make here, they seem  
to be recommended.


PNGs are not resolution independent, although they are perfectly  
acceptable. Saving as a TIFF then converting it to PDF with  
Preview works well for me.


Please excuse me if I missed something earlier in the thread, but  
my understanding of TIFFs (and PNGs and JPEGs) is that they're all  
purely raster formats. Thus, how does saving a TIFF as a PDF get  
you resolution independence? (At least that's what I read you to  
be saying.)


I'm not entirely sure. I saved a TIFF file from the GIMP, and yes,  
it does look like raster. But there is evidently more information  
there, as when I converted it to PDF in Preview, it saved it as a  
scalable format. I don't know how, but it evidently worked.


So if you scale the PDF to different sizes, is the image from the  
TIFF always crisp (no jaggy edges, etc.)?




The PDF never seems to get jaggy edges. The original TIFF file does,  
but the PDF remains fine. I think it depends in part on what  
application you 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: what do you use to make icons and similar?

2008-10-19 Thread Jean-Daniel Dupas


Le 19 oct. 08 à 16:32, John Joyce a écrit :


:


I believe png are really what I'm trying to make here, they seem
to be recommended.


PNGs are not resolution independent, although they are perfectly
acceptable. Saving as a TIFF then converting it to PDF with Preview
works well for me.


Please excuse me if I missed something earlier in the thread, but my
understanding of TIFFs (and PNGs and JPEGs) is that they're all
purely raster formats. Thus, how does saving a TIFF as a PDF get you
resolution independence? (At least that's what I read you to be  
saying.)


steve



It doesn't and it cannot. PDF is only a container, that happens to  
support vector art well, but cannot vectorize a raster image. If you  
properly placed some vector art into a pdf you might be able to  
garner some sort of resolution independence, but it's probably not  
worth the effort, and definitely won't look as good in most cases as  
well designed/optimized icons.
Until displays approach something like 300dpi or higher, like print  
media, our eyes will be better served by icons hand-tooled for  
particular sizes.


Your safest bet is to make use of PNG. It supports transparency. If  
you need something in .icns format, make use of Icon Composer.
As for drawing/painting apps, don't be cheap! If you don't have  
skill, pay somebody to do it.


unlike tiff, png does not support multi representations with different  
resolution which is the recommanded way to store raster images  
(vectorial images should be pdf of course).

So, PNG is not recommanded.

See this for details:

http://developer.apple.com/documentation/UserExperience/Conceptual/HiDPIOverview/HiDPIArt/chapter_4_section_5.html


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: what do you use to make icons and similar?

2008-10-19 Thread Ricky Sharp


On Oct 19, 2008, at 9:32 AM, John Joyce wrote:

It doesn't and it cannot. PDF is only a container, that happens to  
support vector art well, but cannot vectorize a raster image. If you  
properly placed some vector art into a pdf you might be able to  
garner some sort of resolution independence, but it's probably not  
worth the effort, and definitely won't look as good in most cases as  
well designed/optimized icons.


I will disagree here.  It was so worth the effort to move all my  
bitmapped images to vector-based artwork.  I got beautiful scaling  
from 0.5 to 3.0x to include non-integral scaling factors.


In terms of the statement cannot vectorize a raster image... Adobe  
Illustrator can do such a task.


Until displays approach something like 300dpi or higher, like print  
media, our eyes will be better served by icons hand-tooled for  
particular sizes.


It all depends upon the artwork.  I think you'll find that most  
artwork will scale very well if vectorized.


___
Ricky A. Sharp mailto:[EMAIL PROTECTED]
Instant Interactive(tm)   http://www.instantinteractive.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: what do you use to make icons and similar?

2008-10-19 Thread Paul Bruneau

On Oct 19, 2008, at 12:09 PM, Ricky Sharp wrote:

I will disagree here.  It was so worth the effort to move all my  
bitmapped images to vector-based artwork.  I got beautiful scaling  
from 0.5 to 3.0x to include non-integral scaling factors.


In terms of the statement cannot vectorize a raster image... Adobe  
Illustrator can do such a task.


Illustrator has what used to be Streamline built into it, but it  
really is only good for stuff that should have been vector-based when  
it was created anyway. For instance, photographic bitmaps can't be  
vectorized in this way, or is there some magic new tool that I don't  
know about?

___

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: WebView crashes with JavaScript enabled

2008-10-19 Thread Stephen J. Butler
On Sun, Oct 19, 2008 at 8:33 AM, Benjamin Dobson
[EMAIL PROTECTED] wrote:
 If I enable JavaScript in my WebView, it exits with status 2, after printing
 Debugger() was called! to the console. When I disable it, it works fine –
 but without JavaScript. My code (URL given as an example):

[[webView mainFrame] loadRequest:[NSURLRequest requestWithURL:[NSURL
 URLWithString:@http://www.w3schools.com/js/js_examples.asp;]]];

 That's it. Simply loading the page crashes the application. If this doesn't
 crash it, clicking on the Next link at the bottom
 will.

Works fine for me. Simple Cocoa application, create the proper
connections, and put this in the app delegate:

- (void) applicationDidFinishLaunching:(NSNotification*)aNotification
{
NSLog( @isJavaScriptEnabled = %d, [[webView preferences]
isJavaScriptEnabled] );
[[webView mainFrame] loadRequest:[NSURLRequest
requestWithURL:[NSURL
URLWithString:@http://www.w3schools.com/js/js_examples.asp;]]];
}

Console prints a 1, and the page doesn't crash. I think your problem
lies with some other part of your code.
___

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: WebView crashes with JavaScript enabled

2008-10-19 Thread Jason Coco


On Oct 19, 2008, at 14:22 , Stephen J. Butler wrote:


On Sun, Oct 19, 2008 at 8:33 AM, Benjamin Dobson
[EMAIL PROTECTED] wrote:
If I enable JavaScript in my WebView, it exits with status 2, after  
printing
Debugger() was called! to the console. When I disable it, it  
works fine –

but without JavaScript. My code (URL given as an example):

  [[webView mainFrame] loadRequest:[NSURLRequest requestWithURL: 
[NSURL

URLWithString:@http://www.w3schools.com/js/js_examples.asp;]]];

That's it. Simply loading the page crashes the application. If this  
doesn't

crash it, clicking on the Next link at the bottom
will.


Works fine for me. Simple Cocoa application, create the proper
connections, and put this in the app delegate:

- (void) applicationDidFinishLaunching:(NSNotification*)aNotification
{
   NSLog( @isJavaScriptEnabled = %d, [[webView preferences]
isJavaScriptEnabled] );
   [[webView mainFrame] loadRequest:[NSURLRequest
requestWithURL:[NSURL
URLWithString:@http://www.w3schools.com/js/js_examples.asp;]]];
}

Console prints a 1, and the page doesn't crash. I think your problem
lies with some other part of your code.


Actually, the exception you get looks like you're dereferencing an  
integer somewhere... possibly

something like:

NSLog(@The return code: %@, returnCode);

Which would cause that exception...

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: WebView crashes with JavaScript enabled

2008-10-19 Thread Benjamin Dobson

On 19 Oct 2008, at 19:41:41, Jason Coco wrote:



On Oct 19, 2008, at 14:22 , Stephen J. Butler wrote:


On Sun, Oct 19, 2008 at 8:33 AM, Benjamin Dobson
[EMAIL PROTECTED] wrote:
If I enable JavaScript in my WebView, it exits with status 2,  
after printing
Debugger() was called! to the console. When I disable it, it  
works fine –

but without JavaScript. My code (URL given as an example):

 [[webView mainFrame] loadRequest:[NSURLRequest requestWithURL: 
[NSURL

URLWithString:@http://www.w3schools.com/js/js_examples.asp;]]];

That's it. Simply loading the page crashes the application. If  
this doesn't

crash it, clicking on the Next link at the bottom
will.


Works fine for me. Simple Cocoa application, create the proper
connections, and put this in the app delegate:

- (void) applicationDidFinishLaunching:(NSNotification*)aNotification
{
  NSLog( @isJavaScriptEnabled = %d, [[webView preferences]
isJavaScriptEnabled] );
  [[webView mainFrame] loadRequest:[NSURLRequest
requestWithURL:[NSURL
URLWithString:@http://www.w3schools.com/js/js_examples.asp;]]];
}

Console prints a 1, and the page doesn't crash. I think your problem
lies with some other part of your code.


Actually, the exception you get looks like you're dereferencing an  
integer somewhere... possibly

something like:

NSLog(@The return code: %@, returnCode);

Which would cause that exception...


I don't think so. My subclasses don't reference the webView at all,  
and what does – see for yourself.


- (void)applicationDidFinishLaunching:(NSNotification *)notification {
	[[webView mainFrame] loadRequest:[NSURLRequest requestWithURL:[NSURL  
URLWithString:@http://www.w3schools.com/js/js_examples.asp;]]];

//[helpMenuItem setKeyEquivalent:@?];
NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
[center addObserver:self selector:@selector(progressChanged:)
   
name:WebViewProgressEstimateChangedNotification object:webView];
[center addObserver:self selector:@selector(progressChanged:)
   name:WebViewProgressStartedNotification 
object:webView];
[center addObserver:self selector:@selector(progressFinished:)
   name:WebViewProgressFinishedNotification 
object:webView];
[webView setContinuousSpellCheckingEnabled:YES];
}

- (void)progressChanged:(NSNotification *)notification {
NSRect progRect = [progressIndicator frame];
float progress = [webView estimatedProgress];
progRect.size.width  = progress * 192;
[progressIndicator setFrame:progRect];
}
- (void)progressFinished:(NSNotification *)notification {
NSRect progRect = [progressIndicator frame];
progRect.size.width  = 192;
[progressIndicator setFrame:progRect];

progRect.size.width  = 0;
[progressIndicator setFrame:progRect];
}

progressIndicator is an NSImageView.

___

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: Converting from HTML

2008-10-19 Thread Drarok Ithaqua
Following that link and pasting the code, I find it doesn't work  
correctly. It's replacing amp; with a space!


All I'm trying to do is parse the RSS feed URL out of the head  
section of a document. I didn't think it'd be so difficult!


As this app is going to be used on a specific site, I think I'll just  
do manual string replacements for now, as it seems

the easiest solution.

On 18 Oct 2008, at 00:22, Aurora Phoenix wrote:

Hi DI... Depending on how heavy you need to understand the structure  
of the
HTML, a simple parse using string chopping/ranges might be  
sufficient OR
(personally I would prefer) use something like libxml2 / Xpath to  
grok the

input. Note simple resolution of entities might not be sufficient,
particularly because you seem to be grabbing URI/URL... If you are  
grabbing

URL with intent of passing them on to the URL Loading System (NSURL*,
NSHTTPURL*), you will on the back end also ensure that prior to  
passing the

string itself is URLEncoded (e.g, replacing spaces with %20 and such).

Someone else has posted the link to ThinkMac blog which has a  
snippet for

cheap char entity resolution in Objective C (
http://www.thinkmac.co.uk/blog/2005/05/removing-entities-from-html-in-cocoa 
.

html)


Cheers and good luck!


On 10/16/08 19:17 , Drarok Ithaqua [EMAIL PROTECTED] wrote:


Hi all, i'm trying to find a way to convert an HTML-originated URL
into one I can use in cocoa.

Example input: link type=application/rss+xml rel=alternate  
href=/

search/uniqueamp;stuffamp;here /

I know the URL that this data is fetched from, so I can prefix that  
to

achieve a full URL again, but I need to convert the amp;
into plain ampersands, but there could be all kinds of HTML  
characters

in there. Is there a category on NSString out there I could
use for this?

I read somewhere that I could use an NSAttributedString and
initWithHTML, but that leaves me with an empty string. I'm guessing
because it's
inside a head tag? Not sure.

I'm also open to using something more intelligent than my current
method of searching the string for link  to find the rss feed, if
there's perhaps an
easier way that would also convert the HTML characters for me. Maybe
webkit has something for me?

I look forward to your replies, and you have my thanks in advance.

 - Drarok
___

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/aurora.phoenix.draco%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]


Binding across different Nib

2008-10-19 Thread gMail.com
Hi,
I have recently discovered the bind features and I have found it's a great
technology. It really saves a lot of time. I have added a NSObjectController
to the xib file, connected it to MYClass and my test worked well.

Now I have a MyDocument.xib file containing the controller and the window of
my document. And I have a different MainMenu.xib file containing the
Inspector window and InspectorObject and the inspectorController. I wouldn't
put the Inspector window in the MyDocument xib file because I should have
only one Inspector window and several documents windows open.

So now, how to connect the NSObjectController to the active document?
Actually I have put the inspectorController in the MainMenu.xib, and coded
[inspectorController setContent:self];
in the windowControllerDidLoadNib in my MyDocument class. When I create a
new document, it works. But I really need to put this statement in something
like onActivateDocument method.

Any idea?
And should I really put the inspectorController in the MainMenu.xib file or
in the MyDocument.xib file?


Thank you
--
LL


___

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: Binding across different Nib

2008-10-19 Thread mmalc crawford


On Oct 19, 2008, at 2:21 PM, gMail.com wrote:


So now, how to connect the NSObjectController to the active document?

http://www.google.com/search?client=safarirls=en-usq=Binding+across+different+Nibie=UTF-8oe=UTF-8 



mmalc

___

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]


Core Data: fetching keypaths through abstract entities

2008-10-19 Thread David Riggle
I want to use a keypath that goes through an abstract entity down into  
a concrete sub-entity. For example, given this data model:


Abstract entity: person
Concrete sub-entities: man, woman

Abstract entity: club
  relationship: members (- person)
Concrete sub-entities: allMale, coed

I want to specify a fetch request like so:

Entity: allMale
Predicate: ALL members.beard  0

Since beard is not an attribute of the abstract person entity that  
members points to, I get the following error at runtime:


NSInvalidArgumentException -- keypath members.beard not found in  
entity NSSQLEntity allMale id=8


Other than redesigning the data model, is there a way to specify the  
concrete entities that Core Data should use at each point in the  
keypath? I.e. something like ALL members.(man)beard  0?

___

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: what do you use to make icons and similar?

2008-10-19 Thread Graham Cox


On 20 Oct 2008, at 1:32 am, John Joyce wrote:


If you don't have skill, pay somebody to do it.



Not always an option, even if desirable. For a small one-man shop,  
consider these prices, which I received from a certain icon shop that  
is promoted (among several) on Apple's own site's business resources.


They are possibly reasonable if you already have an established  
business but for a startup? Our app will probably end up needing about  
200 icons overall throughout its UI. So together with the app icon we  
are looking at ~$105,000. That's crazy.





The cost of a logo/application icon is $2500.

Mac OS X toolbar icons are $525/icon and come in all the standard  
sizes and file formats the platform supports.


Web icons:
32x32 - $262/icon
24x24 - $175/icon


___

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]


Pointing in the right direction for an XCode 3 pref pane.

2008-10-19 Thread Adam Penny

Hi all,

I'm a novice as far as Cocoa is concerned having only just finished  
Aaron Hillegass' book on programming for OS X. It's been going fairly  
well until I actually wanted to apply the ideas to my own project!


I've written a ruby command line utility that has a model stored in a  
plist file and I felt a prefpane would be a good solution for editing  
the Plist.


I have some very basic questions that I'm fairly ashamed that I even  
have to ask, but I've scoured the web for prefpane based tutorials for  
XCode 3 without joy, so there's nothing for it but to go ahead and ask  
a stupid question.


Having constructed a preference subclass with the appropiate outlets  
corresponding to those I've placed in the nib file, I'm getting an  
NSObject and setting it's class to the preference pane subclass with  
my outlets in it, but this seems to be giving me an unexpected choice  
of outlets when I'm trying to connect them.  I was hoping to see the  
outlets broadcastIP, printers and servers. Instead I see  
_FirstKeyView, _InitialKeyView, _LastKeyView window and New  
Referencing Outlet. Am I supposed to use something other than an  
NSObject when it's a preference pane in order to make connections?


Thank you very much,

Adam Penny


___

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: NSUserDefaults and binding to an NSDictionary

2008-10-19 Thread Todd Ouzts
Not sure how to best join a thread since there's no Reply link on  
Apple Mailing Lists, but...
I've been struggling to do what Daniel wants for a week and can't  
figure it out either. My user defaults are not a flat list and I need  
to be able to bind to subdictionary values in Interface Builder.
I've tried using NSDictionaryController and NSArrayController but they  
just generate runtime errors or populate my NSTextFields with values  
like (.


So can you please elaborate, Matt? The only place I see a Handles  
Content as Compound Value checkbox in IB is on an NSObjectController.  
But Apple's docs don't explain when or how to use this.
There must be a simpler solution to this common issue. I too expected  
a syntax like DictionaryName.KeyName to work in IB's Bindings pane.  
Anything more than that seems heavy-handed.


Thanks,
Todd

On or about 10/16/06 12:15 PM, thus spake Daniel Tapie
[EMAIL PROTECTED]:

 Hi Matt,

 Are you implying I cannot use the Shared Defaults Controller in this
 case?

No. m.

 On 16 oct. 06, at 21:02, Matt Neuburg wrote:

 On Mon, 16 Oct 2006 14:23:24 +0200, Daniel Tapie
 [EMAIL PROTECTED]
 said:
 Hi there,

 I have a simple question regarding bindings and user defaults  
and I
 could not find an answer in any of the mailing lists (it is  
probably

 very obvious).

 My user defaults contain a few booleans, strings and numbers all  
of

 which work fine when bound to various text fields and checkboxes.

 So, my question is: how do I bind values that are included in an
 NSDictionary which itself is one of my user defaults?

 Here is the typical structure of my user defaults:

 -- Key: @Preference 1, Value (NSString): @any string
 -- Key: @Preference 2, Value (NSNumber): 1234
 -- Key: @Sub Preferences, Value (NSDictionary):
  -- Key: @Sub Preference 1, Value (NSString): @any string
  -- Key: @Sub Preference 2, Value (NSNumber): 4567


 So, I tried binding a text field to Sub Preferences.Sub  
Preference

 1 but all it does is create a Sub Preferences.Sub Preference 1
 string and not a dictionary containing the string.

 Aside from the question of how you are naming your keys, the big
 trick here
 is to pass thru a controller where Handles Content as Compound
 Value is
 checked. m.

 --
 matt neuburg, phd = [EMAIL PROTECTED], http://www.tidbits.com/matt/
 A fool + a tool + an autorelease pool = cool!
 AppleScript: the Definitive Guide - Second Edition!
 http://www.amazon.com/gp/product/0596102119







 Daniel Tapie


___

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: Pointing in the right direction for an XCode 3 pref pane.

2008-10-19 Thread Nick Zitzmann


On Oct 19, 2008, at 9:33 AM, Adam Penny wrote:

Having constructed a preference subclass with the appropiate outlets  
corresponding to those I've placed in the nib file, I'm getting an  
NSObject and setting it's class to the preference pane subclass with  
my outlets in it, but this seems to be giving me an unexpected  
choice of outlets when I'm trying to connect them.  I was hoping to  
see the outlets broadcastIP, printers and servers. Instead I see  
_FirstKeyView, _InitialKeyView, _LastKeyView window and New  
Referencing Outlet. Am I supposed to use something other than an  
NSObject when it's a preference pane in order to make connections?



Have you tried manually loading the header into IB by dragging the  
file onto the nib window? IB is supposed to automatically loads  
headers, but sometimes it doesn't.


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



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: NSUserDefaults and binding to an NSDictionary

2008-10-19 Thread Steven Riggs

Hey Todd,

This worked for me...

In interface builder, you will need an Array controller
Mode: ClassClass Name:NSMutableDictionary
Content Array bound to Shared User Defaults Controller -  controller  
key:values -  modal key path:yourDefaultsKey

Make sure handles content as a compound value is checked here.

Good luck,
Steven Riggs
http://www.stevenriggs.com

On Oct 19, 2008, at 5:16 PM, Todd Ouzts wrote:

Not sure how to best join a thread since there's no Reply link on  
Apple Mailing Lists, but...
I've been struggling to do what Daniel wants for a week and can't  
figure it out either. My user defaults are not a flat list and I  
need to be able to bind to subdictionary values in Interface Builder.
I've tried using NSDictionaryController and NSArrayController but  
they just generate runtime errors or populate my NSTextFields with  
values like (.


So can you please elaborate, Matt? The only place I see a Handles  
Content as Compound Value checkbox in IB is on an  
NSObjectController. But Apple's docs don't explain when or how to  
use this.
There must be a simpler solution to this common issue. I too  
expected a syntax like DictionaryName.KeyName to work in IB's  
Bindings pane. Anything more than that seems heavy-handed.


Thanks,
Todd

On or about 10/16/06 12:15 PM, thus spake Daniel Tapie
[EMAIL PROTECTED]:

 Hi Matt,

 Are you implying I cannot use the Shared Defaults Controller in  
this

 case?

No. m.

 On 16 oct. 06, at 21:02, Matt Neuburg wrote:

 On Mon, 16 Oct 2006 14:23:24 +0200, Daniel Tapie
 [EMAIL PROTECTED]
 said:
 Hi there,

 I have a simple question regarding bindings and user defaults  
and I
 could not find an answer in any of the mailing lists (it is  
probably

 very obvious).

 My user defaults contain a few booleans, strings and numbers  
all of

 which work fine when bound to various text fields and checkboxes.

 So, my question is: how do I bind values that are included in an
 NSDictionary which itself is one of my user defaults?

 Here is the typical structure of my user defaults:

 -- Key: @Preference 1, Value (NSString): @any string
 -- Key: @Preference 2, Value (NSNumber): 1234
 -- Key: @Sub Preferences, Value (NSDictionary):
  -- Key: @Sub Preference 1, Value (NSString): @any string
  -- Key: @Sub Preference 2, Value (NSNumber): 4567


 So, I tried binding a text field to Sub Preferences.Sub  
Preference

 1 but all it does is create a Sub Preferences.Sub Preference 1
 string and not a dictionary containing the string.

 Aside from the question of how you are naming your keys, the big
 trick here
 is to pass thru a controller where Handles Content as Compound
 Value is
 checked. m.

 --
 matt neuburg, phd = [EMAIL PROTECTED], http://www.tidbits.com/matt/
 A fool + a tool + an autorelease pool = cool!
 AppleScript: the Definitive Guide - Second Edition!
 http://www.amazon.com/gp/product/0596102119







 Daniel Tapie


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/steven.riggs%40me.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]


[OT] How do people use and contribute to this list?

2008-10-19 Thread Kiel Gillard
Hi all,

I subscribe to the cocoa-dev list RSS feed instead of receiving
individual or digest emails. I find this approach is a fast and
convenient method to scan the topics, examine individual messages and
receive regular updates to the cocoa-dev's content without flooding my
inbox. In contrast, if I choose to use the digest mode, I have to
scroll or search digests for particular topics and delete digest
messages once I'm done with them, which is obviously more tedious.
Using an RSS feed reader, it can automatically check for new content
and with a keystroke investigate or dismiss content. Given that I read
the list more than I contribute to it, I prefer using the RSS feed.

However the RSS feed approach carries two problems. Firstly, I cannot
reply to individuals off-list because their email addresses are
censored. Finally, my contributions become tedious to compose as I
have to copy and paste relevant information such as previous messages
and subject headers into the new reply.

Can anyone offer any advice or suggestions? Or should I settle for the
cumbersome digest mode?

Thanks,

Kiel Gillard
___

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: [OT] How do people use and contribute to this list?

2008-10-19 Thread Rob Keniger


On 20/10/2008, at 10:32 AM, Kiel Gillard wrote:


Can anyone offer any advice or suggestions? Or should I settle for the
cumbersome digest mode?



Why not just create a mail folder and add a rule to move Cocoa-Dev  
messages to it? This is standard procedure AFAIK.


--
Rob Keniger



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: [OT] How do people use and contribute to this list?

2008-10-19 Thread Kiel Gillard
On Mon, Oct 20, 2008 at 11:47 AM, Rob Keniger [EMAIL PROTECTED] wrote:

 On 20/10/2008, at 10:32 AM, Kiel Gillard wrote:

 Can anyone offer any advice or suggestions? Or should I settle for the
 cumbersome digest mode?


 Why not just create a mail folder and add a rule to move Cocoa-Dev messages
 to it? This is standard procedure AFAIK.

Thanks for your reply, Rob. However, I still have to scroll or search
digests for particular topics and delete digest messages once I'm done
with them, which is obviously more tedious and involved than just
hitting space bar in NetNewsWire, for example. Filtering cocoa-dev
messages doesn't enable me to quickly scan and identify threads I
would like to contribute to like the RSS feed allows me to.

Kiel
___

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: [OT] How do people use and contribute to this list?

2008-10-19 Thread Rob Keniger


On 20/10/2008, at 10:55 AM, Kiel Gillard wrote:


Filtering cocoa-dev
messages doesn't enable me to quickly scan and identify threads I
would like to contribute to like the RSS feed allows me to.



In Mail, select View  Organize by Thread. Works for me.

--
Rob Keniger



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: [OT] How do people use and contribute to this list?

2008-10-19 Thread Kiel Gillard
Thanks for the replies all, these are helpful suggestions.

Kiel

On Mon, Oct 20, 2008 at 12:12 PM, Nathan [EMAIL PROTECTED] wrote:
 The easiest thing to do is just set up a smartbox, except that it sorts, it
 doesn't move the messages. Set up a rule and mailbox, to simply move all
 cocoalist messages there. Also, don't receive in digest mode. You'll get
 more messages, but it's easier to find old topics you're looking for then. I
 rarely post, but I haven't deleted any so I now have a huge collection of
 searchable questions and multiple answers for all sorts of problems.
 Nate

 On Oct 19, 2008, at 20:32, Kiel Gillard [EMAIL PROTECTED] wrote:

 Hi all,

 I subscribe to the cocoa-dev list RSS feed instead of receiving
 individual or digest emails. I find this approach is a fast and
 convenient method to scan the topics, examine individual messages and
 receive regular updates to the cocoa-dev's content without flooding my
 inbox. In contrast, if I choose to use the digest mode, I have to
 scroll or search digests for particular topics and delete digest
 messages once I'm done with them, which is obviously more tedious.
 Using an RSS feed reader, it can automatically check for new content
 and with a keystroke investigate or dismiss content. Given that I read
 the list more than I contribute to it, I prefer using the RSS feed.

 However the RSS feed approach carries two problems. Firstly, I cannot
 reply to individuals off-list because their email addresses are
 censored. Finally, my contributions become tedious to compose as I
 have to copy and paste relevant information such as previous messages
 and subject headers into the new reply.

 Can anyone offer any advice or suggestions? Or should I settle for the
 cumbersome digest mode?

 Thanks,

 Kiel Gillard
 ___

 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/lipton_lover%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: Mouse Coalescing

2008-10-19 Thread Graham Cox


On 20 Oct 2008, at 12:06 pm, Ian was here wrote:

I turned off mouse coalescing with a call to  
SetMouseCoalescingEnabled( false, NULL ). This gave me beautiful  
drawing. Only problem is that it's slow and takes a while to catch  
up after the mouse up event.


This is kind of an off the wall question, but is there another way  
to do this? I feel my only other option may be to use OPenGL, where  
the drawing would happen much faster.



I suspect the problem isn't the number of mouse events, but the number  
of points on the path this leads to. A path with more than a thousand  
or so points will become slow to draw.


Instead of using many points with straight line segments, how about  
using fewer points but calculating where the bezier control points  
should be and use curve segments? It will still be smooth but have  
much fewer waypoints and thus draw a lot faster.


Control points can be placed by using the fact that the line between  
the control point and the end (or start) point of the curve is the  
tangent to the curve, and this can be found by detecting the direction  
the mouse was travelling in. You can obtain this from the deltaX and  
deltaY parameters of the mouse event.


hth,

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: [OT] How do people use and contribute to this list?

2008-10-19 Thread Graham Cox


On 20 Oct 2008, at 12:09 pm, Rob Keniger wrote:


In Mail, select View  Organize by Thread. Works for me.



And don't subscribe to the digest, but to the full feed.

--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]


NSMetadataQuery question

2008-10-19 Thread Timothy Reaves
	I'm trying to write a query where the meta data in question is an  
NSDate stored as a binary plist.  Everything I am doing is failing.  I  
have tried '(myKey  %@, date] where date is an instance of NSDate,  
where it is a NSTimeInterval, and a string.  Nothing returns data (or  
even calls my callback).


	When I go to Finder, and create a raw query, I do get the data I  
want.  I use the $time.now() macro.  This doesn't even compile in an  
NSPredicate.


Any advice?
___

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: mutatingNodes error when binding to an NSArray

2008-10-19 Thread Ron Lue-Sang

NSOutlineView bindings only work when bound up to an NSTreeController.

On Oct 19, 2008, at 4:26 AM, Ken Tozier wrote:


Hi

I'm working my first NSOutlineView app and trying to programatically  
bind the the content property of an NSOutlineView to a mutable  
files array property of a class and keep getting the following  
error in the console.


*** -[PMProjectView _mutatingNodes]: unrecognized selector sent to  
instance 0x11d21ff0


My files view is significantly different than a simple Finder-like  
hierarchy so the example code here (http://developer.apple.com/documentation/Cocoa/Conceptual/OutlineView/Articles/UsingOutlineDataSource.html 
) was of only minimal help.


I did a Google, Apple dev and source code search for that method and  
came up empty. The NSOutlineView documentation makes no mention of  
this method so what is it looking for? As mentioned, this is my  
first attempt at using NSOutlineView, so I have no clue what could  
be causing this error.


Any help appreciated


Looking at the GDB back trace, the trouble seems to start in the  
following [PMProjectView initTable] method


- (void) initTable
{
NSTableColumn   *nameColumn;

NSTextFieldCell *nameCell;


NSRect  selfFrame   = [self frame],
conFrame;

// get content frame size
conFrame= NSMakeRect(0, 0, selfFrame.size.width, 0);

// create text cell
nameCell= [[NSTextFieldCell alloc] init];

// create the name column
nameColumn  = [[NSTableColumn alloc] initWithIdentifier: 
@name];
[nameColumn setDataCell: nameCell];
[nameColumn setMinWidth: 1000];
	[nameColumn bind: @value toObject: self withKeyPath:  
@files.name options: nil];


// create the table
table   = [[NSOutlineView alloc] initWithFrame: conFrame];

NSLog(@adding name column);
[table addTableColumn: nameColumn];

NSLog(@setting header view);
[table setHeaderView: nil];

[table setAutoresizingMask: NSViewWidthSizable | NSViewMaxYMargin];
[table setUsesAlternatingRowBackgroundColors: YES];
[table setFocusRingType: NSFocusRingTypeNone];
	[table setColumnAutoresizingStyle:  
NSTableViewLastColumnOnlyAutoresizingStyle];


// this line prints to the console
NSLog(@binding content);

// This is where it seems to be failing
	[table bind: @content toObject: self withKeyPath: @files  
options: nil];


// this line never prints
NSLog(@bound content ok);
}

Here's the relevant portion of the GDB backtrace:

#0  0x936f1ff4 in ___TERMINATING_DUE_TO_UNCAUGHT_EXCEPTION___ ()
#1  0x907a70fb in objc_exception_throw ()
#2  0x936f934a in -[NSObject doesNotRecognizeSelector:] ()
#3  0x936f794c in ___forwarding___ ()
#4  0x936f7a12 in __forwarding_prep_0___ ()
#5  0x98d7 in -[NSOutlineViewBinder  
_observeValueForKeyPath:ofObject:context:] ()
#6  0x965d in -[NSOutlineViewBinder  
observeValueForKeyPath:ofObject:change:context:] ()

#7  0x92fede77 in -[NSBinder _performConnectionEstablishedRefresh] ()
#8  0x92fe60e8 in -[NSObject(NSKeyValueBindingCreation)  
bind:toObject:withKeyPath:options:] ()
#9  0x000135f6 in -[PMProjectView initTable] (self=0x11d22430,  
_cmd=0x16c82) at /Users/kentozier/Desktop/PageManager Dev (Leopard)/ 
PMWidgetLab/PMProjectView.m:170


___

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

This email sent to [EMAIL PROTECTED]



--
RONZILLA



___

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: [OT] How do people use and contribute to this list?

2008-10-19 Thread Andrew Merenbach


On Oct 19, 2008, at 5:32 PM, Kiel Gillard wrote:


Hi all,

I subscribe to the cocoa-dev list RSS feed instead of receiving
individual or digest emails. I find this approach is a fast and
convenient method to scan the topics, examine individual messages and
receive regular updates to the cocoa-dev's content without flooding my
inbox. In contrast, if I choose to use the digest mode, I have to
scroll or search digests for particular topics and delete digest
messages once I'm done with them, which is obviously more tedious.
Using an RSS feed reader, it can automatically check for new content
and with a keystroke investigate or dismiss content. Given that I read
the list more than I contribute to it, I prefer using the RSS feed.

However the RSS feed approach carries two problems. Firstly, I cannot
reply to individuals off-list because their email addresses are
censored. Finally, my contributions become tedious to compose as I
have to copy and paste relevant information such as previous messages
and subject headers into the new reply.

Can anyone offer any advice or suggestions? Or should I settle for the
cumbersome digest mode?

Thanks,

Kiel Gillard


Hi!  What I do is subscribe to the list for every message, then filter  
using a Mail rule into, essentially, a special Mailing Lists folder --  
then I view that folder as organized by thread.  I further refine this  
with smart mailboxes to filter by what's today, and also one to filter  
by anything older than three days.  Every day I simply go to that last  
one and delete its contents -- I don't have room in my account to be  
archiving a ton of messages, but I like to keep the past couple of  
days'.


Also, I'm probably overthinking this, but your message isn't (in my  
opinion) exactly off-topic -- more of a meta-topic.  So I wonder  
whether a subject heading of [META] How do people use and contribute  
to this list? would have been cool.


Yeah, I'm overthinking it.

Cheers,
Andrew


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]

What's the modern solution for sharing data between Cocoa to Windows

2008-10-19 Thread Erik Buck
If you watch this video from 1995 and the particularly three  
subsequent parts of the video, you'll see that NeXT offered an  
interesting technology for seamless communication between Openstep/ 
Cocoa objects on the server and rich Windows clients running Excel and  
Visual Basic applications:

http://www.youtube.com/watch?v=Hu-jvAWTZ9ofeature=related

All of that is gone now.  Apple chucked it all 10 years ago.  What is  
the modern solution ?


Suppose I have Excel running on a Windows machine and I want to grab  
data from Cocoa objects running on a remote Mac OS X server.  How do I  
get the data out of the Cocoa objects and into Excel ?  Suppose I  
succeed in getting the data out of a Cocoa application and I then I  
use the data to produce pie chart in Excel.  Now, how do I  get an  
image of that chart show to up on a web page produced by a web server  
running on Mac OS X ?


I apologize in advance if the answers are obvious.  I have little to  
no experience in the realm of web publishing, so I might not be asking  
the right questions ?I basically just want to do what Steve Jobs  
demoed in 1995.



___

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: Mouse Coalescing

2008-10-19 Thread Michael Ash
On Sun, Oct 19, 2008 at 9:06 PM, Ian was here [EMAIL PROTECTED] wrote:
 I have a drawing application that uses a pen tool to do free style drawing. I 
 am using Quartz in OS X 10.4 (NSBezierPath). The initial problem I had was 
 not getting enough points between event cycles if the user moved the mouse 
 too quickly. I turned off mouse coalescing with a call to 
 SetMouseCoalescingEnabled( false, NULL ). This gave me beautiful drawing. 
 Only problem is that it's slow and takes a while to catch up after the mouse 
 up event.

 This is kind of an off the wall question, but is there another way to do 
 this? I feel my only other option may be to use OPenGL, where the drawing 
 would happen much faster.

As you hint, the problem is not mouse coalescing but performance.
OpenGL won't help with this, because your drawing performance is going
to be tied to the refresh rate of your monitor anyway.

So how do you fix it? Make your event handler run faster. But how can
you do that if you can't make drawing go faster? Easy: decouple mouse
event handling from drawing.

You'll want to disable coalescing as you have done. But then in the
event handler, you do *not* want to redraw every time you get a mouse
moved event. Doing so guarantees that once the rate of mouse-moved
events exceeds your monitor's refresh rate (or your ability to draw,
if it happens to be worse) then lag will develop.

Instead, do what I'd call display coalescing. Don't redraw with
every event. Instead, have a drawing flag. When you get a mouse event
and the flag isn't set, set it and then post a custom event to the
event queue. Then when you receive that custom event, redraw. This
will essentially coalesce all the mouse moved events that were
received while drawing so that you stay up to date with them. You will
have to ensure that the non-drawing parts of your code always run
faster than mouse events come in, but that should be trivial if you're
just adding points to some sort of data structure.

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: [OT] How do people use and contribute to this list?

2008-10-19 Thread Scott Ribe
 However, I still have to scroll or search
 digests for particular topics and delete digest messages once I'm done
 with them, which is obviously more tedious and involved than just
 hitting space bar in NetNewsWire, for example. Filtering cocoa-dev
 messages doesn't enable me to quickly scan and identify threads I
 would like to contribute to like the RSS feed allows me to.

I use Entourage. Set up a rule to move messages into a folder, view by
threads, view unread only. Periodically look at the folder to see what's
new, read anything interesting, then mark all as read. About once a year, I
mass delete messages older than a year or so.

The view unread only option is the reason I haven't switched to Mail and
still use Entourage.

-- 
Scott Ribe
[EMAIL PROTECTED]
http://www.killerbytes.com/
(303) 722-0567 voice


___

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: What's the modern solution for sharing data between Cocoa to Windows

2008-10-19 Thread Kyle Sluder
On Sun, Oct 19, 2008 at 10:45 PM, Erik Buck [EMAIL PROTECTED] wrote:
 All of that is gone now.  Apple chucked it all 10 years ago.  What is the
 modern solution ?

WS-* (WebServicesCore.framework).
http://developer.apple.com/documentation/Networking/Conceptual/UsingWebservices/1_intro_folder/chapter_1_section_1.html

HTH,
--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]


Is there a character limit in (NSString* title) and (NSString* message) in NSBeginCriticalAlertSheet dialog?

2008-10-19 Thread Lance Kwan
Is there a character limit in (NSString* title) and (NSString* message) in 
NSBeginCriticalAlertSheet dialog?

or there is limited characters for (NSString* message)?

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://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: Updating a Static Text and Slider From High Priority Thread While Resizing a Window [SOLVED]

2008-10-19 Thread Peter Zegelin

Actually I just found an old thread:

'Problem redrawing views while window resize button is held'

 and the suggestion was to use [window displayIfNeeded]; to force a  
window update. This works, so problem solved.


Thanks again,

Peter



On 20/10/2008, at 2:33 PM, Peter Zegelin wrote:

Thanks for your reply Andrew. Unfortunately it still doesn't work.  
The text or slider don't update at all if I click and hold on the  
resize widget. It will only update if I move the mouse and it is  
very 'jerky' even when I do that.


Here is what I have. UpdatePosition is called from my thread and I  
have simplified a few things.:


- (void)updatePosition:(id)anObject{
   NSAutoreleasePool*pool = [[NSAutoreleasePool alloc] init];

   while (1) {

myStopWatch-updatePosition();

		[self performSelectorOnMainThread:@selector(updateGUI)  
withObject:nil waitUntilDone:NO];


[NSThread sleepForTimeInterval:.001];   

		std::cout  MainThread   myStopWatch-getPosition();   
std::endl;

   }

   [pool release];
}


- (void)updateGUI{
double  currentPosition;


currentPosition = myStopWatch-getPosition();

[ positionLabel setDoubleValue: currentPosition];
[ positionLabel setNeedsDisplay:YES];

	std::cout  GUI Thread  currentPosition  std::endl;   --  
this doesn't block

}

As you can see updateGUI is being called all the time as std::cout  
keeps spitting out data, but my text label doesn't update at all. It  
is as if clicking on the resize widget runs in its own loop and only  
updates the window when it actually changes size. Interestingly an  
app such as GarageBand also stops updating its GUI if a song is  
playing and you click and hold on the resize widget.


Peter




On 19/10/2008, at 1:36 PM, Andrew Merenbach wrote:



On Oct 18, 2008, at 7:27 PM, Andrew Merenbach wrote:


On Oct 18, 2008, at 4:23 AM, Peter Zegelin wrote:


Hi,

Still fairly new to Cocoa here.

I have a high priority thread that that for the moment just calls  
back as often as possible to a method that updates a static text  
object with the current time. A slider is also updated to a new  
value. Its a bit like a stop watch with a position indicator.  
This all works well until I resize a window or invoke a menu when  
the whole thing just grinds to a halt. If I call std::cout with  
the value the debugger shows a continuous stream of data so I  
know the thread is still being called as often as possible but  
the text and slider aren't updating. Is there any way to get  
these items to update under these circumstances?  I tried calling  
[label setNeedsDisplay] but that just caused a crash.



thanks!

Peter Zegelin


Hi, Peter,

Is it possible that your GUI objects are being updated from the  
secondary thread?  You'll need to use - 
performSelectorOnMainThread: to channel updates from the high- 
priority thread to the main thread, since only the main thread is  
allowed to touch the graphical AppKit classes (which are generally  
not threadsafe, with the possible exception of  
NSProgressIndicators).  Hopefully this solves your issue!


Cheers,
Andrew



Erm, sorry to respond to myself, but I was lazy -- just for  
clarity, the full methods available are (from the docs):


	- (void)performSelectorOnMainThread:(SEL)aSelector withObject: 
(id)arg waitUntilDone:(BOOL)wait;
	- (void)performSelectorOnMainThread:(SEL)aSelector withObject: 
(id)arg waitUntilDone:(BOOL)wait modes:(NSArray *)array;


-- Andrew




___

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]


Mutable arrays

2008-10-19 Thread DKJ
Since mutable arrays and dictionaries expand as required when new  
objects are added, when should one use -initWithCapacity: methods?


dkj
___

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: Mutable arrays

2008-10-19 Thread Graham Cox


On 20 Oct 2008, at 4:06 pm, DKJ wrote:

Since mutable arrays and dictionaries expand as required when new  
objects are added, when should one use -initWithCapacity: methods?



I'd guess they're only worth using if you know you are about to  
populate one with a lot of items and the performance hit of letting  
them grow naturally is worth avoiding. There may also be private  
classes within the cluster that are optimised for certain numbers of  
objects, so this will act as a hint as to which one should be used.


--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]


Detecting system preference for trackpad zooming.

2008-10-19 Thread Graham Cox
How can I programatically detect the state of the Zoom while holding  
checkbox and modifier key choice in System Prefs - Keyboard  Mouse - 
 Trackpad?


This setting can clash with a view zooming feature in my app so I'd  
like to be able to detect it and adjust my own settings accordingly,  
and/or warn the user.


tia,

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: Mutable arrays

2008-10-19 Thread j o a r


On Oct 19, 2008, at 10:11 PM, Graham Cox wrote:

Since mutable arrays and dictionaries expand as required when new  
objects are added, when should one use -initWithCapacity: methods?


I'd guess they're only worth using if you know you are about to  
populate one with a lot of items and the performance hit of letting  
them grow naturally is worth avoiding. There may also be private  
classes within the cluster that are optimised for certain numbers of  
objects, so this will act as a hint as to which one should be used.



My suggestion would be to never use the -initWithCapacity: methods  
unless you know that you have a good reason for using them. I would  
expect that in at least 99% of the times that you use collections  
there is no measurable difference in performance between using - 
initWithCapacity: over regular -init.


Some general suggestions for best practices wrt. optimizations:

1)  Measure first
2)  Implement supposed optimization
3)  Measure to see the impact of the code change
	4)	Based on the result of #3, either scrap your changes, or document  
the optimized code


Skipping over step #1 and #3 is always a mistake - It's almost always  
the case that you'll end up surprised by what you find! We also often  
forget to do #4, something that typically leads to maintenance  
problems later on.



j o a r


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]