compile DrawKit in 10.8

2012-08-05 Thread James Maxwell
Hello All,

Has anyone had problems compiling drawkit on 10.8? I can't seem to build it. I 
tried downloading a fresh copy from apptree.net, but I still get errors. I'm 
using "Latest" base sdk and the "default" LLVM compiler. I'm trying to build 
the 32-bit version, for now, and getting these 4 errors:

Undefined symbols for architecture i386:
  "_partcodeForElement", referenced from:
  -[DKDrawablePath pathCreateLoop:] in DKDrawablePath.o
  -[DKDrawablePath lineCreateLoop:] in DKDrawablePath.o
  -[DKDrawablePath polyCreateLoop:] in DKDrawablePath.o
  -[DKDrawablePath arcCreateLoop:] in DKDrawablePath.o
  -[DKDrawablePath isOpenEndPoint:] in DKDrawablePath.o
  -[NSBezierPath(DKEditing) 
moveControlPointPartcode:toPoint:colinear:coradial:constrainAngle:] in 
NSBezierPath+Editing.o
  "_partcodeForElementControlPoint", referenced from:
  -[DKDrawablePath pathCreateLoop:] in DKDrawablePath.o
  -[NSBezierPath(DKEditing) 
partcodeHitByPoint:tolerance:startingFromElement:prioritiseOnPathPoints:] in 
NSBezierPath+Editing.o
  -[NSBezierPath(DKEditing) partcodeForLastPoint] in NSBezierPath+Editing.o
  -[NSBezierPath(DKEditing) 
moveControlPointPartcode:toPoint:colinear:coradial:constrainAngle:] in 
NSBezierPath+Editing.o
  "_subdivideBezierAtT", referenced from:
  -[NSBezierPath(DKEditing) insertControlPointAtPoint:tolerance:type:] in 
NSBezierPath+Editing.o
  -[NSBezierPath(Geometry) distanceFromStartOfPathAtPoint:tolerance:] in 
NSBezierPath+Geometry.o
  _subdivideBezierAtLength in NSBezierPath+Geometry.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)


Any thoughts appreciated.

J.



--
James B. Maxwell
Composer/Researcher/PhD Candidate






___

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

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

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

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


How long will the dev site be down?

2012-08-05 Thread Rick Mann
"We'll be back soon.", but it has been 5 hours or more.

-- 
Rick



___

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

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

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

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


NSWindow with a NSTableView redraws incorrectly with autolayout on 10.8

2012-08-05 Thread Marcus Karlsson
Hello.

I'm experiencing some window redrawing issues on 10.8 when I'm using
NSTableViews and autolayout.

I have created an application from the standard Cocoa application
template in Xcode and set it to use automatic reference counting. All
I've added is a toolbar and a table view to the window in MainMenu.xib.
I've not added any code.

If I run the application the window displays with the toolbar at the top
and the table view in the middle. I then click on the green title bar
button twice in order to first maximize the window and then restore it
to its original size. However the window does not restore correctly,
it's much taller than what it used to be.

I then ctrl-click on the toolbar and hide it. The toolbar disappears
with the usual toolbar animation but then immediately reappears. The
toolbar is visible but does no longer respond to events. If the window
is resized the ghost toolbar is left in its original position and does
not resize with the window.

On this page there are some screenshots that visualize what it looks
like:
http://stackoverflow.com/questions/11808299/nswindow-with-a-nstableview-behaves-weird-after-zoomed

Just to be sure that there wasn't something in my environment that
caused the problem I downloaded a fresh copy of 10.8 from the Mac App
Store and installed it in a virtual machine, however I'm experiencing
the exact same issue there as well. In 10.7 it all works as expected.

Does anyone know why this happens and what I should do to prevent it? Is
it perhaps simply that I'm doing it wrong and that this is undefined
behavior that is different between 10.7 and 10.8.

Marcus

___

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

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

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

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


Re: crash in showOpenPanel on ML

2012-08-05 Thread Mike Abdullah


On 4 Aug 2012, at 08:08 PM, James Merkel  wrote:

> On Sat, 04 Aug 2012 15:08:54 +0100 Mike Abdullah wrote:
> 
>> A) Your customers aren't going to be very happy about that
>> B) You can still codesign with a self-signed certificate, and really should 
>> have been doing so since the 10.5 days
> 
> Except that the Code Signing Guide says the following:
> 
> "Do not ship applications signed by self-signed certificates. A self-signed 
> certificate created with the Certificate Assistant is not recognized by 
> users’ operating systems as a valid certificate for any purpose other than 
> validating the designated requirement of your signed code. Because a 
> self-signed certificate has not been signed by a recognized root certificate 
> authority, the user can only verify that two versions of your application 
> came from the same source; they cannot verify that your company is the true 
> source of the code. For more information about root authorities, see 
> “Security Concepts”."
> 
> So I take it from this statement that if you allow downloads from Identified 
> Developers in your ML Security preferences, the download still wont' be 
> allowed if it's a self-signed certificate.

Correct. Self-signing purely guarantees that a new version of an app came from 
the same developer as the previous version. Pre-Developer ID, the benefits were:

