How to catch all mouse clicking (or avoid multiple click filtering in startTrackingAt)

2008-04-25 Thread Joan Lluch (casa)
I have implemented a NSButtonCell subclass in the usual way to catch  
mouse tracking. I get the startTrackingAt and stopTracking messages  
called correctly on the first click of the mouse. However the  
startTrackingAt is not quickly called again if I quickly click again  
the mouse, such as if I did a double click. I mean, if I perform a  
double or triple click I only get one pair of startTrackingAt and  
stopTracking calls instead of the desired two or three pairs. So the  
desired behaviour is to be able to catch all the mouse clicking  
activity in almost real time. What I get instead is some filtering of  
the actual mouse clicking. This is the way I implemented the methods


@implementation TrackButtonCell


+ (BOOL)prefersTrackingUntilMouseUp
   {
return YES ;
   }


- (BOOL)startTrackingAt:(NSPoint)startPoint inView:(NSView *)controlView
   {
NSTableView *tableView = (NSTableView *)controlView ;

// do something

NSLog( @mouse down\n) ;
return YES ;
   }

- (void)stopTracking:(NSPoint)lastPoint at:(NSPoint)stopPoint inView: 
(NSView *)controlView mouseIsUp:(BOOL)flag

   {
NSTableView *tableView = (NSTableView *)controlView ;

// do something

NSLog( @mouse up\n ) ;
  }

@end


I observed that if I set the faster double click rate in System  
Preferences, then I am able to catch all the clicking activity, so  
the issue must be related to some multiple click filtering that Cocoa  
does before calling the above code.


Sorry for my simple English, it is not my native language though I  
try to do my best, I hope you all will understand.


Thanks in advance for any reply.

Joan
___

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

Please do not post admin requests or moderator comments to the list.
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: How to catch all mouse clicking (or avoid multiple click filtering in startTrackingAt)

2008-04-25 Thread Ken Thomases

On Apr 25, 2008, at 1:29 AM, Joan Lluch (casa) wrote:
I have implemented a NSButtonCell subclass in the usual way to  
catch mouse tracking. I get the startTrackingAt and stopTracking  
messages called correctly on the first click of the mouse. However  
the startTrackingAt is not quickly called again if I quickly click  
again the mouse, such as if I did a double click. I mean, if I  
perform a double or triple click I only get one pair of  
startTrackingAt and stopTracking calls instead of the desired two  
or three pairs. So the desired behaviour is to be able to catch all  
the mouse clicking activity in almost real time. What I get instead  
is some filtering of the actual mouse clicking. This is the way I  
implemented the methods


I'm guessing that this filtering is being done in -[NSControl  
mouseDown:].  That is, if [theEvent clickCount] is greater than one,  
it doesn't invoke the cell's trackMouse:inRect:ofView:untilMouseUp:  
method.


You can try subclassing the NSControl in question (presumably an  
NSButton?), overriding mouseDown:, and passing a different object to  
[super mouseDown:aDifferentEvent].  You can either create a new  
NSEvent whose properties are all the same as theEvent, or you can  
wrap theEvent in a proxy object which forwards all messages  
faithfully except clickCount, which it intercepts to always return 1.


Good luck,
Ken
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Core Animation Deadlock

2008-04-25 Thread Colin Cornaby
I may have the bug isolated. I fixed a bug in my own code, and the  
deadlock is no longer happening. It may be related to a situation  
involving removing a sublayer from it's super. In my code I was  
removing a layer that I didn't intend to remove, and the deadlock  
would result.


I still think there is an underlying bug in CoreAnimation. Certainly  
you shouldn't be able to cause a deadlock. If I can isolate the bug to  
a specific case I will build a test case and submit.


On Apr 24, 2008, at 11:11 PM, Colin Cornaby wrote:

Enabled NSZombie and friends didn't seem to fix the issue (or log  
anything.)


This isn't going to be too easy to track down. Once I figure out  
what series of events is triggering it I will try to put together a  
test case.


On Apr 24, 2008, at 9:14 PM, John Harper wrote:



On Apr 24, 2008, at 7:38 PM, Colin Cornaby wrote:

It looks like NSUIHeartBeat could be attempting to lock something.  
Although I could be wrong, it may not be related.


The render thread got stuck while depth sorting:


Thread 11 (process 13823 thread 0x8803):
#0  0x90a27d9c in CARenderLayerDepthSortSublayers ()
#1  0x90a27611 in prepare_layer0 ()
#2  0x90a27597 in prepare_layer0 ()
#3  0x90a27597 in prepare_layer0 ()
#4  0x90a26dd4 in CARenderUpdateAddContext ()
#5  0x90a25f72 in view_draw ()
#6  0x90a34f60 in view_display_link ()
#7  0x90a26936 in link_callback ()
#8  0x94cc1015 in CVDisplayLink::performIO ()
#9  0x94cc1641 in CVDisplayLink::runIOThread ()
#10 0x958e06f5 in _pthread_start ()
#11 0x958e05b2 in thread_start ()



this is done while holding the lock the main thread is trying to  
take. I can't think of any way you could cause this other than heap  
corruption, or maybe over-releasing objects, so it could be a CA  
bug. I would try running with NSZombies enabled first; if you don't  
see anything wrong that way, file a bug report (with a test case  
showing the hang if possible, otherwise there's probably no way we  
can debug it…)


John





___

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

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

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


One pixel width. One.

2008-04-25 Thread Lorenzo
I am trying to draw a line with 1 pixel width. No matter whether the view is
scaled or scrolled, I want to see a 1 pixel thick line. I scale the view
with

NSRect frameSize = [self frame].size;
NSSize newSize = NSMakeSize(frameSize.width / mScaleFactor,
 frameSize .height / mScaleFactor);
[self setBoundsSize:newSize];


In the drawRect method I code