- keychain prompts only appear the once, rather than once per version
- firewall didn't prompt about your app in some configs
There may be others I've forgotten

These days you need to be code signed to use security-scoped bookmarks or 
notification centre. Self-signing is really just a stopgap now to give you 
those features before applying for a Developer ID.
___

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

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

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

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

Re: compile DrawKit in 10.8

2012-08-05 Thread Graham Cox
Hi James,

I'm not really sure questions about my framework are appropriate for Cocoa-Dev, 
but anyhoo... what you have there are linker errors. I build DK daily and I had 
no problem at all with the 10.8 SDK or Xcode 4.4, so I'm not sure what the 
problem might be. The errors are all symbols within DK itself, not part of 
Cocoa. They are references to plain C functions though, not Objective-C 
methods. That might be a clue. These functions are part of the .m files listed 
here, so I don't know why the compiler would skip them, or otherwise overlook 
them. Odd. Have you tried building 64-bit?

--Graham







On 05/08/2012, at 6:25 PM, James Maxwell  wrote:

> Hello All,
> 
> Has anyone had problems compiling drawkit on 10.8? I can't seem to build it. 
> I tried downloading a fresh copy from apptree.net, but I still get errors. 
> I'm using "Latest" base sdk and the "default" LLVM compiler. I'm trying to 
> build the 32-bit version, for now, and getting these 4 errors:
> 
> Undefined symbols for architecture i386:
>  "_partcodeForElement", referenced from:
>  -[DKDrawablePath pathCreateLoop:] in DKDrawablePath.o
>  -[DKDrawablePath lineCreateLoop:] in DKDrawablePath.o
>  -[DKDrawablePath polyCreateLoop:] in DKDrawablePath.o
>  -[DKDrawablePath arcCreateLoop:] in DKDrawablePath.o
>  -[DKDrawablePath isOpenEndPoint:] in DKDrawablePath.o
>  -[NSBezierPath(DKEditing) 
> moveControlPointPartcode:toPoint:colinear:coradial:constrainAngle:] in 
> NSBezierPath+Editing.o
>  "_partcodeForElementControlPoint", referenced from:
>  -[DKDrawablePath pathCreateLoop:] in DKDrawablePath.o
>  -[NSBezierPath(DKEditing) 
> partcodeHitByPoint:tolerance:startingFromElement:prioritiseOnPathPoints:] in 
> NSBezierPath+Editing.o
>  -[NSBezierPath(DKEditing) partcodeForLastPoint] in NSBezierPath+Editing.o
>  -[NSBezierPath(DKEditing) 
> moveControlPointPartcode:toPoint:colinear:coradial:constrainAngle:] in 
> NSBezierPath+Editing.o
>  "_subdivideBezierAtT", referenced from:
>  -[NSBezierPath(DKEditing) insertControlPointAtPoint:tolerance:type:] in 
> NSBezierPath+Editing.o
>  -[NSBezierPath(Geometry) distanceFromStartOfPathAtPoint:tolerance:] in 
> NSBezierPath+Geometry.o
>  _subdivideBezierAtLength in NSBezierPath+Geometry.o
> ld: symbol(s) not found for architecture i386
> clang: error: linker command failed with exit code 1 (use -v to see 
> invocation)
> 
> 
> Any thoughts 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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


How to create an image, which can be accessed directly from memory as well as using Quarz functions?

2012-08-05 Thread Vojtěch Meluzín
Hi,

I'm performing my own graphics rendering using background images, which are
then placed onto the resulting Carbon/Cocoa view. I can perform the whole
rendering manually (by accessing the image data), but for some reason this
seems quite slow compared to the same thing on Windows (probably the final
conversion to system image, which isn't needed on Windows). Anyway I'd like
to use the Quarz functions to optimize something, or at least avoid the
final conversion to the system image. Is there a way to create an image,
which can be then manipulated directly as well as using system drawing
functions like it is on Windows? So far I tried CGImageCreate +
CGContextDrawImage and CGBitmapContextCreateImage + CGContextDrawImage  and
both cases are just slow.

Regards,
Vojtech
___

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

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

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

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


Re: How long will the dev site be down?

2012-08-05 Thread Fritz Anderson
I'm not sure that anyone on this list would have had a guess, but 
developer.apple.com (you meant that?) responds for me now.

— F

On 5 Aug 2012, at 3:26 AM, Rick Mann  wrote:

> "We'll be back soon.", but it has been 5 hours or more.


___

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

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

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

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

Re: NSWindow with a NSTableView redraws incorrectly with autolayout on 10.8

2012-08-05 Thread Fritz Anderson
On 5 Aug 2012, at 4:09 AM, Marcus Karlsson  wrote:

> If I run the application the window displays with the toolbar at the top
> and the table view in the middle. I then click on the green title bar
> button twice in order to first maximize the window and then restore it
> to its original size. However the window does not restore correctly,
> it's much taller than what it used to be.
> 
> I then ctrl-click on the toolbar and hide it. The toolbar disappears
> with the usual toolbar animation but then immediately reappears. The
> toolbar is visible but does no longer respond to events. If the window
> is resized the ghost toolbar is left in its original position and does
> not resize with the window.

I've verified this, and it's as simple to reproduce as you say: Mac app, 
non-document, drag a toolbar in, and a table view, resized to the content view. 
It seems to be determined by whether auto layout is active. If you turn it off, 
the window behaves as expected (though you have to reset the autoresizing on 
the table).

I don't see anything obvious in the constraints. The only ones I can find are 
superview-hugging by the scroll view, and hugging/compression on various views. 
None of them are exceptional. I don't see maximum widths that constrain the 
window, and of course there's no explanation for reinserting the toolbar and 
detaching its items from their actions.

Attaching the toolbar's delegate to the app delegate (even without implementing 
any of the methods — they're supposed to be optional anyway) relieved the 
disappear/reappear/zombie behavior, but not the resizing problem. 

Removing the toolbar had no effect on the resizing problem. Setting delegate 
and dataSource on the table view had no effect. Passing the results of 
constraintsAffectingLayoutForOrientation: on the table view to 
visualizeConstraints: produced nothing that looked unusual to me, but my eye is 
untrained.

File a bug if it doesn't get cleared up on the list.

— F

-- 
Fritz Anderson -- Xcode 4 Unleashed: (Hint: Kindle) -- 



___

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

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

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

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

How to (slowly) rotate a view

2012-08-05 Thread Gerriet M. Denkmann
 I use this code (iOS 5.1):
CGAffineTransform m = { c, +s, -s, c, 0, 0 };   //  rotation, s = 
sin(angle), c = cos(angle)
CALayer *layer = self.view.layer;   //  view is UIView, self is 
subclass of UIViewController
[ CATransaction begin];
[ CATransaction setAnimationDuration: 9 ];
[ layer setAffineTransform: m ];
[ CATransaction commit];
The view rotates ok, but does it instantly, instead of taking 9 seconds.

What am I doing wrong?

Gerriet.


___

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

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

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

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


Re: How to (slowly) rotate a view

2012-08-05 Thread Kyle Sluder
On Aug 5, 2012, at 10:11 AM, "Gerriet M. Denkmann"  wrote:

> I use this code (iOS 5.1):
>CGAffineTransform m = { c, +s, -s, c, 0, 0 };//rotation, s = 
> sin(angle), c = cos(angle)
>CALayer *layer = self.view.layer;//view is UIView, self is 
> subclass of UIViewController
>[ CATransaction begin];
>[ CATransaction setAnimationDuration: 9 ];
>[ layer setAffineTransform: m ];
>[ CATransaction commit];
> The view rotates ok, but does it instantly, instead of taking 9 seconds.
> 
> What am I doing wrong?

What happens if you use the transform property instead of setAffineTransform:?

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

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


Re: How to (slowly) rotate a view

2012-08-05 Thread Gerriet M. Denkmann

On 6 Aug 2012, at 00:20, Kyle Sluder wrote:

> On Aug 5, 2012, at 10:11 AM, "Gerriet M. Denkmann"  
> wrote:
> 
>> I use this code (iOS 5.1):
>>   CGAffineTransform m = { c, +s, -s, c, 0, 0 };//rotation, s = 
>> sin(angle), c = cos(angle)
>>   CALayer *layer = self.view.layer;//view is UIView, self is 
>> subclass of UIViewController
>>   [ CATransaction begin];
>>   [ CATransaction setAnimationDuration: 9 ];
>>   [ layer setAffineTransform: m ];
>>   [ CATransaction commit];
>> The view rotates ok, but does it instantly, instead of taking 9 seconds.
>> 
>> What am I doing wrong?
> 
> What happens if you use the transform property instead of setAffineTransform:?

I tried instead:
//  opacity is 0.5
[ CATransaction begin];
[ CATransaction setAnimationDuration: 9 ];
layer.opacity = 1;
[ CATransaction commit];

[ CATransaction begin];
[ CATransaction setAnimationDuration: 9 ];
layer.opacity = 0.5;
[ CATransaction commit];
but I only see the resulting opacity of 0.5.

The view controller is a child of another view controller. The view is subview 
of another view.

Gerriet.




___

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

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

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

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


RE: I2C question - what is correct mailing list

2012-08-05 Thread C.W. Betts

My guess is either the darwin-kernel or darwin-drivers mailing list. Both can 
be found here: 
https://lists.apple.com/mailman/listinfo 

> Date: Fri, 27 Jul 2012 14:08:14 +0300
> From: vit...@qubyx.com
> To: cocoa-dev@lists.apple.com
> Subject: I2C question - what is correct mailing list
> 
> Hello,
> 
>   This is question to cocoa-dev moderators. I had asked twice question 
> about IOKit/i2c interface, but this messages was blocked as i understand.
> Can you please help to find correct mailing list for my question.
> 
> Thank you.
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/computers57%40hotmail.com
> 
> This email sent to computer...@hotmail.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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: crash in showOpenPanel on ML

2012-08-05 Thread Andy Lee
I'm seeing this too. It's breaking on an exception. If I hit Continue, the app 
proceeds without any apparent ill effect -- and no logging of the exception.

--Andy

On Aug 4, 2012, at 12:00 PM, Koen van der Drift  
wrote:

> 
> On Aug 4, 2012, at 9:08 AM, Koen van der Drift  
> wrote:
> 
>> I'll keep digging
> 
> Well, the problem is gone.  After reading the rdar I mentioned in an earlier 
> email that the problem was solved by creating a new project, I decided to 
> remove my project settings, and the xuserdata folder. After a Clean and 
> Rebuild, the problem was gone.  Glad it is solved, but not too satisfactory 
> either, since I can only guess now which setting was the culprit.
> 
> Regarding the responses about code signing: point well taken, and I am going 
> to look into that.
> 
> - Koen.
___

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

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

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

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


Re: crash in showOpenPanel on ML

2012-08-05 Thread Kyle Sluder
On Aug 2, 2012, at 6:35 PM, Koen van der Drift  
wrote:

> When the code executes, I briefly see the open panel window, but then it 
> crashes immediately, even before I can select a file. The error I get is for 
> me not clear:
> 
> Thread 1, Queue : com.apple.main-thread
> Thread 2, Queue : (null)
> Thread 3, Queue : com.apple.libdispatch-manager
> Thread 4, Queue : (null)
> Thread 5 com.apple.NSURLConnectionLoader, Queue : (null)
> Thread 6, Queue : (null)
> Thread 7, Queue : quicklook.pluginload
> #00x7fff92e3aab8 in __cxa_throw ()

> #10x7fff8a9c883a in Security::MacOSError::throwMe(int) ()
> #20x7fff8a8fb224 in Security::CodeSigning::SecStaticCode::signature() 
> ()
> #30x7fff8a8fb449 in 
> Security::CodeSigning::SecStaticCode::verifySignature() ()

As Andy points out, you're not actually crashing. You're just breaking in the 
debugger on a C++ exception throw. C++ code often uses exceptions for flow 
control. It's harmless but annoying to the Cocoa programmer.

Log a bug against the Security framework throwing exceptions, and make sure 
your Xcode breakpoint is set only to "All Objective-C exceptions" instead of 
"All Exceptions."

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

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


Re: How to (slowly) rotate a view

2012-08-05 Thread Kyle Sluder
On Aug 5, 2012, at 10:34 AM, "Gerriet M. Denkmann"  wrote:

> I tried instead:
>//opacity is 0.5
>[ CATransaction begin];
>[ CATransaction setAnimationDuration: 9 ];
>layer.opacity = 1;
>[ CATransaction commit];
>
>[ CATransaction begin];
>[ CATransaction setAnimationDuration: 9 ];
>layer.opacity = 0.5;
>[ CATransaction commit];
> but I only see the resulting opacity of 0.5.
> 
> The view controller is a child of another view controller. The view is 
> subview of another view.

Any reason you're animating the layer properties instead of the view 
properties? UIView exposes transform and opacity, and has its own animation 
methods.

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

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


Re: How to (slowly) rotate a view

2012-08-05 Thread Gerriet M. Denkmann

On 6 Aug 2012, at 01:01, Kyle Sluder wrote:

> On Aug 5, 2012, at 10:34 AM, "Gerriet M. Denkmann"  
> wrote:
> 
>> I tried instead:
>>   //opacity is 0.5
>>   [ CATransaction begin];
>>   [ CATransaction setAnimationDuration: 9 ];
>>   layer.opacity = 1;
>>   [ CATransaction commit];
>> 
>>   [ CATransaction begin];
>>   [ CATransaction setAnimationDuration: 9 ];
>>   layer.opacity = 0.5;
>>   [ CATransaction commit];
>> but I only see the resulting opacity of 0.5.
>> 
>> The view controller is a child of another view controller. The view is 
>> subview of another view.
> 
> Any reason you're animating the layer properties instead of the view 
> properties? UIView exposes transform and opacity, and has its own animation 
> methods.
No reason at all.

But I tried self.view.alpha instead of layer.opacity and did not see anything 
changing either.


Now this code seems to be working:

CALayer *layer = self.view.layer;
if ( animated )
{
CABasicAnimation *thAnimation = [ CABasicAnimation 
animationWithKeyPath: @"transform" ];
thAnimation.duration = 0.3;

CATransform3D oldTrans = layer.transform;
thAnimation.fromValue = [ NSValue valueWithCATransform3D: 
oldTrans ];

CATransform3D newTrans = CATransform3DMakeAffineTransform (m);
thAnimation.toValue = [ NSValue valueWithCATransform3D: 
newTrans ];

[ layer addAnimation: thAnimation forKey: @"rotateSlowly" ];
};

[ layer setAffineTransform: m ];


Gerriet.


___

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

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

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

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


Re: How to (slowly) rotate a view

2012-08-05 Thread Richard Altenburg (Brainchild)
Something along these lines maybe?:


[UIView animateWithDuration:durationSeconds
 animations:^
 {
 [view setTransform:CGAffineTransformRotate([view transform], 
angleRadians)];
 }
 ];


[[[Brainchild alloc] initWithName:@"Richard Altenburg"] saysBestRegards];

Op 5 aug. 2012, om 19:11 heeft "Gerriet M. Denkmann"  het 
volgende geschreven:

> The view rotates ok, but does it instantly, instead of taking 9 seconds.

___

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

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

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

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


Re: How to (slowly) rotate a view

2012-08-05 Thread Gerriet M. Denkmann

On 6 Aug 2012, at 01:48, Richard Altenburg (Brainchild) wrote:

>[UIView animateWithDuration:durationSeconds
>  animations:^
>  {
>  [view setTransform:CGAffineTransformRotate([view transform], 
> angleRadians)];
>  }
>  ];
> 

Thanks! (or: Dank U well)
This is much better than the using CABasicAnimation animationWithKeyPath: on 
the layer.

Gerriet.


___

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

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

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

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


Re: How to (slowly) rotate a view

2012-08-05 Thread Richard Altenburg (Brainchild)
You are most welcome. It took me a while to find the cleanest solution for 
rotating views in my project and I wanted to give it to you to save you some 
headaches...

Mit freundlichem Gruß.


[[[Brainchild alloc] initWithName:@"Richard Altenburg"] saysBestRegards];

Op 5 aug. 2012, om 21:08 heeft "Gerriet M. Denkmann"  het 
volgende geschreven:

> Thanks! (or: Dank U well)
> This is much better than the using CABasicAnimation animationWithKeyPath: on 
> the layer.

___

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

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

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

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

RE: How to (slowly) rotate a view

2012-08-05 Thread Julius Oklamcak
FWIW: UIView sets the delegate of its CALayer to itself - one of the things
that it appears to do is to disable any implicit animations. If you add your
own CALayer to a UIView's CALayer, then you're in full control. As already
pointed out, it's easier using one of the UIView animation class methods to
animate UIView stuff... :)