[[NSGraphicsContext currentContext] setShouldAntialias:NO];
[NSBezierPath setDefaultLineWidth:1.0 / mScaleFactor];
[NSBezierPath strokeLineFromPoint:NSMakePoint(0.0, 10.0
  toPoint:NSMakePoint(10.0, 10.0)];

I works pretty well, but sometimes, depending on the scroll position or the
mScaleFactor, I get a line with 2 pixels width. Even with a mScaleFactor =
1, if I scroll the view, sometimes it looks with 2 pixels width. I even
tried to always set the width to 0.1 and mScaleFactor to always 1. Same
result. And I even tried to always set bounds Origin and bounds Size to
(int) values. Same result.

What do I miss?


Best Regards
-- 
Lorenzo
email: [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: Complex data for webservices

2008-04-25 Thread Niklas Saers

Hi Jeff,
thanks for writing http://iphonedevelopment.blogspot.com/2008/04/web-services-fun_18.html 
   It is a very good writeup of many of the things we've discussed. :-)


What's very relevant to our discussion is the fact that you don't  
mention having to delete half of the generated code. I've ran

WSMakeStubs -x ObjC -name WeatherService -url 
http://www.weather.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl
on my system and sure enough, it creates only a single set of  
interfaces with corresponding implementations, instead of two that are  
generated when I do the same with my service:

WSMakeStubs -x ObjC -name DummyStubs  -url 
http://78.157.102.46:2234/DummyWS/Service1.asmx?WSDL
(if you do a quick grep interface DummyStubs.*|sort after having  
generated them, it will be obvious they are double up)



Another interesting thing is that you mention using NSData, so based  
on your example I created the equivalent for my service with different  
kinds of input parameters:


id testStr = [myService testString:[[NSData alloc] init]];
NSLog(@Found data 1: %@, testStr);
testStr = [myService testString:@];
NSLog(@Found data 2: %@, testStr);
testStr = [myService testString:[[NSObject alloc] init]];
NSLog(@Found data 3: %@, testStr);
testStr = [myService testString:[[NSDictionary alloc] init]];
NSLog(@Found data 4: %@, testStr);

Again, I get nil as an answer:

Found data 1: (null)
Found data 2: (null)
Found data 3: (null)
Found data 4: (null)

Again the fault is:
System.Web.Services.Protocols.SoapException: Server did not recognize  
the value of HTTP Header SOAPAction: SOAPAction.
   at  
System.Web.Services.Protocols.Soap11ServerProtocolHelper.RouteRequest()
   at  
System 
.Web 
.Services.Protocols.SoapServerProtocol.RouteRequest(SoapServerMessage  
message)

   at System.Web.Services.Protocols.SoapServerProtocol.Initialize()
   at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type  
type, HttpContext context, HttpRequest request, HttpResponse response,  
Booleanamp; abortProcessing)


And as we discussed, the following is set in the header: Soapaction:  
SOAPAction



A final thing I wondered about was In many cases, complex objects  
expect an NSDictionary with the xml tag name used as the key and the  
tag's contents as the corresponding object. What do you mean by that?  
Do you have a code example you could clarify it with?


Thanks again

Nik
___

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

Please do not post admin requests or moderator comments to the list.
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: One pixel width. One.

2008-04-25 Thread Graham Cox
Try offsetting the final result by 0.5, so that you draw the actual  
pixel, not anti-alias across two.


G.


On 25 Apr 2008, at 5:19 pm, Lorenzo wrote:
I am trying to draw a line with 1 pixel width. No matter whether the  
view is
scaled or scrolled, I want to see a 1 pixel thick line. I scale the  
view

with

   NSRect frameSize = [self frame].size;
   NSSize newSize = NSMakeSize(frameSize.width / mScaleFactor,
frameSize .height / mScaleFactor);
   [self setBoundsSize:newSize];


In the drawRect method I code

   [[NSGraphicsContext currentContext] setShouldAntialias:NO];
   [NSBezierPath setDefaultLineWidth:1.0 / mScaleFactor];
   [NSBezierPath strokeLineFromPoint:NSMakePoint(0.0, 10.0
 toPoint:NSMakePoint(10.0, 10.0)];

I works pretty well, but sometimes, depending on the scroll position  
or the
mScaleFactor, I get a line with 2 pixels width. Even with a  
mScaleFactor =
1, if I scroll the view, sometimes it looks with 2 pixels width. I  
even
tried to always set the width to 0.1 and mScaleFactor to always 1.  
Same
result. And I even tried to always set bounds Origin and bounds Size  
to

(int) values. Same result.

What do I miss?


Best Regards
--
Lorenzo
email: [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/graham.cox%40bigpond.com

This email sent to [EMAIL PROTECTED]


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Failure on unarchiving a NSBezierPath

2008-04-25 Thread an0
Thanks. But it seems you haven't read to the end. As I said in my first mail:
 Besides, I found the value returned by [NSKeyedUnarchiver
 unarchiveObjectWithData:data] was nil, but I didn't understand why,
 since it was normal when I saved the file using [NSKeyedArchiver
 archivedDataWithRootObject:view.drawing].

On Fri, Apr 25, 2008 at 3:20 AM, Jens Alfke [EMAIL PROTECTED] wrote:
  I suspect what happened is that NSKeyedArchiver returned nil for some
 reason, and the caller of that method then looked at *outError to find the
 reason for the error; but you didn't store anything in there, so it got
 whatever happened to be in that variable, which in this case may have been a
 pointer to the NSDocumentController.

  So try adding a test for nil to your save method. It looks like that's
 where the problem is.

  —Jens
___

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

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

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

This email sent to [EMAIL PROTECTED]


Core Animation Flickering

2008-04-25 Thread Colin Cornaby
I have a CALayer subclass, set to redraw on bounds change, with the  
following draw code (I don't expect it to be meaningful, but I'm  
pasting it here for the sake of completeness.)


- (void)drawInContext:(CGContextRef)ctx
{
CGRect bounds = CGContextGetClipBoundingBox(ctx);
	CGContextDrawImage(ctx, CGRectMake(0,0,18,  
bounds.size.height-18),sideImage);
	CGContextDrawImage(ctx, CGRectMake(0,bounds.size.height-18,18,  
18),cornerImage);
	CGContextDrawImage(ctx,  
CGRectMake(18,bounds.size.height-18,bounds.size.width-36,18),topImage);

CGContextScaleCTM (ctx, -1.0, 1.0);
CGContextTranslateCTM ( ctx, -bounds.size.width, 0.0);
	CGContextDrawImage(ctx,  
CGRectMake(0.0,bounds.size.height-18,18,18),cornerImage);
	CGContextDrawImage(ctx,  
CGRectMake(0.0,0.0,18,bounds.size.height-18),sideImage);

}

It's parent view is set up to change the layers frame to always fill  
the contents of the entire view on resizeWithOldSuperviewSize:.  This  
works great, except for a really annoying flicker that occurs once  
every few seconds while the view is resizing. Every layer in the view  
flickers in and out (stuff like background colors doesn't flicker).


Did I miss some drawing cleanup or something else obvious here?

(I've tried doing this automatically with constraint managers, same  
problem...)

___

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

Please do not post admin requests or moderator comments to the list.
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]


Using a real view in a Table cell

2008-04-25 Thread matt . gough

Hi,

I need to have something that behaves like a table where each cell  
could be a quite complex view with standard controls and sub views  
etc. It needs to run on 10.4 and above, so NSCollectionView is not an  
option.


I seem to have two choices:

1. Implement my own custom view that is independent of NSTableView  
that allows subviews to be stacked on top of each other and maintains  
it own table-like behaviours (selections, column dragging etc).


2. Use an NSTableView and massage each cell into being a view.


Being adventurous, I tried option 2 first to see what I could get for  
free and have come up with something that seems to work.


An example is available at http://idisk.mac.com/mattg/Public/ViewCell.zip

To summarize, I use a custom column subclass which implements:

- (id)dataCellForRow:(int)row
{
	NSView* view = [delegate viewForColumnIdentifier:[self identifier]  
row:row];

ViewCell* cell = [[ViewCell alloc] initWithView:view];

return cell;
}


and a custom cell class:

@interface ViewCell : NSCell
{
NSView* _view;
}

-(id) initWithView:(NSView*)view;

-(void) setView:(NSView*)view;
-(NSView*) view;
@end
@implementation ViewCell


-(id) initWithView:(NSView*)view
{
if ((self = [super initImageCell:nil]) != nil)
[self setView:view];
return self;
}

-(void) dealloc
{
[self setView:nil];
[super dealloc];
}

-(void) setView:(NSView*)newView
{
if (newView != _view)
{
[_view release];
_view = [newView retain];
}
}

-(NSView*) view
{
return _view;
}

- (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView  
*)controlView

{
NSView* view = [self view];
if (!view)
return;
if (![view superview])
[controlView addSubview:view];

NSRect oldFrame = [view frame];
if (!NSEqualRects(oldFrame, cellFrame))
{
//  [controlView setNeedsDisplayInRect:oldFrame]; // Not needed?
[view setFrame:cellFrame];
}
}

@end

There is also a controller which is the table's delegate and  
datasource and knows how to get the real view for a cell



@implementation AttributesController

- (int)numberOfRowsInTableView:(NSTableView *)aTableView
{
return 2; // The sample app only does 2 rows
}


-(NSView*) viewForColumnIdentifier:(id)identifier row:(int)row
{
NSView* result = nil;
if ([identifier isEqualToString:@attributes])
{
result = row == 0 ? attributesView : attributesView2;
}

return result;
}


- (float)tableView:(NSTableView *)tableView heightOfRow:(int)row
{
NSView* view = [self viewForColumnIdentifier:@attributes row:row];
float result = NSHeight([view bounds]);
return result;
}


As you can see, drawInteriorWithFrame is being quite sneaky. It is  
adding the real view associated with the cell as a subview of the  
parent table view. The cell itself never does any drawing, it just  
keeps the location of these extra views in sync with the cells they  
represent.


However all of this cleverness set off two alarm bells:

1. This looks a bit fragile and maybe some future update to  
NSTableView will break this.


2. Whenever I think I am being far too cunning it usually means I have  
overlooked a much simpler way to do what I want.


Does anyone else have any suggestions

Thanks

Matt Gough
___

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

Please do not post admin requests or moderator comments to the list.
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: Failure on unarchiving a NSBezierPath

2008-04-25 Thread Kyle Sluder
On Fri, Apr 25, 2008 at 4:11 AM, an0 [EMAIL PROTECTED] wrote:
 Thanks. But it seems you haven't read to the end. As I said in my first mail:

  Besides, I found the value returned by [NSKeyedUnarchiver
   unarchiveObjectWithData:data] was nil, but I didn't understand why,
   since it was normal when I saved the file using [NSKeyedArchiver
   archivedDataWithRootObject:view.drawing].

But you apparently haven't comprehended Jens' message.  You're not
setting *outError to anything, so whoever is calling your method is
seeing that you've returned NO and is expecting whatever it passed in
as outError to point to an NSError object.  Unfortunately this is not
the case and whatever was in that memory location is receiving bogus
messages -- particularly, -localizedFailureReason, which is an NSError
method.

In short, you're breaking the contract for messages which take an
NSError**.  Set *outError to an NSError object (or nil if you're lazy)
if you're going to return a value that signifies an error.

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


Initial value of on/off buttons

2008-04-25 Thread Yann Disser
I have five textured NSButtons that are set to operate in On Off  
mode. All of them are value-bound to different bools in my application.
Somehow the first button starts in the On-state and the others in  
the off state, no matter which button I bind to which bool. If I  
remove the bindings, the buttons start in the On-state.


Setting the bools in awakeFromNib does not affect the state of the  
buttons. Clicking the buttons however causes my bools to have the  
correct values.


What am I doing wrong? How can I at least set the initial state of my  
buttons? (They are all On in IB)


I just noticed that removing the binding from the first button and  
adding that SAME binding again causes it to behave like the other  
buttons. I can restore the On-behavior by undoing that change. There  
has to be a bug involved, however the only thing I want is that all  
buttons start in the On-state without needing an outlet in my  
controller.


I am thankful for suggestions,
Yann
___

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

Please do not post admin requests or moderator comments to the list.
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: QTMovie grabing while playback

2008-04-25 Thread Bob Smith
Well, I'm glad I had an excuse to play around with Quartz Composer; I  
knew about it but had never spent any time with it, very cool!   
Unfortunately, it doesn't solve my immediate problem.  As far as I  
can tell, compositions won't play streaming video at all.  They work  
great with movies from files, and with local live sources (iSight,  
DV).  But giving the Image With Movie patch an .sdp file just  
results in a static QuickTime logo, it never shows any actual video.


Now I have at least three different methods for adding overlays to  
pre-recorded video, but none of those seem able to deal with RTSP/RTP  
streaming video.  I'm going out on a limb here and conclude this  
isn't just one or the other of the APIs having an issue, rather it is  
a fundamental limitation in QuickTime, which can't (or won't) break  
out individual frames for compositing when it is playing streaming  
video.  There are still things I haven't tried (i.e. Core Animation),  
but unfortunately I'm out of time to spend on this.  I have a stop- 
gap solution in the separate overlay window approach, which works on  
anything, the drawback being a lousy frame rate if the overlay is in  
motion.  But it is better than nothing, and I can have my app use  
that only when it is playing streaming video, switching to one of the  
better methods for other sources.


Thanks very much to everyone for the suggestions and help!

Bob

On Apr 24, 2008, at 6:34 PM, douglas a. welton wrote:

Bob,

Scott took the words right out of my keyboard... ;^} Have you taken  
a look at the QCTV sample code?  It does almost exactly what you want.


regards,

douglas

On Apr 24, 2008, at 9:16 PM, Scott Anguish wrote:



On Apr 24, 2008, at 9:05 PM, Bob Smith wrote:

In my case all I want to do is be able to add a scrolling text  
overlay to whatever video is being played.  My app is an  
informational video kiosk display driver, it's meant to run  
mostly unattended from playlists of images and pre-recorded  
video, but with occasional scheduled live segments from  
streaming video cameras on the local network.  I'll take a look  
at Core Animation, however one of my limitations is the app has  
to run under Tiger, and I thought most of the CA stuff was new  
to Leopard.




Would using Quartz Composer directly be an option for your app?

I don't know about the performance issues, but overlaying text on  
top of video should be easy this way.




___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Failure on unarchiving a NSBezierPath

2008-04-25 Thread an0
Sorry for my careless, I though Jens was talking about the `read' part.
However, as I said, the error occurred when reading not when writing.
So it was not because
 NSKeyedArchiver returned nil
but because
`[NSKeyedUnarchiver unarchiveObjectWithData:data]' returned nil, and
my `readFromData:(NSData *)data ofType:(NSString *)typeName
error:(NSError **)outError' returned NO without setting `outError'
(thanks Jens let me learn this point).
OK. Now I'm just wondering why `[NSKeyedUnarchiver
unarchiveObjectWithData:data]' returnes nil, since I've saved the data
without any error as I can see.
Thanks a lot if you or others can give me some more hint.

On Fri, Apr 25, 2008 at 4:29 PM, Kyle Sluder
[EMAIL PROTECTED] wrote:
 On Fri, Apr 25, 2008 at 4:11 AM, an0 [EMAIL PROTECTED] wrote:
   Thanks. But it seems you haven't read to the end. As I said in my first 
 mail:
  
Besides, I found the value returned by [NSKeyedUnarchiver
 unarchiveObjectWithData:data] was nil, but I didn't understand why,
 since it was normal when I saved the file using [NSKeyedArchiver
 archivedDataWithRootObject:view.drawing].

  But you apparently haven't comprehended Jens' message.  You're not
  setting *outError to anything, so whoever is calling your method is
  seeing that you've returned NO and is expecting whatever it passed in
  as outError to point to an NSError object.  Unfortunately this is not
  the case and whatever was in that memory location is receiving bogus
  messages -- particularly, -localizedFailureReason, which is an NSError
  method.

  In short, you're breaking the contract for messages which take an
  NSError**.  Set *outError to an NSError object (or nil if you're lazy)
  if you're going to return a value that signifies an error.

  --Kyle Sluder

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Cocoa-dev Digest, Vol 5, Issue 670

2008-04-25 Thread Dave Jewell

Message: 9
Date: Thu, 24 Apr 2008 13:43:26 +1200
From: David Wilson [EMAIL PROTECTED]

I'm running Xcode 3.1 (actually iPhone SDK Beta 3) on Mac OS 10.5.2
My application doesn't launch when I click the run button in Xcode
(note it is NOT an iPhone app). It's an application to control USB
devices.  XCode tells me that the application has launched, yet it  
does not

appear in the doc.


David --  I have been irritated by this problem for the last couple of  
weeks, but I think I have fixed it


Like you, I am also using iPhone SDK Beta but trying to run a non- 
iPhone app from within xCode.  I have just upgraded to Beta 4 which I  
hoped would fix the problem but it didn't!


HOWEVER, I have found a solution which is to look at the Stop on  
Debugger()/DebugStr() menu item in the Run menu.  For some reason,  
this got checked when I installed the iPhone SDK beta.  If you uncheck  
this item, then sanity will be restored, and xCode will start behaving  
normally again.  It worked for me: hope it works for you.


Dave

___

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

Please do not post admin requests or moderator comments to the list.
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: One pixel width. One.

2008-04-25 Thread Joe Goh
On 4/25/08, Lorenzo [EMAIL PROTECTED] wrote:
  I am trying to draw a line with 1 pixel width. No matter whether the view is
  scaled or scrolled, I want to see a 1 pixel thick line.

I highly, highly recommend reading this article:
http://wincent.com/a/about/wincent/weblog/archives/2007/01/offbyone.php

I wanted to do the exact same thing in my app last year and this
article saved the day for me.

HTH,
Joe Goh
FunkeeMonk Technology
http://www.funkeemonk.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: QTMovie grabing while playback

2008-04-25 Thread Nikolai Hellwig

Hey,

thank you very much. it helped a lot. but i still got one problem.
The image I derive from
NSBitmapImageRep initWithCIImage
is much smaller than the original pixel size of the video. Because of  
that i can't use this method for production use. Is there another way  
to do this?


regards,
nikolai



Nikolai,

QTMovieView has a delegate method

	- (CIImage*) view: (QTMovieView *)Target_View willDisplayImage:  
(CIImage *)New_Image


This method gives you a CIImage to play with before it is displayed  
in the Target_View.  Check the header file for QTMovieView.h (near  
the bottom).  I think the the MyMovieFilter sample code uses this  
method.


Note:  Depending on what type of analysis you are doing you may need  
to convert the CIImage into a pixel-based format.  If that is too  
slow you may want to get friendly with  
QTVisualContextIsNewImageAvailable() and the Display Link...  check  
out the CIVideoDemoGL sample code.


regards,

douglas


On Apr 23, 2008, at 12:19 PM, Nikolai Hellwig wrote:


Hi,

I've done some image analysing software for QTKit Capture. It works  
fine. Now i need to use this for a quicktime movie.
I can playback the quicktime movie, but i can't find any delegate  
which tells my application, that a new frame is rendered. If i can  
get this information i could grab this frame in order to analyse it.


can anyone tell me how to do it? I don't want the user to click  
grabFrame or something like that.


regards
Nikolai Hellwig




Mit freundlichen Grüßen
Nikolai Hellwig
[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]


NSBitmapImageRep bitmapData contains all zeroes?

2008-04-25 Thread Nick Forge
I am working on a Computer Vision project that uses real-time image  
processing. I am grabbing frames using QTKit, then converting the  
resulting CVImageBufferRef into a CIImage, and then converting that  
into an NSBitmapImageRep. I know that my resulting NSBitmapImageRep is  
fine, since I am viewing it by sticking it in an NSImage and then  
popping that into an NSImageView (the QTKit Capture Preview has a 1/2  
second lag time - which is unacceptable for this project). Everything  
works as it should, but when I go to grab the raw pixel data from the  
NSBitmapImageRep like so:


unsigned char *bitmapData = [self bitmapData];

(btw it says self because this is from a category of NSBitmapImageRep)

The resulting array, bitmapData, is an array of zeroes! Every pixel  
sample in bitmapData is zero, yet I can draw the image and the image  
IS there. What's going on? Any suggestions as to what I may be  
overlooking?


Thanks in advance,
Nick Forge
___

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

Please do not post admin requests or moderator comments to the list.
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: QTMovie grabing while playback

2008-04-25 Thread douglas a. welton

Bob,

re:  Quartz Composer
Did you check the Asynchronous Mode checkbox on the Movie Loader  
patch's Settings panel?  This box is specifically available to allow  
for playback of streaming material.


re:  QT flaw
The supposition that QuickTime is fundamentally flawed is not  
accurate.  If you had time to explore, I would point you in the  
direction of the QT Broadcaster interface and the sample code  
available for receiving (and parsing) RTSP/RTP streams.  If you don't  
have time, don't go down this path - the API is cryptic (at best) and  
very poorly documented.


later,

douglas

On Apr 25, 2008, at 5:17 AM, Bob Smith wrote:

Well, I'm glad I had an excuse to play around with Quartz Composer;  
I knew about it but had never spent any time with it, very cool!   
Unfortunately, it doesn't solve my immediate problem.  As far as I  
can tell, compositions won't play streaming video at all.  They work  
great with movies from files, and with local live sources (iSight,  
DV).  But giving the Image With Movie patch an .sdp file just  
results in a static QuickTime logo, it never shows any actual video.


Now I have at least three different methods for adding overlays to  
pre-recorded video, but none of those seem able to deal with RTSP/ 
RTP streaming video.  I'm going out on a limb here and conclude this  
isn't just one or the other of the APIs having an issue, rather it  
is a fundamental limitation in QuickTime, which can't (or won't)  
break out individual frames for compositing when it is playing  
streaming video.  There are still things I haven't tried (i.e. Core  
Animation), but unfortunately I'm out of time to spend on this.  I  
have a stop-gap solution in the separate overlay window approach,  
which works on anything, the drawback being a lousy frame rate if  
the overlay is in motion.  But it is better than nothing, and I can  
have my app use that only when it is playing streaming video,  
switching to one of the better methods for other sources.


Thanks very much to everyone for the suggestions and help!

Bob

On Apr 24, 2008, at 6:34 PM, douglas a. welton wrote:

Bob,

Scott took the words right out of my keyboard... ;^} Have you taken  
a look at the QCTV sample code?  It does almost exactly what you  
want.


regards,

douglas

On Apr 24, 2008, at 9:16 PM, Scott Anguish wrote:



On Apr 24, 2008, at 9:05 PM, Bob Smith wrote:

In my case all I want to do is be able to add a scrolling text  
overlay to whatever video is being played.  My app is an  
informational video kiosk display driver, it's meant to run  
mostly unattended from playlists of images and pre-recorded  
video, but with occasional scheduled live segments from  
streaming video cameras on the local network.  I'll take a look  
at Core Animation, however one of my limitations is the app has  
to run under Tiger, and I thought most of the CA stuff was new  
to Leopard.




Would using Quartz Composer directly be an option for your app?

I don't know about the performance issues, but overlaying text on  
top of video should be easy this way.






___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: QTMovie grabing while playback

2008-04-25 Thread douglas a. welton

Nikolai,

Can you post a snippet of the code you are using for the conversion?

regards,

douglas

On Apr 25, 2008, at 9:04 AM, Nikolai Hellwig wrote:


Hey,

thank you very much. it helped a lot. but i still got one problem.
The image I derive from
NSBitmapImageRep initWithCIImage
is much smaller than the original pixel size of the video. Because  
of that i can't use this method for production use. Is there another  
way to do this?


regards,
nikolai



Nikolai,

QTMovieView has a delegate method

	- (CIImage*) view: (QTMovieView *)Target_View willDisplayImage:  
(CIImage *)New_Image


This method gives you a CIImage to play with before it is displayed  
in the Target_View.  Check the header file for QTMovieView.h (near  
the bottom).  I think the the MyMovieFilter sample code uses this  
method.


Note:  Depending on what type of analysis you are doing you may  
need to convert the CIImage into a pixel-based format.  If that is  
too slow you may want to get friendly with  
QTVisualContextIsNewImageAvailable() and the Display Link...  check  
out the CIVideoDemoGL sample code.


regards,

douglas


On Apr 23, 2008, at 12:19 PM, Nikolai Hellwig wrote:


Hi,

I've done some image analysing software for QTKit Capture. It  
works fine. Now i need to use this for a quicktime movie.
I can playback the quicktime movie, but i can't find any delegate  
which tells my application, that a new frame is rendered. If i can  
get this information i could grab this frame in order to analyse it.


can anyone tell me how to do it? I don't want the user to click  
grabFrame or something like that.


regards
Nikolai Hellwig




Mit freundlichen Grüßen
Nikolai Hellwig
[EMAIL PROTECTED]

Sands Logo Text klein.png



___

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

Please do not post admin requests or moderator comments to the list.
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: NSBitmapImageRep bitmapData contains all zeroes?

2008-04-25 Thread Raphael Sebbe
Hi,
how do you convert CIImage to NSBitmapImageRep ?

Raphael

On Fri, Apr 25, 2008 at 4:34 PM, Nick Forge [EMAIL PROTECTED] wrote:

 I am working on a Computer Vision project that uses real-time image
 processing. I am grabbing frames using QTKit, then converting the resulting
 CVImageBufferRef into a CIImage, and then converting that into an
 NSBitmapImageRep. I know that my resulting NSBitmapImageRep is fine, since I
 am viewing it by sticking it in an NSImage and then popping that into an
 NSImageView (the QTKit Capture Preview has a 1/2 second lag time - which is
 unacceptable for this project). Everything works as it should, but when I go
 to grab the raw pixel data from the NSBitmapImageRep like so:

 unsigned char *bitmapData = [self bitmapData];

 (btw it says self because this is from a category of NSBitmapImageRep)

 The resulting array, bitmapData, is an array of zeroes! Every pixel sample
 in bitmapData is zero, yet I can draw the image and the image IS there.
 What's going on? Any suggestions as to what I may be overlooking?

 Thanks in advance,
 Nick Forge
 ___

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

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

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


Weird Problem With CGImage

2008-04-25 Thread Carter R. Harrison
This bug in my code has been driving me nuts for days, but I have  
finally isolated the issue - only problem now is I don't understand  
what I'm doing wrong.


I have a CGImage that I want to get the raw data bytes for.  My code  
is below:


CGImageRef sectionToCache = CGImageCreateWithImageInRect(backingStore,  
CGRectMake(x, y, cx, cy));
NSLog(@CGImage to cache has dimensions %d x %d and %d bytes per row,  
CGImageGetWidth(sectionToCache), CGImageGetHeight(sectionToCache),  
CGImageGetBytesPerRow(sectionToCache));
CFDataRef dataRef =  
CGDataProviderCopyData(CGImageGetDataProvider(sectionToCache));

NSLog(@Length of cachedImage data: %d, CFDataGetLength(dataRef));

When the code runs, the log spits out the following:

CGImage to cache has dimensions 417 x 234 and 1668 bytes per row
Length of cachedImage data: 6672

What is killing me here is that the CGImage has dimensions 417x234 and  
1668 bytes per row.  That to me means that the CFDataRef that I am  
obtaining should be 390,312 bytes (234 x 1668).  But the CFDataRef is  
only 6,672 bytes which is nowhere close to what I think I should be  
getting.  So I must be doing something wrong in trying to get the  
bitmap data, but I'm not sure what else to do and I even found some  
Apple docs with an example doing the exact same thing that I am  
doing.  Can anybody provide some insight on this?  Thanks everybody.

___

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

Please do not post admin requests or moderator comments to the list.
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]


starting...

2008-04-25 Thread Sidnei Vladisauskis
Hey,

I´m a new developer in iphone´s world, develop in actionScript (flash OOP)
and build adGames and python too.

I always wanted to develop for mobile plataform, and now, with the iphone,
wich is a good gadget, I decided to join in new and long journey.

I´m studying objective-C around one month and have some doubts.

Follows the code with the doubts:

*Classe.h
*#import UIKit/UIKit.h //importa a classe UIKit

//constuctor of the class with type NSObject that extends a
UIApplicationDelegate, it is right?
@interface Classe : NSObject UIApplicationDelegate {
//variable type UIWindow (I think that create a screen application)

 IBOutlet UIWindow *window;
//I don´t know what id IBOutlet
}

//I don't understand this line
@property (nonatomic, retain) UIWindow *window;

@end


*Classe.m*
//importa o header (que seria o contructor da classe certo?)

//import the header (is that a constructor of the class?)
#import teste2AppDelegate.h

//implement the interface in content
@implementation teste2AppDelegate;

//instance window in content?
@synthesize window;

//metodo chamado quando o aplicativo é executado e não retorna nada(void),
ele recebe como parâmetro um UIApplicaton (pq?)
//metod called when the application run, don´t return nothing(void), recives
one parameter UIApplicaton
- (void)applicationDidFinishLaunching:(UIApplication *)application {
//create a textField
//Is it  the same that var _txt:UITextField = new UITextField() ???
UITextField *_txt = [[UITextField alloc] init];
[_txt setTextColor:[UIColor redColor]]; //set color in red color, this color
return from UIColor class
[_txt setText:@teste]; //set text
}

//Why do  is metod ?
- (void)dealloc {
[window release];
[super dealloc];
}

@end


In my journey I understand that execute one function I use
[nameFunction:param1, p:param2. Pp:param3], right?

When compiling this script don't show error and open iPhone emulator, but
show a whit screen and not show the text.

Ok, any help will be good help.

Thanks…
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: starting...

2008-04-25 Thread I. Savant
  I´m a new developer in iphone´s world, develop in actionScript (flash OOP)
  and build adGames and python too.

  The iPhone SDK is under non-disclosure agreement as you should know
if you've downloaded it. It cannot be discussed publicly.

--
I.S.
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: starting...

2008-04-25 Thread Hamish Allan
On Fri, Apr 25, 2008 at 3:59 PM, Sidnei Vladisauskis [EMAIL PROTECTED] wrote:

  I always wanted to develop for mobile plataform, and now, with the iphone,
  wich is a good gadget, I decided to join in new and long journey.

  I´m studying objective-C around one month and have some doubts.

A couple of things:

1) You can't discuss iPhone development here. When you downloaded and
installed the iPhone SDK, you agreed to a license which prohibits you
from discussing it in public forums like this one.
2) There are some pretty fundamental gaps in your understanding of
Objective-C. Coming from a scripting background, you should probably
learn C first. Search the archives for recommendations on books and
online tutorials.

Hamish
___

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

Please do not post admin requests or moderator comments to the list.
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]


How do I use a WebView in a modal dialog?

2008-04-25 Thread David Springer
Folks,

How can I use a WebView in a modal dialog?  I understand that WebViews
don't work in the modal runloop mode, so is there a way to fake this?
Run my own nextEventMatchingMask: loop (I have tried this with very
limited success)?  Run the window containing the WebView in a separate
thread with its own run loop?  Get rid of WebView altogether and go
straight to WebFrame (this sounds hard)?

Help?