> I use this code (iOS 5.1):
>   CGAffineTransform m = { c, +s, -s, c, 0, 0 };//rotation, s =
sin(angle), c = cos(angle)
>   CALayer *layer = self.view.layer;//view is UIView, self is
subclass of UIViewController
>   [ CATransaction begin];
>   [ CATransaction setAnimationDuration: 9 ];
>   [ layer setAffineTransform: m ];
>   [ CATransaction commit];
>
> The view rotates ok, but does it instantly, instead of taking 9 seconds.
>
> What am I doing wrong?

___

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

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

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

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


How to display tool-tip on demand

2012-08-05 Thread Michael Crawford
Is there a way to display a tool-tip in response to an event?  Currently I'm 
waiting for the default timeout but if the user clicks on a particular cell 
(yes this is an NSTableView), I'd like to display the tool-tip immediately.  
The contents of the NSTableColumn in question are not editable so I don't need 
the mouse click for anything else.

I tried changing the default timeout using the following code but It does not 
work in that I don't observe a change in the tool-tip delay.

[[NSUserDefaults standardUserDefaults] setObject: [NSNumber numberWithInt: 50]
  forKey: @"NSInitialToolTipDelay"];

I really prefer to click to overriding the delay anyhow so I'm not really 
interested in troubleshooting or digging in the failure of changing the default 
setting.

-Michael
___

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

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

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

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


Re: How to display tool-tip on demand

2012-08-05 Thread Jens Alfke

On Aug 5, 2012, at 4:56 PM, Michael Crawford  wrote:

> Is there a way to display a tool-tip in response to an event?  Currently I'm 
> waiting for the default timeout but if the user clicks on a particular cell 
> (yes this is an NSTableView), I'd like to display the tool-tip immediately.  
> The contents of the NSTableColumn in question are not editable so I don't 
> need the mouse click for anything else.

IIRC, no —  I don't think there is public API to make tooltips come up on 
demand.

I had to do some unorthodox stuff to implement tooltips in the Mac version of 
Chrome a few years ago, which I did by copying WebKit's implementation, but 
this uses some internal AppKit methods. I wouldn't recommend you use them. (If 
you're really determined you could look it up in the WebKit sources, but I 
don't remember where the tooltip code 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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Trying to understand [NSFontManager modifyFont:]

2012-08-05 Thread Graham Cox
The documentation for [NSFontManager modifyFont:] doesn't make sense to me. It 
says:



When a responder replies by providing a font to convert in a convertFont: 
message, the receiver converts the font in the manner specified by sender. The 
conversion is determined by sending a tag message to sender and invoking a 
corresponding method:

Sender’s TagMethod Used
NSNoFontChangeActionNone; the font is returned unchanged.
NSViaPanelFontActionThe Font panel’s panelConvertFont:.
NSAddTraitFontActionconvertFont:toHaveTrait:.
NSRemoveTraitFontAction convertFont:toNotHaveTrait:.
NSSizeUpFontAction  convertFont:toSize:.
NSSizeDownFontActionconvertFont:toSize:.
NSHeavierFontAction convertWeight:ofFont:.
NSLighterFontAction convertWeight:ofFont:.



Consider the case of wanting toggle the "bold" trait of a font. I set the 
sender's tag to NSAddTraitFontAction, but how do I specify the bold trait, 
rather than any other trait, e.g. italic? The tag of the sender doesn't have 
enough information to set the traits mask and there is no other place this 
information could be supplied that I can see.