Thanks!
- Dave.S
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Application Launch (or doesn't Launch as such) (David Wilson)

2008-04-25 Thread Dave Jewell


HOWEVER, I have found a solution which is to look at the Stop on  
Debugger()/DebugStr() menu item in the Run menu.  For some reason,  
this got checked when I installed the iPhone SDK beta.  If you  
uncheck this item, then sanity will be restored, and xCode will  
start behaving normally again.  It worked for me: hope it works for  
you.


OMFG!!!111 :D :D :D

I unchecked that, relaunched Xcode, and now I can run my app without  
gdb again for the first time in months. Thanks for the tip! That's  
one minor-but-frequent annoyance out of my life...


Did you file a bug report against Xcode on this issue, including the  
fix/workaround?


Well, no, I didn't  I'm a relative xCode newbie, and I wasn't 100%  
sure that I wasn't doing something dumb. ;-)


I do get the impression (from what others have said) that this problem  
only affects non-iPhone projects that were created *before* installing  
the iPhone SDK.


Dave
 
___


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

Please do not post admin requests or moderator comments to the list.
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: NSBitmapImageRep bitmapData contains all zeroes?

2008-04-25 Thread Jean-Daniel Dupas
What do you want to do with you captured images ? Just display them or  
record them ?


If you just want to display it, you should use an NSOpenGLView and  
draw the CVBuffer or the CIImage directly.
If this is for recording or processing the pixels (without CoreImage),  
you can try to generate a CVPixelBuffer (using the ARGB pixel format)  
instead of CVOpenGLTextureBuffer.


You can do this using QTPixelBufferContextCreate() instead of  
QTOpenGLTextureContextCreate() to create your drawing context.
A CVPixelBuffer allow you to access directly to the bitmapData  
(without using CIImage and NSBitmapImageRep).


You can check the QTPixelBufferVCToCGImage sample code to see how to  
setup this kind of context.



Le 25 avr. 08 à 16:49, Raphael Sebbe a écrit :


Hi,
how do you convert CIImage to NSBitmapImageRep ?

Raphael

On Fri, Apr 25, 2008 at 4:34 PM, Nick Forge [EMAIL PROTECTED]  
wrote:



I am working on a Computer Vision project that uses real-time image
processing. I am grabbing frames using QTKit, then converting the  
resulting

CVImageBufferRef into a CIImage, and then converting that into an
NSBitmapImageRep. I know that my resulting NSBitmapImageRep is  
fine, since I
am viewing it by sticking it in an NSImage and then popping that  
into an
NSImageView (the QTKit Capture Preview has a 1/2 second lag time -  
which is
unacceptable for this project). Everything works as it should, but  
when I go

to grab the raw pixel data from the NSBitmapImageRep like so:

unsigned char *bitmapData = [self bitmapData];

(btw it says self because this is from a category of  
NSBitmapImageRep)


The resulting array, bitmapData, is an array of zeroes! Every pixel  
sample
in bitmapData is zero, yet I can draw the image and the image IS  
there.

What's going on? Any suggestions as to what I may be overlooking?

Thanks in advance,
Nick Forge
___

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

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

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/raphael.sebbe%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/devlists%40shadowlab.org

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: Core Animation Flickering

2008-04-25 Thread John Harper


On Apr 25, 2008, at 1:20 AM, Colin Cornaby wrote:

I have a CALayer subclass, set to redraw on bounds change, with the  
following draw code (I don't expect it to be meaningful, but I'm  
pasting it here for the sake of completeness.)

…
It's parent view is set up to change the layers frame to always fill  
the contents of the entire view on resizeWithOldSuperviewSize:.   
This works great, except for a really annoying flicker that occurs  
once every few seconds while the view is resizing. Every layer in  
the view flickers in and out (stuff like background colors doesn't  
flicker).


Did I miss some drawing cleanup or something else obvious here?


One thing to check for is that the bounds of one of your layers isn't  
being set to empty temporarily. Running your program with the  
CA_PRINT_TREE environment variable set to 1 is a good way to debug  
that, you can scan the logs for anything that looks suspicious. If you  
don't see anything, file a radar with a test case and we will look  
into it…


John


___

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

Please do not post admin requests or moderator comments to the list.
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: Weird Problem With CGImage

2008-04-25 Thread Jean-Daniel Dupas


Using CGImageRef is not a realiable  way to access pixel data of an  
image.
You should create a CGBitmapContextCreate() instead and draw the part  
you want in this context.


http://developer.apple.com/qa/qa2007/qa1509.html




Le 25 avr. 08 à 16:51, Carter R. Harrison a écrit :

This bug in my code has been driving me nuts for days, but I have  
finally isolated the issue - only problem now is I don't understand  
what I'm doing wrong.


I have a CGImage that I want to get the raw data bytes for.  My code  
is below:


CGImageRef sectionToCache =  
CGImageCreateWithImageInRect(backingStore, CGRectMake(x, y, cx, cy));
NSLog(@CGImage to cache has dimensions %d x %d and %d bytes per  
row, CGImageGetWidth(sectionToCache),  
CGImageGetHeight(sectionToCache),  
CGImageGetBytesPerRow(sectionToCache));
CFDataRef dataRef =  
CGDataProviderCopyData(CGImageGetDataProvider(sectionToCache));

NSLog(@Length of cachedImage data: %d, CFDataGetLength(dataRef));

When the code runs, the log spits out the following:

CGImage to cache has dimensions 417 x 234 and 1668 bytes per row
Length of cachedImage data: 6672

What is killing me here is that the CGImage has dimensions 417x234  
and 1668 bytes per row.  That to me means that the CFDataRef that I  
am obtaining should be 390,312 bytes (234 x 1668).  But the  
CFDataRef is only 6,672 bytes which is nowhere close to what I think  
I should be getting.  So I must be doing something wrong in trying  
to get the bitmap data, but I'm not sure what else to do and I even  
found some Apple docs with an example doing the exact same thing  
that I am doing.  Can anybody provide some insight on this?  Thanks  
everybody.

___

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

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

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/devlists%40shadowlab.org

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: One pixel width. One.

2008-04-25 Thread Lorenzo
Joe, thank you. That page helps. I succeeded, but I had to set the width to
0.01 because if I set it to zero I get a 2 pixels thick line when the scale
is different than 1.0. Don't know why. Please follow me.

After scaling the view with

  scale = 1.33;
  [self setBoundsSize:NSMakeSize((int)([self frame].size.width  / scale),
 (int)([self frame].size.height / scale))];

I get these logs in the drawRect method

scale 1.33
frame {{0, 0}, {1166, 1253}},
bounds {{-140, -50}, {875, 941}}

As you can see the frame and bounds values are all integers now.
Now I draw a vertical line

[NSBezierPath setDefaultLineWidth:0.0];
bot = NSMakePoint(0.5, 0.5);
top = NSMakePoint(0.5, 9.5);
[NSBezierPath strokeLineFromPoint:bot toPoint:top];

And the lines looks 2 pixels thick. Dam! So I tried to set

[NSBezierPath setDefaultLineWidth:0.01 / scale];

And it worked at any scale. Can't guess why! With 0.001 I don't see any
line. Strange story, it works with zero, with 0.01/1.33 and it doesn't work
with 0.001 / 1.33. Any idea?


Best Regards
-- 
Lorenzo
email: [EMAIL PROTECTED]

 From: Joe Goh [EMAIL PROTECTED]
 Date: Fri, 25 Apr 2008 17:31:17 +0800
 To: cocoa-dev@lists.apple.com, Lorenzo [EMAIL PROTECTED]
 Subject: Re: One pixel width. One.
 
 On 4/25/08, Lorenzo [EMAIL PROTECTED] wrote:
  I am trying to draw a line with 1 pixel width. No matter whether the view is
  scaled or scrolled, I want to see a 1 pixel thick line.
 
 I highly, highly recommend reading this article:
 http://wincent.com/a/about/wincent/weblog/archives/2007/01/offbyone.php
 
 I wanted to do the exact same thing in my app last year and this
 article saved the day for me.
 
 HTH,
 Joe Goh
 FunkeeMonk Technology
 http://www.funkeemonk.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: QTMovie grabing while playback

2008-04-25 Thread Nikolai Hellwig

Hi,

the image comes from:

- (CIImage*) view: (QTMovieView *)view willDisplayImage: (CIImage  
*)image

{
...
// this is the conversion code
	NSBitmapImageRep* bitmap = [[NSBitmapImageRep alloc] initWithCIImage:  
image];

...
}

regards,

nikolai

Am 25.04.2008 um 16:43 schrieb douglas a. welton:


Nikolai,

Can you post a snippet of the code you are using for the conversion?

regards,

douglas

On Apr 25, 2008, at 9:04 AM, Nikolai Hellwig wrote:

Hey,

thank you very much. it helped a lot. but i still got one problem.
The image I derive from
NSBitmapImageRep initWithCIImage
is much smaller than the original pixel size of the video. Because  
of that i can't use this method for production use. Is there  
another way to do this?


regards,
nikolai



Nikolai,

QTMovieView has a delegate method

	- (CIImage*) view: (QTMovieView *)Target_View willDisplayImage:  
(CIImage *)New_Image


This method gives you a CIImage to play with before it is  
displayed in the Target_View.  Check the header file for  
QTMovieView.h (near the bottom).  I think the the MyMovieFilter  
sample code uses this method.


Note:  Depending on what type of analysis you are doing you may  
need to convert the CIImage into a pixel-based format.  If that is  
too slow you may want to get friendly with  
QTVisualContextIsNewImageAvailable() and the Display Link...   
check out the CIVideoDemoGL sample code.


regards,

douglas


On Apr 23, 2008, at 12:19 PM, Nikolai Hellwig wrote:


Hi,

I've done some image analysing software for QTKit Capture. It  
works fine. Now i need to use this for a quicktime movie.
I can playback the quicktime movie, but i can't find any delegate  
which tells my application, that a new frame is rendered. If i  
can get this information i could grab this frame in order to  
analyse it.


can anyone tell me how to do it? I don't want the user to click  
grabFrame or something like that.


regards
Nikolai Hellwig




Mit freundlichen Grüßen
Nikolai Hellwig
[EMAIL PROTECTED]

Sands Logo Text klein.png





Mit freundlichen Grüßen
Nikolai Hellwig
[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: Weird Problem With CGImage

2008-04-25 Thread Adam R. Maxwell
 
On Friday, April 25, 2008, at 08:58AM, Jean-Daniel Dupas [EMAIL PROTECTED] 
wrote:

Using CGImageRef is not a realiable  way to access pixel data of an  
image.
You should create a CGBitmapContextCreate() instead and draw the part  
you want in this context.

http://developer.apple.com/qa/qa2007/qa1509.html

That document predates the publication of CGDataProviderCopyData in the API, 
though, which should provide a reliable way to access pixel data.  In this 
particular case, it looks like drawing to a new bitmap context would be a more 
direct route, as you said.  However, I'm using CGDataProviderCopyData myself, 
and I'd like to know where it can fail like this; it WFM so far.

-- 
adam

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: NSBitmapImageRep bitmapData contains all zeroes?

2008-04-25 Thread Nick Forge
I tweaked one of my format parameters somewhere in the processing  
chain, and it started working. I think I was accidentally initing my  
NSBitmapImageRep in 2 places. I can't explain why it was acting how it  
was, but it works now.


On 26/04/2008, at 1:49 AM, Jean-Daniel Dupas wrote:

What do you want to do with you captured images ? Just display them  
or record them ?


Both. At the moment I'm probably doing things very inefficiently, but  
I looked at the OpenGL examples, and got very lost very quickly, so  
decided to stick with classes that I had some idea of how to use. I  
want to display the original image, process the bitmap data, then  
display some resulting images as well.


If you just want to display it, you should use an NSOpenGLView and  
draw the CVBuffer or the CIImage directly.
If this is for recording or processing the pixels (without  
CoreImage), you can try to generate a CVPixelBuffer (using the ARGB  
pixel format) instead of CVOpenGLTextureBuffer.


You can do this using QTPixelBufferContextCreate() instead of  
QTOpenGLTextureContextCreate() to create your drawing context.
A CVPixelBuffer allow you to access directly to the bitmapData  
(without using CIImage and NSBitmapImageRep).


You can check the QTPixelBufferVCToCGImage sample code to see how to  
setup this kind of context.


What would the best technique (in terms of execution speed) be to  
both display, AND process the frames? Is there any reason not to  
create both a CVPixelBuffer AND a CVBuffer?


Thanks,
Nick
___

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

Please do not post admin requests or moderator comments to the list.
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: Weird Problem With CGImage

2008-04-25 Thread David Duncan

On Apr 25, 2008, at 7:51 AM, Carter R. Harrison wrote:

This bug in my code has been driving me nuts for days, but I have  
finally isolated the issue - only problem now is I don't understand  
what I'm doing wrong.


I have a CGImage that I want to get the raw data bytes for.  My code  
is below:


CGImageRef sectionToCache =  
CGImageCreateWithImageInRect(backingStore, CGRectMake(x, y, cx, cy));
NSLog(@CGImage to cache has dimensions %d x %d and %d bytes per  
row, CGImageGetWidth(sectionToCache),  
CGImageGetHeight(sectionToCache),  
CGImageGetBytesPerRow(sectionToCache));
CFDataRef dataRef =  
CGDataProviderCopyData(CGImageGetDataProvider(sectionToCache));

NSLog(@Length of cachedImage data: %d, CFDataGetLength(dataRef));

When the code runs, the log spits out the following:

CGImage to cache has dimensions 417 x 234 and 1668 bytes per row
Length of cachedImage data: 6672

What is killing me here is that the CGImage has dimensions 417x234  
and 1668 bytes per row.  That to me means that the CFDataRef that I  
am obtaining should be 390,312 bytes (234 x 1668).  But the  
CFDataRef is only 6,672 bytes which is nowhere close to what I think  
I should be getting.  So I must be doing something wrong in trying  
to get the bitmap data, but I'm not sure what else to do and I even  
found some Apple docs with an example doing the exact same thing  
that I am doing.  Can anybody provide some insight on this?  Thanks  
everybody.


This seems to be related to the CGImageCreateWithImageInRect() call,  
but I can't imagine why. CGDataProviderCopyData() seems to work  
perfectly with an original image in my limited testing, so please file  
a bug (and let me know what the bug number is).

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



___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Initial value of on/off buttons

2008-04-25 Thread Yann Disser
I realize that my buttons are generally not affected by the changes I  
make to the bool-values. Only the other way around.


Can I not bind bools to the value of NSButtons? Or am I missing  
something else?


Thanks for your help,
Yann


Yann Disser wrote:
I have five textured NSButtons that are set to operate in On Off  
mode. All of them are value-bound to different bools in my application.
Somehow the first button starts in the On-state and the others in  
the off state, no matter which button I bind to which bool. If I  
remove the bindings, the buttons start in the On-state.


Setting the bools in awakeFromNib does not affect the state of the  
buttons. Clicking the buttons however causes my bools to have the  
correct values.


What am I doing wrong? How can I at least set the initial state of my  
buttons? (They are all On in IB)


I just noticed that removing the binding from the first button and  
adding that SAME binding again causes it to behave like the other  
buttons. I can restore the On-behavior by undoing that change. There  
has to be a bug involved, however the only thing I want is that all  
buttons start in the On-state without needing an outlet in my  
controller.


I am thankful for suggestions,
Yann
___

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

Please do not post admin requests or moderator comments to the list.
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: QTMovie grabing while playback

2008-04-25 Thread douglas a. welton

Nikolai,

Perhaps you might try creating an empty NSBitmapImageRep with the  
size and pixel attributes you need.  Then, use the resultant object as  
a graphic context and draw your CIImage into that.  The Reducer sample  
code does something similar to this.  I can imagine that this process  
might be slow, but I don't know what your performance requirements are.


regards,

douglas

On Apr 25, 2008, at 11:58 AM, Nikolai Hellwig wrote:


Hi,

the image comes from:

- (CIImage*) view: (QTMovieView *)view willDisplayImage: (CIImage  
*)image

{
...
// this is the conversion code
	NSBitmapImageRep* bitmap = [[NSBitmapImageRep alloc]  
initWithCIImage: image];

...
}

regards,

nikolai

Am 25.04.2008 um 16:43 schrieb douglas a. welton:


Nikolai,

Can you post a snippet of the code you are using for the conversion?

regards,

douglas

On Apr 25, 2008, at 9:04 AM, Nikolai Hellwig wrote:

Hey,

thank you very much. it helped a lot. but i still got one problem.
The image I derive from
NSBitmapImageRep initWithCIImage
is much smaller than the original pixel size of the video. Because  
of that i can't use this method for production use. Is there  
another way to do this?


regards,
nikolai



Nikolai,

QTMovieView has a delegate method

	- (CIImage*) view: (QTMovieView *)Target_View willDisplayImage:  
(CIImage *)New_Image


This method gives you a CIImage to play with before it is  
displayed in the Target_View.  Check the header file for  
QTMovieView.h (near the bottom).  I think the the MyMovieFilter  
sample code uses this method.


Note:  Depending on what type of analysis you are doing you may  
need to convert the CIImage into a pixel-based format.  If that  
is too slow you may want to get friendly with  
QTVisualContextIsNewImageAvailable() and the Display Link...   
check out the CIVideoDemoGL sample code.


regards,

douglas


On Apr 23, 2008, at 12:19 PM, Nikolai Hellwig wrote:


Hi,

I've done some image analysing software for QTKit Capture. It  
works fine. Now i need to use this for a quicktime movie.
I can playback the quicktime movie, but i can't find any  
delegate which tells my application, that a new frame is  
rendered. If i can get this information i could grab this frame  
in order to analyse it.


can anyone tell me how to do it? I don't want the user to click  
grabFrame or something like that.


regards
Nikolai Hellwig




Mit freundlichen Grüßen
Nikolai Hellwig
[EMAIL PROTECTED]

Sands Logo Text klein.png





Mit freundlichen Grüßen
Nikolai Hellwig
[EMAIL PROTECTED]

Sands Logo Text klein.png



___

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

Please do not post admin requests or moderator comments to the list.
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: Weird Problem With CGImage

2008-04-25 Thread Carter R. Harrison


On Apr 25, 2008, at 12:12 PM, David Duncan wrote:


On Apr 25, 2008, at 7:51 AM, Carter R. Harrison wrote:

This bug in my code has been driving me nuts for days, but I have  
finally isolated the issue - only problem now is I don't understand  
what I'm doing wrong.


I have a CGImage that I want to get the raw data bytes for.  My  
code is below:


CGImageRef sectionToCache =  
CGImageCreateWithImageInRect(backingStore, CGRectMake(x, y, cx, cy));
NSLog(@CGImage to cache has dimensions %d x %d and %d bytes per  
row, CGImageGetWidth(sectionToCache),  
CGImageGetHeight(sectionToCache),  
CGImageGetBytesPerRow(sectionToCache));
CFDataRef dataRef =  
CGDataProviderCopyData(CGImageGetDataProvider(sectionToCache));

NSLog(@Length of cachedImage data: %d, CFDataGetLength(dataRef));

When the code runs, the log spits out the following:

CGImage to cache has dimensions 417 x 234 and 1668 bytes per row
Length of cachedImage data: 6672

What is killing me here is that the CGImage has dimensions 417x234  
and 1668 bytes per row.  That to me means that the CFDataRef that I  
am obtaining should be 390,312 bytes (234 x 1668).  But the  
CFDataRef is only 6,672 bytes which is nowhere close to what I  
think I should be getting.  So I must be doing something wrong in  
trying to get the bitmap data, but I'm not sure what else to do and  
I even found some Apple docs with an example doing the exact same  
thing that I am doing.  Can anybody provide some insight on this?   
Thanks everybody.


This seems to be related to the CGImageCreateWithImageInRect() call,  
but I can't imagine why. CGDataProviderCopyData() seems to work  
perfectly with an original image in my limited testing, so please  
file a bug (and let me know what the bug number is).


	Thanks David.  The bug number is 5889934.  For the time being I will  
use the workaround provided by an earlier poster.


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





___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Initial value of on/off buttons

2008-04-25 Thread Hamish Allan
On Fri, Apr 25, 2008 at 5:13 PM, Yann Disser [EMAIL PROTECTED] wrote:

 I realize that my buttons are generally not affected by the changes I make
 to the bool-values. Only the other way around.

  Can I not bind bools to the value of NSButtons? Or am I missing something
 else?

Are you binding via an NSObjectController?

Hamish
___

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

Please do not post admin requests or moderator comments to the list.
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]


[ANN] Media App Developer position (Northern NJ)

2008-04-25 Thread David Hoerl

Position:   Media Application Developer - MacOS Expert
Location:   Northern, NJ
Duration:   Contract – 2 – 3 months with possible extension

To apply for this position please forward your resume in WORD format
referring the position the position title above to:
[EMAIL PROTECTED]

Due to the volumes of resumes received by Comprehensive Search Inc.
(a subsidiary of CMI Inc.), we
kindly ask that only those meeting the candidate specifications
apply. - EE

The Company
Our client, a pioneer in deployment of high definition (HD) video
conferencing widely available over the internet, creating solutions
that provide quality experiences to all environments from the home-
office desktop to the dedicated corporate video-conferencing
facility. Our client's family of end-to-end solutions for OEMs and
organizations support multi-point connections that include a variety
of different platforms ranging from Mac  Windows desktops to
dedicated room solutions. No dedicated networks are required.

Position Summary
Comprehensive Search Inc. is presently engaged in a search for an
exceptional Senior Media Application Developer in Windows.  This is a
direct hire position with an immediate/ASAP start date.

Position Summary
Comprehensive Search Inc. is presently engaged in an urgent and
immediate search for a MacOS Media Application Developer (SME).  This
is a contract position for 2 – 3 months with possible extension.
Local candidates are preferred.  Candidates out of the area will be
expected to be onsite in No. NJ for multiple days each week.  Start
date is immediate!!

Position Requirements
•   Experience designing and developing Media Applications on
MacOS a must
•   Experience with cross-platform GUI development (MacOS, Win32,
Unix)
•   Experience with Cocoa GUI, Core Animation and OpenGL required
•   C/C++ programming experience required

Comprehensive Search adheres to strict policies on confidentiality
and will never send your resume out
without your permission.

Feel free to pass this on to your colleagues.  All referrals are
greatly appreciated and kept in confidence.

CONTACT:
Eve Ellsworth
Senior Technical Recruiter
Comprehensive Search, Inc. (a CMI, Inc. Company)
732-223-7114 x108
Email:  [EMAIL PROTECTED]
Web:  www.compsearchinc.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]