What I'm trying to do is to add a toolbar button that can toggle the traits of 
a font, so it has segments for bold, italic, etc. If I make the button invoke 
[NSFontManager addFontTrait:], then I can turn ON bold, but I can't turn it 
off. In fact, I'm puzzled as to how the standard "Bold" text menu item works, 
because it too simply calls addFontTrait: (according to the action set in IB) 
and has a tag indicating bold. How then does it REMOVE the bold trait? Is the 
Font Manager manipulating the action of the menu item when it validates it? 
Would make sense but I can find no documentation to that effect.

How can I achieve my aim?

--Graham





___

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

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

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

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

Re: How to display tool-tip on demand

2012-08-05 Thread Gary L. Wade
No, I couldn't find a way either, so I just made my own window that mirrored 
the look and feel of a tooltip window. I also needed it to follow a slider's 
thumb, which would have been problematic even in the default implementation. Of 
course, now we have NSPopover windows that could fit your need.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

On Aug 5, 2012, at 4:56 PM, Michael Crawford  wrote:

> Is there a way to display a tool-tip in response to an event?  Currently I'm 
> waiting for the default timeout but if the user clicks on a particular cell 
> (yes this is an NSTableView), I'd like to display the tool-tip immediately.  
> The contents of the NSTableColumn in question are not editable so I don't 
> need the mouse click for anything else.
> 
> I tried changing the default timeout using the following code but It does not 
> work in that I don't observe a change in the tool-tip delay.
> 
> [[NSUserDefaults standardUserDefaults] setObject: [NSNumber numberWithInt: 50]
>  forKey: @"NSInitialToolTipDelay"];
> 
> I really prefer to click to overriding the delay anyhow so I'm not really 
> interested in troubleshooting or digging in the failure of changing the 
> default setting.
> 
> -Michael
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/garywade%40desisoftsystems.com
> 
> This email sent to garyw...@desisoftsystems.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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Trying to understand [NSFontManager modifyFont:]

2012-08-05 Thread Shane Stanley
On 06/08/2012, at 10:46 AM, Graham Cox  wrote:

> I'm puzzled as to how the standard "Bold" text menu item works, because it 
> too simply calls addFontTrait: (according to the action set in IB) and has a 
> tag indicating bold. How then does it REMOVE the bold trait? Is the Font 
> Manager manipulating the action of the menu item when it validates it? Would 
> make sense but I can find no documentation to that effect.

How about this: "If you provide your own Font menu, you should register it with 
the font manager using the setFontMenu: method. The font manager is responsible 
for validating Font menu items and changing their titles and tags according to 
the selected font. For example, when the selected font is Italic, the font 
manager adds a check mark to the Italic Font menu item and changes its tag to 
UnitalicMask. Your Font menu’s items should use the appropriate action methods 
and tags, as shown in Table 6-4." 

Search for "Customizing the Font Conversion System".

-- 
Shane Stanley 
'AppleScriptObjC Explored' 


___

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

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

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

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

Master-detail views and managing next responder sequence

2012-08-05 Thread Erik Stainsby
My current project is built around a master-detail style interface: the primary 
record owns the window content, while subviews display related content from 
various sources. My problem is that the tableViews which display these 
subordinate lists seem to mess up the responder chain's sequence for advancing 
the focus when the user tries to tab through page.  What I would like to 
accomplish is to have the user be able to tab through top-to-bottom without 
noticing there are additional components in the page, as if it were one 
seamless document instead of (in this case) four.  Further complicating this a 
little (I suspect) is that the m-d form is not shown in the window when the 
application launches, but replaces a window subview when called for, 
necessitating that the responder chain sequence be established on-the-fly, at 
runtime.

My first higher-level question then is how I ought to be going about 
establishing the tab-key behaviour sequence I want to achieve?

My thought at the moment is to work out the list of controls I mean to have in 
order, then create outlets for them in the windowController, and as the 
master-detail view is added to the window, set the responder chain sequence in 
code. With the three subviews in this case, tabbing into and out of them in 
turn leaves me with six junction points with the main view. Tedious perhaps but 
manageable. 

Clearly this would not scale well as a solution, which makes me think there 
must be a better way to build a bridge than with matchsticks. 

Any guidance appreciated.

~ Erik
___

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

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

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

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


Re: Trying to understand [NSFontManager modifyFont:]

2012-08-05 Thread Graham Cox

On 06/08/2012, at 11:20 AM, Shane Stanley  wrote:

> On 06/08/2012, at 10:46 AM, Graham Cox  wrote:
> 
>> I'm puzzled as to how the standard "Bold" text menu item works, because it 
>> too simply calls addFontTrait: (according to the action set in IB) and has a 
>> tag indicating bold. How then does it REMOVE the bold trait? Is the Font 
>> Manager manipulating the action of the menu item when it validates it? Would 
>> make sense but I can find no documentation to that effect.
> 
> How about this: "If you provide your own Font menu, you should register it 
> with the font manager using the setFontMenu: method. The font manager is 
> responsible for validating Font menu items and changing their titles and tags 
> according to the selected font. For example, when the selected font is 
> Italic, the font manager adds a check mark to the Italic Font menu item and 
> changes its tag to UnitalicMask. Your Font menu’s items should use the 
> appropriate action methods and tags, as shown in Table 6-4." 
> 
> Search for "Customizing the Font Conversion System".


Thanks, that's useful.

The way this has been implemented seems a bit weird to me, but we'll have to 
live with it. It means adding additional controls (e.g. toolbar buttons) to 
duplicate some of the features of the text menu is difficult, because the text 
menu is being given special treatment by the Font Manager.

I have found a solution that works though it has a strong feeling about it that 
it's a smelly hack. I have my own controller that handles the buttons and 
interacts with the Font Manager and the selected text objects by pretending to 
be the Font Manager in a controlled manner, and implementing things like 
-convertFont: itself. That way it gets a chance to peek at the font traits that 
need to be toggled and can invoke the relevant method (add or remove trait) as 
needed.

If anyone can think of a more elegant solution I'm interested.

--Graham



___

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

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

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

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

Re: Master-detail views and managing next responder sequence

2012-08-05 Thread Graham Cox

On 06/08/2012, at 11:38 AM, Erik Stainsby  wrote:

> My first higher-level question then is how I ought to be going about 
> establishing the tab-key behaviour sequence I want to achieve?



Have you investigated whether -[NSWindow recalculateKeyViewLoop] would do the 
job? I've used this after installing a view in a M-D interface and it works as 
expected. The only difference in my implementation is that the detail views are 
never tables, or ever include tables, but I don't see why that would make much 
difference.

--Graham



___

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

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

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

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


Re: Trying to understand [NSFontManager modifyFont:]

2012-08-05 Thread Shane Stanley
On 06/08/2012, at 11:44 AM, Graham Cox  wrote:

> If anyone can think of a more elegant solution I'm interested.

Does subclassing font manager and overriding setSelectedAttributes:isMultiple: 
get you anywhere?

-- 
Shane Stanley 
'AppleScriptObjC Explored' 


___

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

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

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

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


Re: Master-detail views and managing next responder sequence

2012-08-05 Thread Erik Stainsby
Thanks Graham, that has 90% of my issue addressed.  The system seems to swallow 
a couple of keystrokes entering each table, but at least it does get there. I 
suspect a few judiciously placed refusesFirstRespnder's and I'm home free.

Cheers,
Erik


On 2012-08-05, at 6:47 PM, Graham Cox  wrote:

> 
> On 06/08/2012, at 11:38 AM, Erik Stainsby  wrote:
> 
>> My first higher-level question then is how I ought to be going about 
>> establishing the tab-key behaviour sequence I want to achieve?
> 
> 
> 
> Have you investigated whether -[NSWindow recalculateKeyViewLoop] would do the 
> job? I've used this after installing a view in a M-D interface and it works 
> as expected. The only difference in my implementation is that the detail 
> views are never tables, or ever include tables, but I don't see why that 
> would make much difference.
> 
> --Graham
> 
> 


___

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

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

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

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


Re: How to display tool-tip on demand

2012-08-05 Thread Michael Crawford
NSPopover it is.

-Michael

On Aug 5, 2012, at 8:58 PM, Gary L. Wade wrote:

> No, I couldn't find a way either, so I just made my own window that mirrored 
> the look and feel of a tooltip window. I also needed it to follow a slider's 
> thumb, which would have been problematic even in the default implementation. 
> Of course, now we have NSPopover windows that could fit your need.
> --
> Gary L. Wade (Sent from my iPhone)
> http://www.garywade.com/
> 
> On Aug 5, 2012, at 4:56 PM, Michael Crawford  wrote:
> 
>> Is there a way to display a tool-tip in response to an event?  Currently I'm 
>> waiting for the default timeout but if the user clicks on a particular cell 
>> (yes this is an NSTableView), I'd like to display the tool-tip immediately.  
>> The contents of the NSTableColumn in question are not editable so I don't 
>> need the mouse click for anything else.
>> 
>> I tried changing the default timeout using the following code but It does 
>> not work in that I don't observe a change in the tool-tip delay.
>> 
>> [[NSUserDefaults standardUserDefaults] setObject: [NSNumber numberWithInt: 
>> 50]
>> forKey: @"NSInitialToolTipDelay"];
>> 
>> I really prefer to click to overriding the delay anyhow so I'm not really 
>> interested in troubleshooting or digging in the failure of changing the 
>> default setting.
>> 
>> -Michael
>> ___
>> 
>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>> 
>> Please do not post admin requests or moderator comments to the list.
>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>> 
>> Help/Unsubscribe/Update your Subscription:
>> https://lists.apple.com/mailman/options/cocoa-dev/garywade%40desisoftsystems.com
>> 
>> This email sent to garyw...@desisoftsystems.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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: How to display tool-tip on demand

2012-08-05 Thread Dave DeLong
I saw some hits on Google mentioning NSHelpManager.  I've never used it, but 
you could try poking around in there for stuff.

Dave

On Aug 5, 2012, at 7:23 PM, Michael Crawford  wrote:

> NSPopover it is.
> 
> -Michael
> 
> On Aug 5, 2012, at 8:58 PM, Gary L. Wade wrote:
> 
>> No, I couldn't find a way either, so I just made my own window that mirrored 
>> the look and feel of a tooltip window. I also needed it to follow a slider's 
>> thumb, which would have been problematic even in the default implementation. 
>> Of course, now we have NSPopover windows that could fit your need.
>> --
>> Gary L. Wade (Sent from my iPhone)
>> http://www.garywade.com/
>> 
>> On Aug 5, 2012, at 4:56 PM, Michael Crawford  wrote:
>> 
>>> Is there a way to display a tool-tip in response to an event?  Currently 
>>> I'm waiting for the default timeout but if the user clicks on a particular 
>>> cell (yes this is an NSTableView), I'd like to display the tool-tip 
>>> immediately.  The contents of the NSTableColumn in question are not 
>>> editable so I don't need the mouse click for anything else.
>>> 
>>> I tried changing the default timeout using the following code but It does 
>>> not work in that I don't observe a change in the tool-tip delay.
>>> 
>>> [[NSUserDefaults standardUserDefaults] setObject: [NSNumber numberWithInt: 
>>> 50]
>>>forKey: @"NSInitialToolTipDelay"];
>>> 
>>> I really prefer to click to overriding the delay anyhow so I'm not really 
>>> interested in troubleshooting or digging in the failure of changing the 
>>> default setting.
>>> 
>>> -Michael
>>> ___
>>> 
>>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>>> 
>>> Please do not post admin requests or moderator comments to the list.
>>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>>> 
>>> Help/Unsubscribe/Update your Subscription:
>>> https://lists.apple.com/mailman/options/cocoa-dev/garywade%40desisoftsystems.com
>>> 
>>> This email sent to garyw...@desisoftsystems.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:
> https://lists.apple.com/mailman/options/cocoa-dev/davedelong%40me.com
> 
> This email sent to davedel...@me.com

___

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

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

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

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


makeFirstResponder: and tab views

2012-08-05 Thread Graham Cox
Run into a bug where if I have a number of NSTextFields in a window, and 
programatically switch the first responder of the window among these fields, it 
works fine, but if there is a NSTabView interposed between the fields and the 
window, they just cannot be set to be first responder programatically at all - 
it goes through the motions but it fails silently.

The text field has a blue focus ring, but there is no blinking cursor and 
typing results in a beep. The exact same code, without the tab view, works fine.

The field editor delegate causes the text field focus to shift every 4 
characters:

- (void)controlTextDidChange:(NSNotification *)obj
{
NSTextField* control = [obj object];

NSString* text = [control stringValue];

if([text length] >= 4 )
{
NSString* shortStr = [[text substringToIndex:4] 
uppercaseString];
[control setStringValue:shortStr];

NSResponder* nextField = [control nextKeyView];

NSLog(@"got 4 characters: '%@', moving to field: %@", shortStr, 
nextField );

if([nextField acceptsFirstResponder])
[[self window] makeFirstResponder:nextField];

}

[self conditionallyEnableOK];
}

The 'self' here is the window controller and field editor's delegate.

I also tested to see whether the window returned YES or NO from 
makeFirstResponder: and it always returns YES, indicating success.

Has anyone else run into this? I've seen a few postings in the archives on 
apparently similar topics, and one suggestion is to delay the 
makeFirstResponder using -performSelector:... I have tried that but it doesn't 
work either. Some of these postings go back to 2004 - it's hard to believe such 
a painfully obvious bug would still be unfixed in 10.8

--Graham



___

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

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

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

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


Re: +underPageBackgroundColor

2012-08-05 Thread Graham Cox
I've tried just drawing this colour to a plain view, and I get no texture, just 
a pale "chino" sort of colour. Looking at what I get from this method in the 
debugger:

(NSColor *) $1 = 0x00010983f850 NSCustomColorSpace sRGB IEC61966-2.1 
colorspace 0.980392 0.941176 0.901961 1


This seems to be the colour I'm seeing. I would not really expect it to be in 
the sRGB colorspace, but the real giveaway is this - if I ask this colour for 
its -patternImage, it throws an exception, just as the documentation says it 
will IF IT HAS NO PATTERN IMAGE. Something's gone wrong delivering this colour 
to my app from the internals of Cocoa. But what?


2012-08-06 16:02:17.068 Artboard[22765:303] *** -patternImage not valid for the 
NSColor NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0.980392 0.941176 
0.901961 1; need to first convert colorspace.
2012-08-06 16:02:17.071 Artboard[22765:303] (
0   CoreFoundation  0x7fff882e9716 
__exceptionPreprocess + 198
1   libobjc.A.dylib 0x7fff8bfb5470 
objc_exception_throw + 43
2   CoreFoundation  0x7fff882e94ec 
+[NSException raise:format:] + 204
3   AppKit  0x7fff81b09948 -[NSColor 
patternImage] + 66


My code:

NSColor* bkg = [NSColor underPageBackgroundColor];
NSImage* patImg = [bkg patternImage];



--Graham







On 04/08/2012, at 6:51 PM, Marcus Karlsson  wrote:


> I'm getting the pattern when I use it with -setBackgroundColor: on a
> scrollview. What do you get if you try it on an empty scrollview,
> perhaps in a new project just in case there's something else that
> prevents it from drawing?
> 
> Marcus
> 


___

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

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

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

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