mask nsimage

2008-04-25 Thread Dominik Pich

Hi,
for hours I thought on this without coming to a working solution.

I have an NSImage I need to draw (correctly scaled) in a pecifc  
drawRect. (got that of course)
Now whenever I draw it I want to mask it so it appears beveled,  
rounded and (to make it harder) kinda '3d-isch'

-- see an IPhoto event for what I want to doo aproximaty.

Now what technqiue should I use.. I mean CG kinda looks like it does  
what I need but I wanted to know if there wasn't an easier way :) (the  
CG APIs look 'weird' and the docs dont provide sample or pseudo code  
for _this_)


thanks,
dominik
___

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

Please do not post admin requests or moderator comments to the list.
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]


-init and awakeFromNib called twice.

2008-04-25 Thread Johnny Lundy
I know I saw something somewhere in reference to these methods getting  
called twice on app launch, but can't find it with searching.


Is this expected behavior for vanilla -init and (void) awakeFromNib  
methods? I'm doing some short loops in these methods and calling other  
instance methods. For now, no harm is done with all this stuff being  
done twice, but I'd rather not have to worry about that if I add code.


I don't see most examples routinely checking for a second invocation  
in these init methods so I wonder what is going on.


Other than that, all the advice I got here has worked and I now have  
350 lines of code and only one line is glue. Very nice learning  
experience for Bindings and I thank all who helped.



___

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

Please do not post admin requests or moderator comments to the list.
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: Uniform Type Indicators

2008-04-25 Thread Sean McBride
On 4/24/08 9:37 PM, Christopher Henrich said:

Have Uniform Type Indicators (UTIs) been defined for VRML, X3d, of
POVray files?

First, it's Uniform Type Identifiers. :)

Apple does not keep a list of 3rd party UTIs.  No one else does either,
that I know of.  Does anyone know of one?  The community really needs
such a list.  If no one knows of one, I'll create a page on the CocoaDev
wiki so that the community has one.

Conflicting UTIs are a big problem, you can read about the problem in
the archives of Apple's quicklook mailing list.

--

Sean McBride, B. Eng [EMAIL PROTECTED]
Rogue Researchwww.rogue-research.com
Mac Software Developer  Montréal, Québec, Canada

___

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

Please do not post admin requests or moderator comments to the list.
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]


[Moderator] Re: starting...

2008-04-25 Thread Scott Anguish

I.S. is correct

discussion of the SDK is not allowed on this list.

Scott
(Moderator)




On Apr 25, 2008, at 11:21 AM, I. Savant wrote:

I´m a new developer in iphone´s world, develop in actionScript  
(flash OOP)

and build adGames and python too.


 The iPhone SDK is under non-disclosure agreement as you should know
if you've downloaded it. It cannot be discussed publicly.


___

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

Please do not post admin requests or moderator comments to the list.
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: [Moderator] Re: starting...

2008-04-25 Thread Roland King
is there a list in apple somewhere which is restricted to people who  
are registered developers where this SDK can be discussed?


On Apr 26, 2008, at 1:04 AM, Scott Anguish wrote:


I.S. is correct

discussion of the SDK is not allowed on this list.

Scott
(Moderator)




On Apr 25, 2008, at 11:21 AM, I. Savant wrote:

I´m a new developer in iphone´s world, develop in actionScript  
(flash OOP)

and build adGames and python too.


The iPhone SDK is under non-disclosure agreement as you should know
if you've downloaded it. It cannot be discussed publicly.


___

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

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

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

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: [Moderator] Re: starting...

2008-04-25 Thread I. Savant
On Fri, Apr 25, 2008 at 1:17 PM, Roland King [EMAIL PROTECTED] wrote:
 is there a list in apple somewhere which is restricted to people who are
 registered developers where this SDK can be discussed?

  Nope. Apple still has not provided any forum in which NDA-covered
material / technologies can be discussed amongst the in-crowd.
That's been a problem for upcoming OS X releases as well as the new
iPhone SDK.

  Talk to an ADC representative ... the more people that demand such a
resource, the more likely they are to give in and provide it. Now back
to your regularly-scheduled Cocoa-specific topics. ;-)

--
I.S.
___

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

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

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

This email sent to [EMAIL PROTECTED]


Opportunity: Mac OS Media Application Developer, can be on-site in NJ or mostly remote: Contract is 3 months +

2008-04-25 Thread Oliver Eaton
Please forgive my interruption of the technical discussion.



Our direct client, a Video-over-IP development co. located in NJ, has
entrusted me to locate a top-level Mac OS programmer with expertise in Cocoa
and OpenGL, as well as cross-platform knowledge with Min32 API's.  This is a
3 months contreact with possibility of extensions, with a Video-over-IP
company specializing in HD video teleconferencing systems. Below are some
details about the opportunity:



We have an urgent and immediate need for a MacOs expert. We estimate the job
to be 2-3 months initially with an extension possible. Can be on-site or
mostly remote.  Out-of-area candidates will be required to make periodic
on-site visits.



MacOS Media Application Developer

*   Experience designing and developing Media Applications on MacOS a
must
*   Experience with cross-platform GUI development (MacOS, Win32, Unix)
*   Experience with Cocoa GUI, Core Animation and OpenGL required
*   C/C++ programming experience required



Please let me know if you are interested in this opportunity



Thanks!

Oliver



Oliver Eaton

Recruiting Manager CMI

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


[Moderator] Job postings

2008-04-25 Thread Scott Anguish
That there are so many new job openings for Cocoa developers is very  
exciting.


However, please send drafts of job offers to the [EMAIL PROTECTED] 
 first for approval.


Thanks!

Scott (moderator)


___

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

Please do not post admin requests or moderator comments to the list.
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: Weird Problem With CGImage

2008-04-25 Thread Michael Vannorsdel
Could it be the CGImage references a compressed image format rather  
than a bitmap?



On Apr 25, 2008, at 8:51 AM, Carter R. Harrison wrote:

What is killing me here is that the CGImage has dimensions 417x234  
and 1668 bytes per row.  That to me means that the CFDataRef that I  
am obtaining should be 390,312 bytes (234 x 1668).  But the  
CFDataRef is only 6,672 bytes which is nowhere close to what I think  
I should be getting.  So I must be doing something wrong in trying  
to get the bitmap data, but I'm not sure what else to do and I even  
found some Apple docs with an example doing the exact same thing  
that I am doing.  Can anybody provide some insight on this?  Thanks  
everybody.


___

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

Please do not post admin requests or moderator comments to the list.
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: QTMovie grabing while playback

2008-04-25 Thread Chris Adamson
Sorry to come in late, but this is something that occasionally comes  
up on quicktime-api and quicktime-java.  To get text or images on top  
of a movie, sometimes it's easier to skip the programming approach and  
achieve the effect with authoring.  Using the old QuickTime API, you  
could add a text track or a one-sample video track (higher in the Z- 
order, and with a suitable compositing mode), to achieve this effect  
without having to hack the rendering pipeline.


Even easier still, just author a SMIL movie as an XML file and load  
that as your movie.  Example on my blog: http://www.subfurther.com/blog/?p=84 



Authoring won't always take you as far as you need to go, of course;  
in the case of a capture preview, you almost certainly have to do  
something clever with the QTCaptureView, or via Core Animation with  
the layers (Bill Dudney has an example of this in his new CA book from  
the Pragmatic Programmers).


--Chris


On Wed, 23 Apr 2008 16:08:38 -0400 douglas a. welton wrote:


Bob  Randall,

If all you want to do is slap some arbitrary text over a movie, I
would suggest that you take a look at using  QTMovieLayer and
CATextLayer as the mechanism for doing this.  I don't have any code
that I can share with you on this, but a previous client project used
these two Core Animation objects with excellent results.


___

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

Please do not post admin requests or moderator comments to the list.
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]


Screen Recording APIs ?

2008-04-25 Thread Marcio Castilho
I am new to programming in Mac OSX. I need to do a very simple screen  
recording application similar to uShow, ScreenFlow and others, but  
with very basic settings and simple features. I would like some  
directions on where can I get some references on API areas, sample  
code, or some other information that might help me on this task.


I suspect that it is something related to the QuickTime API, but I  
would really appreciate some help here.


I have done this in Windows, but in Mac i am totally lost.

Anybody has any sample code or could tell which API I should start  
taking a look at


--
Marcio Castilho

___

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

Please do not post admin requests or moderator comments to the list.
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: Weird Problem With CGImage

2008-04-25 Thread Jean-Daniel Dupas


Le 25 avr. 08 à 18:12, David Duncan a écrit :


On Apr 25, 2008, at 7:51 AM, Carter R. Harrison wrote:

This bug in my code has been driving me nuts for days, but I have  
finally isolated the issue - only problem now is I don't understand  
what I'm doing wrong.


I have a CGImage that I want to get the raw data bytes for.  My  
code is below:


CGImageRef sectionToCache =  
CGImageCreateWithImageInRect(backingStore, CGRectMake(x, y, cx, cy));
NSLog(@CGImage to cache has dimensions %d x %d and %d bytes per  
row, CGImageGetWidth(sectionToCache),  
CGImageGetHeight(sectionToCache),  
CGImageGetBytesPerRow(sectionToCache));
CFDataRef dataRef =  
CGDataProviderCopyData(CGImageGetDataProvider(sectionToCache));

NSLog(@Length of cachedImage data: %d, CFDataGetLength(dataRef));

When the code runs, the log spits out the following:

CGImage to cache has dimensions 417 x 234 and 1668 bytes per row
Length of cachedImage data: 6672

What is killing me here is that the CGImage has dimensions 417x234  
and 1668 bytes per row.  That to me means that the CFDataRef that I  
am obtaining should be 390,312 bytes (234 x 1668).  But the  
CFDataRef is only 6,672 bytes which is nowhere close to what I  
think I should be getting.  So I must be doing something wrong in  
trying to get the bitmap data, but I'm not sure what else to do and  
I even found some Apple docs with an example doing the exact same  
thing that I am doing.  Can anybody provide some insight on this?   
Thanks everybody.


This seems to be related to the CGImageCreateWithImageInRect() call,  
but I can't imagine why. CGDataProviderCopyData() seems to work  
perfectly with an original image in my limited testing, so please  
file a bug (and let me know what the bug number is).




I didn't find any documentation about CGDataProviderCopyData() except  
this comment in the header:


/* Return a copy of the data specified by provider. Returns NULL if a
 * complete copy of the data can't be obtained (for example, if the
 * underlying data is too large to fit in memory). */

What is the expected output format of the data it returns ?



___

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

Please do not post admin requests or moderator comments to the list.
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: Screen Recording APIs ?

2008-04-25 Thread j o a r

Check out:

CGRegisterScreenRefreshCallback(), and

CGWindowListCreateImage()

Documentation is a bit limited at this point, but they're pretty easy  
to figure out.


j o a r


On Apr 25, 2008, at 11:35 AM, Marcio Castilho wrote:

I am new to programming in Mac OSX. I need to do a very simple  
screen recording application similar to uShow, ScreenFlow and  
others, but with very basic settings and simple features. I would  
like some directions on where can I get some references on API  
areas, sample code, or some other information that might help me on  
this task.


I suspect that it is something related to the QuickTime API, but I  
would really appreciate some help here.


I have done this in Windows, but in Mac i am totally lost.

Anybody has any sample code or could tell which API I should start  
taking a look at


___

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

Please do not post admin requests or moderator comments to the list.
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: Screen Recording APIs ?

2008-04-25 Thread Jean-Daniel Dupas


Le 25 avr. 08 à 20:35, Marcio Castilho a écrit :

I am new to programming in Mac OSX. I need to do a very simple  
screen recording application similar to uShow, ScreenFlow and  
others, but with very basic settings and simple features. I would  
like some directions on where can I get some references on API  
areas, sample code, or some other information that might help me on  
this task.


I suspect that it is something related to the QuickTime API, but I  
would really appreciate some help here.


I have done this in Windows, but in Mac i am totally lost.

Anybody has any sample code or could tell which API I should start  
taking a look at


--
Marcio Castilho


There is a sample code code on the ADC site that do that:

http://developer.apple.com/samplecode/OpenGLScreenCapture/index.html

Description
Demonstrates how to capture the screen on Mac OS X using OpenGL. The  
sample shows how to grab frames using asynchronous texture fetching, a  
technique which is more complicated but offers better performance than  
synchronous capture using glReadPixels.


When performing asynchronous texture fetching, the resulting capture  
is saved to a movie file. Compression of the actual frames for the  
destination movie file is performed simultaneously with the capture  
but on a separate thread for better performance.





___

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

Please do not post admin requests or moderator comments to the list.
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: How do I use a WebView in a modal dialog?

2008-04-25 Thread David Sinclair


On Apr 25, 2008, at 08:35:53, David Springer wrote:


Folks,

How can I use a WebView in a modal dialog?  I understand that WebViews
don't work in the modal runloop mode, so is there a way to fake this?
Run my own nextEventMatchingMask: loop (I have tried this with very
limited success)?  Run the window containing the WebView in a separate
thread with its own run loop?  Get rid of WebView altogether and go
straight to WebFrame (this sounds hard)?



Tickle the runloop.  See my blog post about this:

http://www.dejal.com/blog/2007/01/cocoa-topics-case-modal-webview

--

David Sinclair, Dejal Systems, LLC - [EMAIL PROTECTED]
Dejal blog - http://www.dejal.com/blog/
Cocoa code - http://www.dejal.com/developer/
Now on Twitter - http://twitter.com/dejal/







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: how to manage multiple non-document windows

2008-04-25 Thread Steve Christensen

On Apr 24, 2008, at 5:01 PM, Ken Thomases wrote:


On Apr 24, 2008, at 6:39 PM, Steve Christensen wrote:
I'm rewriting an old legacy app in Cocoa and have run into a  
stumbling block. The app is supposed to support having multiple  
windows open, but the window content is unrelated to the concept  
of a document - which is the normal multiple window model.  
Instead the windows provide a UI to perform specific calculations,  
among other things. An example of what I'm looking for would be if  
you had a version of the Calculator application where you could  
create multiple calculator windows so you could leave several  
calculations open simultaneously, if that makes sense.


When I start up the app, an instance of the window is created, but  
I can't figure out how to get it to repeat the process in response  
to selecting New from the File menu. I've found a bunch of info on  
multiple document windows, or a single non-doc window plus a  
preferences window, but nothing on instantiating multiple non- 
document windows. Did I just miss something basic, or is all of  
the magic really focused on NSDocumentController, etc.?


If you're going to instantiating a window from a nib multiple  
times, it should generally be in the nib by itself.  Well, the nib  
can have other objects which accompany the window, like  
NSController subclasses.


Then, you load the nib once for each window that you need to  
instantiate.


It's quite helpful to use NSWindowController (or custom subclass)  
objects to manage each nib, its loading, and the resulting window.   
Typically, the NSWindowController is not contained in the nib.   
Rather it is instantiated to manage the loading of the nib from the  
outside.  It is often the File's Owner of the nib.


I put both the window and NSWindowController subclass in MainMenu.nib  
since some of the menu items control behavior in the window (and some  
of the window's current state is reflected in the menus. So I  
wouldn't think that you'd want to reload the nib for that case, right?


I've tried using -[NSWindowController initWithWindowNibName:owner:]  
to create a new controller instance (in response to FileNew),  
figuring that it'd drag the associated window along, but the  
controller's _window ivar is nil, so obviously that's not working. Is  
it just going to be easier for me to go the NSDocument, etc., route  
and say that I have a document that I'm going to load (wink,  
wink) in order to better fit within what appears to be the expected  
multiple window model?


I also just noticed that when I close one of these windows  
(configured with release on close), the controller still hangs  
around, but that's another issue...



___

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

Please do not post admin requests or moderator comments to the list.
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: [solved] How to catch all mouse clicking (or avoid multiple click filtering in startTrackingAt)

2008-04-25 Thread Joan Lluch (casa)

Ken, you're Genius !!

Overriding the mouseDown method of a subclassed control containing  
the cell and passing to its 'super' an identical NSEvent with  
clickCount always 1 did it !


Thank you for your help, I really appreciate it

Joan

El 25/04/2008, a las 09:02, Ken Thomases escribió:


On Apr 25, 2008, at 1:29 AM, Joan Lluch (casa) wrote:
I have implemented a NSButtonCell subclass in the usual way to  
catch mouse tracking. I get the startTrackingAt and stopTracking  
messages called correctly on the first click of the mouse. However  
the startTrackingAt is not quickly called again if I quickly click  
again the mouse, such as if I did a double click. I mean, if I  
perform a double or triple click I only get one pair of  
startTrackingAt and stopTracking calls instead of the desired two  
or three pairs. So the desired behaviour is to be able to catch  
all the mouse clicking activity in almost real time. What I get  
instead is some filtering of the actual mouse clicking. This is  
the way I implemented the methods


I'm guessing that this filtering is being done in -[NSControl  
mouseDown:].  That is, if [theEvent clickCount] is greater than  
one, it doesn't invoke the cell's  
trackMouse:inRect:ofView:untilMouseUp: method.


You can try subclassing the NSControl in question (presumably an  
NSButton?), overriding mouseDown:, and passing a different object  
to [super mouseDown:aDifferentEvent].  You can either create a new  
NSEvent whose properties are all the same as theEvent, or you can  
wrap theEvent in a proxy object which forwards all messages  
faithfully except clickCount, which it intercepts to always return 1.


Good luck,
Ken


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: How do I use a WebView in a modal dialog?

2008-04-25 Thread Jean-Daniel Dupas


Le 25 avr. 08 à 21:00, David Sinclair a écrit :



On Apr 25, 2008, at 08:35:53, David Springer wrote:


Folks,

How can I use a WebView in a modal dialog?  I understand that  
WebViews

don't work in the modal runloop mode, so is there a way to fake this?
Run my own nextEventMatchingMask: loop (I have tried this with very
limited success)?  Run the window containing the WebView in a  
separate

thread with its own run loop?  Get rid of WebView altogether and go
straight to WebFrame (this sounds hard)?



Tickle the runloop.  See my blog post about this:

http://www.dejal.com/blog/2007/01/cocoa-topics-case-modal-webview

--



Not good.
There is not blocking call in your loop, so the loop will keep running  
consuming all the processor.


Instead of your call, you can use

[[NSRunLoop currentLoop] runMode:NSDefaultRunLoopMode beforeDate: 
[NSDate distantFuture]];


The event loop is a runloop data source, so any ui event will wake up  
the source and make this method returns, and so you can block the run  
loop and tell him to wait that something append.



___

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

Please do not post admin requests or moderator comments to the list.
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: Weird Problem With CGImage

2008-04-25 Thread David Duncan

On Apr 25, 2008, at 11:45 AM, Jean-Daniel Dupas wrote:

I didn't find any documentation about CGDataProviderCopyData()  
except this comment in the header:


/* Return a copy of the data specified by provider. Returns NULL if a
* complete copy of the data can't be obtained (for example, if the
* underlying data is too large to fit in memory). */

What is the expected output format of the data it returns ?



The output image data is the same format as the associated CGImageRef.  
You can use the CGImageGet*() functions to determine the exact format  
of the data returned.

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



___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: how to manage multiple non-document windows

2008-04-25 Thread Jean-Daniel Dupas


Le 25 avr. 08 à 21:06, Steve Christensen a écrit :


On Apr 24, 2008, at 5:01 PM, Ken Thomases wrote:


On Apr 24, 2008, at 6:39 PM, Steve Christensen wrote:
I'm rewriting an old legacy app in Cocoa and have run into a  
stumbling block. The app is supposed to support having multiple  
windows open, but the window content is unrelated to the concept  
of a document - which is the normal multiple window model.  
Instead the windows provide a UI to perform specific calculations,  
among other things. An example of what I'm looking for would be if  
you had a version of the Calculator application where you could  
create multiple calculator windows so you could leave several  
calculations open simultaneously, if that makes sense.


When I start up the app, an instance of the window is created, but  
I can't figure out how to get it to repeat the process in response  
to selecting New from the File menu. I've found a bunch of info on  
multiple document windows, or a single non-doc window plus a  
preferences window, but nothing on instantiating multiple non- 
document windows. Did I just miss something basic, or is all of  
the magic really focused on NSDocumentController, etc.?


If you're going to instantiating a window from a nib multiple  
times, it should generally be in the nib by itself.  Well, the nib  
can have other objects which accompany the window, like  
NSController subclasses.


Then, you load the nib once for each window that you need to  
instantiate.


It's quite helpful to use NSWindowController (or custom subclass)  
objects to manage each nib, its loading, and the resulting window.   
Typically, the NSWindowController is not contained in the nib.   
Rather it is instantiated to manage the loading of the nib from the  
outside.  It is often the File's Owner of the nib.


I put both the window and NSWindowController subclass in  
MainMenu.nib since some of the menu items control behavior in the  
window (and some of the window's current state is reflected in the  
menus. So I wouldn't think that you'd want to reload the nib for  
that case, right?


I've tried using -[NSWindowController initWithWindowNibName:owner:]  
to create a new controller instance (in response to FileNew),  
figuring that it'd drag the associated window along, but the  
controller's _window ivar is nil, so obviously that's not working.  
Is it just going to be easier for me to go the NSDocument, etc.,  
route and say that I have a document that I'm going to  
load (wink, wink) in order to better fit within what appears to be  
the expected multiple window model?


I also just noticed that when I close one of these windows  
(configured with release on close), the controller still hangs  
around, but that's another issue...


It will probably be easier for you to understand how nib works. Going  
the NSDocument way whithout nowledge of what append will not help you.

You don't have to add an instance of your window controller to the nib.

First create a new nib file.
Select the nib owner and set it's class to your window controller  
class. Then bind the owner window outlet to the Window object. and  
bind your control to the owner.


And finaly, create a controller instance using -[NSWindowController  
initWithWindowNibName:]; (it sets the owner to self by default)


Now, for your menu items in MainMenu, bind them to the FirstResponder  
object. So the action will always be send to the Window controller  
instance that own the front window.



___

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

Please do not post admin requests or moderator comments to the list.
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]


Framework for IB Plugin and app

2008-04-25 Thread Daniel DeCovnick
I've got a framework project, currently set up to create an embedded  
framework for an application, with a view class that I'd like to turn  
into an IB Plugin. Can the framework be embedded in the IB Plugin?


If so, how? Embedding it like in an app doesn't seem to work: IB  
doesn't seem to see the framework or its classes when I'm setting the  
representedObject and draggedView.


If not, do I use the source of my views to create the IB Plugin, and  
then just embed my regular framework, or is there a way to embed the  
IBPlugin's framework?


Thanks,
Dan
___

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

Please do not post admin requests or moderator comments to the list.
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]


NSAlert

2008-04-25 Thread Bart Beulen

I'm new to cocoa, I'm trying to display an alertbox. This is the code:

NSAlert *alert = [[[NSAlert alloc] init] autorelease];
[alert addButtonWithTitle:@OK];
[alert addButtonWithTitle:@Cancel];
[alert setMessageText:@Delete the record?];
[alert setInformativeText:@Deleted records cannot be restored.];
[alert setAlertStyle:NSWarningAlertStyle];

[alert beginSheetModalForWindow: (NSWindow *)window   
modalDelegate:self  
didEndSelector:@selector(alertDidEnd:returnCode:contextInfo:)  
contextInfo:nil];


- (void)alertDidEnd:(NSAlert *)alert returnCode:(int)returnCode
  contextInfo:(void *)contextInfo {
NSLog(@Test)
}

I cannot find out how to refer to the window of my single window  
program in the method: beginSheetModalForWindow

Some help would be appreciated!

___

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

Please do not post admin requests or moderator comments to the list.
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: NSAlert

2008-04-25 Thread I. Savant
  I cannot find out how to refer to the window of my single window program in
 the method: beginSheetModalForWindow
  Some help would be appreciated!

  Where (in what object) is this code located? That'd probably be a
good place to add an IBOutlet to your window (and connect it in
Interface Builder).

  You'll want to *thoroughly* read this:

http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaFundamentals/Introduction/chapter_1_section_1.html

  Pay particular attention to the Communicating With Objects
section, and the Outlets subsection.

--
I.S.
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Caching a local file using NSURLCache

2008-04-25 Thread Stephan Burlot
I was 100% sure the doc stated that NSURLCache handled file://, and  
since it worked under 10.4, I didnt look further. But I just found  
only http and https are cached.


I didnt want a cache for local file: in my app, I display files which  
are located locally and remotely. In addition, the local files are  
reduced for display, so using an unified cache for remote and local  
did simplify a lot my code. Unfortunately, I have to rewrite it.


The doc says that file:// caching can be done Custom NSURLProtocol  
classes can provide caching if they choose.


If anyone has some sample NSURLProtocol code to share, I didnt found  
any example that I can use.


Thanks,
Stephan



Le 24 avr. 08 à 20:42, Jens Alfke a écrit :



On 23 Apr '08, at 3:14 PM, Stephan Burlot wrote:

I want to cache local files (images) so I cache a NSData using  
[NSURLCache storeCachedResponse]
If I try to fetch it, the cachedResponseForRequest:request is  
always nil under 10.5

This works under 10.4.


NSURLCache was rewritten in 10.5; the new implementation probably  
ignores file: URLs, because it doesn't make sense to use the  
filesystem to cache data from the filesystem.


Are you sure you need to be using a cache to store local files? Why  
can't you just reload the image from its original source file if you  
need to? If you really need to do this, you'll need to make your own  
implementation, I think.


—jens


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Framework for IB Plugin and app

2008-04-25 Thread Ricky Sharp


On Apr 25, 2008, at 2:53 PM, Daniel DeCovnick wrote:

I've got a framework project, currently set up to create an embedded  
framework for an application, with a view class that I'd like to  
turn into an IB Plugin. Can the framework be embedded in the IB  
Plugin?


If so, how? Embedding it like in an app doesn't seem to work: IB  
doesn't seem to see the framework or its classes when I'm setting  
the representedObject and draggedView.


If not, do I use the source of my views to create the IB Plugin, and  
then just embed my regular framework, or is there a way to embed the  
IBPlugin's framework?



IB Plugin's are actually embedded in your framework.  See the  
following for an example:


http://www.instantinteractive.com/private/samplecode/MyIBPlugin.zip

___
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: starting...

2008-04-25 Thread Bertil Holmberg

I´m studying objective-C around one month and have some doubts.



Have you studied the Objective-C 2.0 document? It should answer your  
questions about Properties and the @synthesize directive as these are  
new additions to the language. Although handy in the long run, they do  
make things more difficult for the newbie, as do other abstract  
additions such as bindings...


http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/Introduction/chapter_1_section_1.html

Regards,
Bertil___

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

Please do not post admin requests or moderator comments to the list.
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: QTMovie grabing while playback

2008-04-25 Thread Thomas Engelmeier


On 25.04.2008, at 11:17, Bob Smith wrote:

Well, I'm glad I had an excuse to play around with Quartz Composer;  
I knew about it but had never spent any time with it, very cool!   
Unfortunately, it doesn't solve my immediate problem.  As far as I  
can tell, compositions won't play streaming video at all.  They work  
great with movies from files, and with local live sources (iSight,  
DV).  But giving the Image With Movie patch an .sdp file just  
results in a static QuickTime logo, it never shows any actual video.


IIRC QCPerformer is the sample that shows how to
- use a CVDisplayLink for VBL-synched movie decoding
- feed the result via OPenGL into Quartz Composer,

that might be what you want to throw into the QCTV source mixer...

Regards,
Tom_E
___

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

Please do not post admin requests or moderator comments to the list.
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]


[solved]? Re: Framework for IB Plugin and app

2008-04-25 Thread Daniel DeCovnick
But you can't then embed the framework in the app, AFAICT. IB gives a  
plugin corrupted error message when you change the settings in the  
target to those for an embedded framework and click Build  Run.


Huh, turns out it doesn't anymore. Cool. :-)

-Dan

On Apr 25, 2008, at 5:28 PM, Ricky Sharp wrote:



On Apr 25, 2008, at 2:53 PM, Daniel DeCovnick wrote:

I've got a framework project, currently set up to create an  
embedded framework for an application, with a view class that I'd  
like to turn into an IB Plugin. Can the framework be embedded in  
the IB Plugin?


If so, how? Embedding it like in an app doesn't seem to work: IB  
doesn't seem to see the framework or its classes when I'm setting  
the representedObject and draggedView.


If not, do I use the source of my views to create the IB Plugin,  
and then just embed my regular framework, or is there a way to  
embed the IBPlugin's framework?



IB Plugin's are actually embedded in your framework.  See the  
following for an example:


http://www.instantinteractive.com/private/samplecode/MyIBPlugin.zip

___
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: iphone document syncing

2008-04-25 Thread I. Savant


  Once again, the iPhone SDK is under a non-disclosure agreement,  
which you should know if you've downloaded it. It cannot be discussed  
publicly.


--
I.S.



On Apr 25, 2008, at 5:24 PM, Mark Manes wrote:


Greetings,

I do not know if others have come up with a reasonable solution for  
this that doesn't require software to be installed on the host  
computer -- but my iphone application will create a file that I want  
to get back to the main PC or Mac. I can see no way to do this in  
the SDK.


Anyone have ideas on how to do this that is reasonable?

-mark=

___

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

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

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

This email sent to [EMAIL PROTECTED]


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: [solved]? Re: Framework for IB Plugin and app

2008-04-25 Thread Daniel DeCovnick

That was supposed to be struck-through. Oops.

-Dan
On Apr 25, 2008, at 6:09 PM, Daniel DeCovnick wrote:

But you can't then embed the framework in the app, AFAICT. IB gives  
a plugin corrupted error message when you change the settings in  
the target to those for an embedded framework and click Build  Run.


___

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

Please do not post admin requests or moderator comments to the list.
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: Initial value of on/off buttons

2008-04-25 Thread Yann Disser

No, should I?

Yann

On 25. Apr 2008, at 18:32, Hamish Allan wrote:


On Fri, Apr 25, 2008 at 5:13 PM, Yann Disser [EMAIL PROTECTED] wrote:

I realize that my buttons are generally not affected by the changes  
I make

to the bool-values. Only the other way around.

Can I not bind bools to the value of NSButtons? Or am I missing  
something

else?


Are you binding via an NSObjectController?

Hamish


___

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

Please do not post admin requests or moderator comments to the list.
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]


[not solved] Re: Framework for IB Plugin and app

2008-04-25 Thread Daniel DeCovnick
Never mind on that, it still doesn't work. I don't know why it worked  
one time, but it doesn't now. Suggestions?


-Dan
On Apr 25, 2008, at 6:43 PM, Daniel DeCovnick wrote:


That was supposed to be struck-through. Oops.

-Dan
On Apr 25, 2008, at 6:09 PM, Daniel DeCovnick wrote:

But you can't then embed the framework in the app, AFAICT. IB gives  
a plugin corrupted error message when you change the settings in  
the target to those for an embedded framework and click Build  Run.




___

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

Please do not post admin requests or moderator comments to the list.
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: how to manage multiple non-document windows

2008-04-25 Thread Steve Christensen

On Apr 25, 2008, at 12:45 PM, Erik Verbruggen wrote:


On 25 Apr 2008, at 20:06, Steve Christensen wrote:

I put both the window and NSWindowController subclass in  
MainMenu.nib since some of the menu items control behavior in the  
window (and some of the window's current state is reflected in the  
menus. So I wouldn't think that you'd want to reload the nib for  
that case, right?


Yes, you will want to reload the nib to get a new window. However,  
no, you don't want that for the menu bar. So you should move the  
window to a different nib file. Unfortunately, that will give you  
the excitement of having to update the menu status according to  
the selected window:


And if I move the window and window controller out of the main nib,  
I'm no longer given an option for targets associated with my window  
controller (the first responder doesn't list my controller IBActions)  
when trying to wire up all the menu items. This was likely why I just  
put them into the main nib in the first place.


___

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

Please do not post admin requests or moderator comments to the list.
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: Library-Object in NSPersistentDocument but not in XML-file

2008-04-25 Thread William Turner

Hi Mike,

Are you assigning the entities to different configurations?

Wil

On Apr 23, 2008, at 4:28 PM, Mike Donovan wrote:


Hello everybody!
In my document-based core data application I have a outline view which
displays a list of departments like this (similar to iTunes):

COMPANY [Item]
-- All Employees [SmartItem : Item]
-- Department A [Department : Item]
-- Department B [Department : Item]

That works very well! Items have many children and one parent and the
NSTreeController handles it without any problems. However: I don't  
want any

Items (COMPANY) or SmartItems (All Employees) to be saved in the
document because they are only temporary objects so to say. This is  
done in

CoreRecipes using two different stores: NSXMLStoreType and
NSInMemoryStoreType. When I tried to add this to my app, the saved  
document
is empty. It looks like all objects are assigned to the in-memory  
store. In
fact, the in-memory store is the only one in the context until the  
document

gets saved.

Can you help me?

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/wilshmil%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: Saving NSTextView data to CoreData without ending editing

2008-04-25 Thread Mike Manzano

Here's what I'm doing:


- (void)endEditingSavingCurrentResponder
{
NSResponder *currentResponder = [self firstResponder];
if ([currentResponder isKindOfClass:[NSTextView class]])
{
if( [(NSTextView *) currentResponder isFieldEditor] )
currentResponder = [(NSTextView *)currentResponder 
delegate];
}

if (![self makeFirstResponder:self])
[self endEditingFor:nil];

[self makeFirstResponder:currentResponder];
}


On Apr 25, 2008, at 5:03 PM, William Turner wrote:

When you say you are ending editing what do you mean? Are you  
using commitEditing?


Wil

On Apr 22, 2008, at 12:26 PM, Mike Manzano wrote:

I have an application that periodically needs to save content  
contained in an NSTextView. The text view is bound to a Core Data  
managed object. Currently, I am ending editing on the text view to  
force it to save its contents into the store. However, since I'm  
doing it automatically on a time interval, the view goes out of  
focus which is annoying if you're typing into it. Is there a way to  
save the text view's contents without ending editing on it?


Thanks,

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/wilshmil%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]


Need a native guide through Cannot remove an observer woods

2008-04-25 Thread Jack Repenning
I'm getting this message.  I think I know what all the words mean, and  
I've crawled the KVC and KVO manuals again just to be certain, but I'm  
not getting any inspirations on what I'm supposed to do about this  
situation.  Having seen this message, if I let the program continue  
very much longer (_not_ very much longer, actually), I'm likely to get  
a BAD_ACCESS crash, which I suppose must be related.


2008-04-25 17:13:11.191 SCPluginUIDaemon[20884:10b]
Exception raised during posting of notification.  Ignored.
exception: 'Cannot remove an observer NSKeyValueObservance 0x3807e0
for the key path kind from SVNWCEntry 0x34bfa0
because it is not registered as an observer.'
invoked observer method: '*** -[SVNInfoUI windowWillClose:]'
observer: 0x34c380
notification name: 'NSWindowWillCloseNotification'

I guess part of my confusion is the paradox between cannot remove an  
observer and it is not registered as an observer.  If it's not  
registered, who's trying to remove it?  And why?  And what have I done  
to confuse the poor bloke?


The SVNInfoUI is File's Owner to the NIB, and delegate, and this  
happens when I close the window (all that sounds right).  -[SVNInfoUI  
windowWillClose:] does, indeed, do [self setEntry:nil], where entry is  
an SVNWCEntry, and -setEntry: looks like this:


- (void) setEntry:(SVNWCEntry *)value
{
[self willChangeValueForKey:@entry];

[value retain];
[entry release];
entry = value;

[self didChangeValueForKey:@entry];
}

I can see how this could lead to some vigorous unregistering of  
observers.


will/didChanging @entry.kind in setEntry makes no discernible  
difference.


kind is a property of SVNWCEntry, and the purpose of the SVNInfoUI  
is to display all those SVNWCEntry properties, including kind, so I  
dare say someone's observing the thing, but I can't trace down who, or  
where the connection's made, or how to unmake it.  Kind is not a  
member variable, it's an entry in a dictionary held by SVNWCEntry, so - 
[SVNWCEntry kind] is actually


- (NSString *) kind {
return [data valueForKey:@kind];
}

which I believe is still KVC-compliant and KVOable, though I'm  
mystified as to why it was originally coded that way.


And yes, I've been changing all that code furiously, in particular  
because all these objects were formerly leaked and I'm trying to get  
them released and cleaned up, and so even though this stuff has been  
in our product for a long time, this is probably the first time on any  
stage that an SVNInfoUI and its associated SVNWCEntry have ever  
actually been dealloc'ed, so nearly any surprising thing might be true  
of them.



-==-
Jack Repenning
[EMAIL PROTECTED]
Project Owner
SCPlugin
http://scplugin.tigris.org
Subversion for the rest of OS X


___

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

Please do not post admin requests or moderator comments to the list.
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: how to manage multiple non-document windows

2008-04-25 Thread Jean-Daniel Dupas



Le 26 avr. 08 à 01:44, Steve Christensen a écrit :

On Apr 25, 2008, at 12:45 PM, Erik Verbruggen wrote:


On 25 Apr 2008, at 20:06, Steve Christensen wrote:

I put both the window and NSWindowController subclass in  
MainMenu.nib since some of the menu items control behavior in the  
window (and some of the window's current state is reflected in the  
menus. So I wouldn't think that you'd want to reload the nib for  
that case, right?


Yes, you will want to reload the nib to get a new window. However,  
no, you don't want that for the menu bar. So you should move the  
window to a different nib file. Unfortunately, that will give you  
the excitement of having to update the menu status according to  
the selected window:


And if I move the window and window controller out of the main nib,  
I'm no longer given an option for targets associated with my window  
controller (the first responder doesn't list my controller  
IBActions) when trying to wire up all the menu items. This was  
likely why I just put them into the main nib in the first place.


You can add methods and Outlet manualy to a class in IB. In the  
Identity tab of the inspector, there is the class name, and the list  
of methods and outlets, both with a +button.


Add your methods to the first responder and then you will ba able to  
bind them.


___

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

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

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

This email sent to [EMAIL PROTECTED]


Unexplained hangs

2008-04-25 Thread James Maxwell

Hello All,

I have a very strange error with a project I've been working on. I've  
been trying different designs to try to work out a particular problem,  
and over that time I've been making different subclasses of a  
particular object. Suddnely, for no reason that I can see, *any*  
subclass of this object fails to init. The debugger hangs on  
objc_msgSend, and clicking continue gives EXC_BAD_ACCESS.


Now, I know there could be a million reasons why an object wouldn't  
init, but if I use the super class, the program runs fine. To make the  
point even more obvious, even subclass with NO overrides of any kind  
won't init, but using the superclass directly works just fine. The  
code compiles, but hangs when I run it.


I've been having weird problems all day, and I'm just wondering if  
anybody knows of any particularly strange bugs in xCode 3.0, and  
whether there are any cures. This seriously makes no sense (and I've  
been having other problems today which similarly made little sense).


Any thoughts **greatly** appreciated.

thanks,

J.
___

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

Please do not post admin requests or moderator comments to the list.
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: QTMovie grabing while playback

2008-04-25 Thread Bob Smith

On Apr 25, 2008, at 7:41 AM, douglas a. welton wrote:


Bob,

re:  Quartz Composer
Did you check the Asynchronous Mode checkbox on the Movie Loader  
patch's Settings panel?  This box is specifically available to  
allow for playback of streaming material.


Eh?  I don't see a patch called Movie Loader at all.  I see a  
Generator patch called Image With Movie, and the only setting is  
Highest Quality.  I'm doing all development under Tiger because I  
have to deploy on older systems, could you be describing something  
which is new to Leopard?  I should repeat my tests under 10.5, it is  
possible one of these approaches will just work.  That isn't  
necessarily a solution since I would have to persuade the client to  
upgrade a pile of old G5 systems, but I should find out if this  
problem is only on Tiger.



re:  QT flaw
The supposition that QuickTime is fundamentally flawed is not  
accurate.  If you had time to explore, I would point you in the  
direction of the QT Broadcaster interface and the sample code  
available for receiving (and parsing) RTSP/RTP streams.  If you  
don't have time, don't go down this path - the API is cryptic (at  
best) and very poorly documented.


Today I agree with you, my jumped-to conclusion isn't justified.   
Sorry, I was feeling a bit frustrated last night.  There is surely  
some way to get this to work by using the QuickTime C APIs directly,  
but some subtlety involved in streaming just isn't being handled by  
the Cocoa APIs, at least not on 10.4.  However, other than doing some  
tests on 10.5, I have to set this aside due to time constraints.   
I've got something deliverable now, hopefully I'll have a chance to  
figure out how to do it right later.


Thanks!

Bob

___

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

Please do not post admin requests or moderator comments to the list.
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: starting...

2008-04-25 Thread Brad Gibbs
I also began learning Objective-C programming about a month ago,  
without any prior C experience.  I've found Stephen Kochan's  
Programming in Objective-C to be very useful.  He claims readers will  
be able to follow along without prior knowledge of C.  That's been  
true for me so far (I'm about 3/4 of the way through it).  I'd  
recommend that book first, then Apple's Objective-C 2.0 document to  
update what you've learned in Kochan's book, then Aaron Hillegass'  
book, the third edition of which is due to be available in about a  
month.






On Apr 25, 2008, at 2:35 PM, Bertil Holmberg wrote:


I´m studying objective-C around one month and have some doubts.



Have you studied the Objective-C 2.0 document? It should answer your  
questions about Properties and the @synthesize directive as these  
are new additions to the language. Although handy in the long run,  
they do make things more difficult for the newbie, as do other  
abstract additions such as bindings...


http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/Introduction/chapter_1_section_1.html

Regards,
Bertil___

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

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

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


edit file

2008-04-25 Thread Christopher
How exactly would I go about replacing the DefaultDesktop.jpg image in  
core services with a objective c cocoa app. I'm just starting with  
cocoa, so any help is greatly appreciated.

___

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

Please do not post admin requests or moderator comments to the list.
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: Unexplained hangs

2008-04-25 Thread Keary Suska
on 4/25/08 7:15 PM, [EMAIL PROTECTED] purportedly said:

 I have a very strange error with a project I've been working on. I've
 been trying different designs to try to work out a particular problem,
 and over that time I've been making different subclasses of a
 particular object. Suddnely, for no reason that I can see, *any*
 subclass of this object fails to init. The debugger hangs on
 objc_msgSend, and clicking continue gives EXC_BAD_ACCESS.

In GDB are you able to see the line in your code that leads to this error?
If so, post it. Also post your init.

Also, NSZombieEnabled is your friend. See
http://www.cocoadev.com/index.pl?NSZombieEnabled.

Best,

Keary Suska
Esoteritech, Inc.
Demystifying technology for your home or business


___

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

Please do not post admin requests or moderator comments to the list.
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: Screen Recording APIs ?

2008-04-25 Thread Rob Keniger


On 26/04/2008, at 4:50 AM, j o a r wrote:


Check out:

CGRegisterScreenRefreshCallback(), and

CGWindowListCreateImage()

Documentation is a bit limited at this point, but they're pretty  
easy to figure out.



There's some good sample code for this:

http://developer.apple.com/samplecode/SonOfGrab/

--
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: Need a native guide through Cannot remove an observer woods

2008-04-25 Thread Keary Suska
on 4/25/08 6:49 PM, [EMAIL PROTECTED] purportedly said:

 - (void) setEntry:(SVNWCEntry *)value
 {
 [self willChangeValueForKey:@entry];
 
 [value retain];
 [entry release];
 entry = value;
 
 [self didChangeValueForKey:@entry];
 }

If you haven't turned off automatic KVO notifications, the above is very
wrong, and could be the source of your problem.

Best,

Keary Suska
Esoteritech, Inc.
Demystifying technology for your home or business


___

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

Please do not post admin requests or moderator comments to the list.
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: Initial value of on/off buttons

2008-04-25 Thread I. Savant

On Apr 25, 2008, at 7:37 PM, Yann Disser wrote:


Are you binding via an NSObjectController?


No, should I?



  Yes (or one of its subclasses). You have to make sure everyone is  
on the same page as mindless corporate and government automatons are  
wont to say. In Cocoa, this is done easiest (usually) with Bindings:


http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaBindings/Concepts/HowDoBindingsWork.html#/ 
/apple_ref/doc/uid/20002373


  Since Cocoa follows the Model-View-Controller design pattern:

http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaFundamentals/CocoaDesignPatterns/chapter_5_section_4.html

  ... and the Bindings mechanism relies on the Key Value Coding and  
Key Value Observing mechanisms:


http://developer.apple.com/documentation/Cocoa/Conceptual/KeyValueCoding/KeyValueCoding.html

http://developer.apple.com/documentation/Cocoa/Conceptual/KeyValueObserving/KeyValueObserving.html

  ... this means that yes, your boolean values can be bound to things  
(or things can be bound to your boolean value) but both sides of the  
relationship must play by the rules to get things observed and/or  
respond to the things you're observing.


  Considering the above (if you believe such edicts), that should be  
done by the controller layer, which is in the best position to mediate  
between your model (state, persistent or not) and your view of that  
model. Your controller just has to send the right signals to get  
changes noticed.


  Without this, you'd have to do something ridiculous. Something like  
making a checkbox know how to track whether that picture of your  
grandma doing shots of Jägermeister and showing her tongue piercing at  
the local strip club is included in an album you happen to be  
publishing on photobucket.com and sharing with the good folks at First  
Baptist Church.


  Where was I? Oh.

  We don't need a checkbox that specific. Just a checkbox that  
reflects a boolean state. We also don't need to photo to know anything  
about albums and photobucket.com and grandma's questionable habits.  
That particular state in that particular grandma-busting application  
is shared with a property of some 'picture' object ... a boolean  
property called 'includedInAlbum'. The controller is responsible for  
matching the checkbox to the 'included' state of a picture to an album.


  That controller executes the 'application-specific' logic that  
makes that particular checkbox affect the 'includedInAlbum' state of  
that particular picture (depending on your selection and latent anger  
toward your grandmother). Make it do your will and thank you for the  
privilege - but respect its existing talents - and leave the rest to  
do what they were designed to do.


  So ... bind your button (view) to your model (whatever that boolean  
represents) via their common mediator - a controller. Depending on  
your needs, a generic NSObjectController, an NSDictionaryController,  
or the more container-like NSArrayController will handle most general  
cases with ease. NSTreeController ... well NSTreeController is ...  
available.


  Now a standard disclaimer: I apologize if any of that is unclear,  
incomplete, or just wine-drunken rambling. It's Friday.


--
I.S.


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: how to manage multiple non-document windows

2008-04-25 Thread Steve Christensen


On Apr 25, 2008, at 5:51 PM, Jean-Daniel Dupas wrote:


Le 26 avr. 08 à 01:44, Steve Christensen a écrit :

On Apr 25, 2008, at 12:45 PM, Erik Verbruggen wrote:


On 25 Apr 2008, at 20:06, Steve Christensen wrote:

I put both the window and NSWindowController subclass in  
MainMenu.nib since some of the menu items control behavior in  
the window (and some of the window's current state is reflected  
in the menus. So I wouldn't think that you'd want to reload the  
nib for that case, right?


Yes, you will want to reload the nib to get a new window.  
However, no, you don't want that for the menu bar. So you should  
move the window to a different nib file. Unfortunately, that will  
give you the excitement of having to update the menu status  
according to the selected window:


And if I move the window and window controller out of the main  
nib, I'm no longer given an option for targets associated with my  
window controller (the first responder doesn't list my controller  
IBActions) when trying to wire up all the menu items. This was  
likely why I just put them into the main nib in the first place.


You can add methods and Outlet manualy to a class in IB. In the  
Identity tab of the inspector, there is the class name, and the  
list of methods and outlets, both with a +button.


Add your methods to the first responder and then you will ba able  
to bind them.


That did it! Thank you so much for the pointer.

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: edit file

2008-04-25 Thread I. Savant
How exactly would I go about replacing the DefaultDesktop.jpg image  
in core services with a objective c cocoa app. I'm just starting  
with cocoa, so any help is greatly appreciated.


  You'd want to write an application that uses AuthServices to obtain  
permission to use NSFileManager to back up the user's original  
DefaultDesktop.jpg (since you're a nice, well-behaved application and  
all), then to copy some other image over the original.


  Each of these things is well-documented in Apple's documentation  
and well-covered in this list's archives and there's a lot to know, so  
your first step is to read. A lot. ;-)


--
I.S.


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Cocoa-dev Digest, Vol 5, Issue 682

2008-04-25 Thread Johnny Lundy

Thanks.

I had two instances of one of my classes in my IB document.

Removing the extra one solved my problem.


On Apr 25, 2008, at 9:36 PM, [EMAIL PROTECTED] wrote:


Hey John -

If init is being called twice on the same instance, that sounds like a
bug. It should be pretty easy to figure out with a backtrace in the
debugger. Of course, you should make sure there aren't two different
instances.

AwakeFromNib on the other hand will be called once each time you load
a nib that references your object. Typically this means that
awakeFromNib is called only once because most objects are only in one
NIB. If you're object loads additional NIB files and is the file's
owner, it will be called additional times.

Good Luck -
Jon Hess

On Apr 25, 2008, at 9:41 AM, Johnny Lundy wrote:


I know I saw something somewhere in reference to these methods
getting called twice on app launch, but can't find it with searching.

Is this expected behavior for vanilla -init and (void) awakeFromNib
methods? I'm doing some short loops in these methods and calling
other instance methods. For now, no harm is done with all this stuff
being done twice, but I'd rather not have to worry about that if I
add code.

I don't see most examples routinely checking for a second invocation
in these init methods so I wonder what is going on.

Other than that, all the advice I got here has worked and I now have
350 lines of code and only one line is glue. Very nice learning
experience for Bindings and I thank all who helped.




___

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

Please do not post admin requests or moderator comments to the list.
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: One pixel width. One.

2008-04-25 Thread Graham Cox
Setting a line width of 0 on NSBezierPath means draw it 1 pixel wide  
at whatever resolution the destination device is. 1 pixel on the  
screen aligned to an integer coordinate will draw two pixels wide at  
half the brightness (anti-aliasing).


Thus, 1. offset your coordinates by 0.5 to avoid this effect.

2. RTFD. It's very well documented.


hth,

G.


On 26 Apr 2008, at 1:58 am, Lorenzo wrote:
Joe, thank you. That page helps. I succeeded, but I had to set the  
width to
0.01 because if I set it to zero I get a 2 pixels thick line when  
the scale

is different than 1.0. Don't know why. Please follow me.




   [NSBezierPath setDefaultLineWidth:0.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: NSAlert

2008-04-25 Thread Bart Beulen

Problem solved, I had to fill in: [NSApp mainWindow]


I cannot find out how to refer to the window of my single window  
program in

the method: beginSheetModalForWindow
Some help would be appreciated!

___

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

Please do not post admin requests or moderator comments to the list.
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]


NSBezier Artifacts

2008-04-25 Thread Aaron Wallis
I've been having a fair few issues with NSBezier boxes lately (a.k.a  
boxes with rounded corners)


I've created a NSView subclass that contains the following code, then  
threw a few on a window with some controls over the top:

- ( void ) drawRect: ( NSRect ) rect
{
NSBezierPath* thePath = [NSBezierPath bezierPath];
   	[thePath appendBezierPathWithRoundedRect:rect xRadius:10.0  
yRadius:10.0];

[thePath fill];
}

the results are horrid: http://skitch.com/d2kagw/kemd/window
there's loads of artifacts on the initial draw as well as each when  
the user interacts with the controls etc.


If I make them just plain rectangles - it works fine: 
http://skitch.com/d2kagw/kemr/window
- ( void ) drawRect: ( NSRect ) rect
{
[NSBezierPath fillRect:rect];
}

Any ideas?
I just need to draw some boxes :D

Cheers!

/Az.
___

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

Please do not post admin requests or moderator comments to the list.
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]