Re: How to specify Volume to NSURLSession ?

2015-09-29 Thread Mike Abdullah

> On 29 Sep 2015, at 07:02, Gerriet M. Denkmann  wrote:
> 
> When I download a file using NSURLSession downloadTaskWithRequest the file 
> ends up in exactly the wrong volume.
> Which means: I have to copy it to the right one, which, for really big files, 
> can take some non-trivial time.
> 
> Is it possible to advise NSURLSession which volume to use?

To my knowledge, it’s not possible, and would make an excellent feature request.

I think you would implement something similar yourself at present by using a 
streamed task, and writing the data to disk yourself.


___

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

Please do not post 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 specify Volume to NSURLSession ?

2015-09-29 Thread Gerriet M. Denkmann
When I download a file using NSURLSession downloadTaskWithRequest the file ends 
up in exactly the wrong volume.
Which means: I have to copy it to the right one, which, for really big files, 
can take some non-trivial time.

Is it possible to advise NSURLSession which volume to use?

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: First responder not coming back to container after editing with NSTextField

2015-09-29 Thread dangerwillrobinsondanger
So at that event or at the beginning of it resign first responder and manually 
set the next responder. 
You may need some logic to decide what is the next responder. 
You may also need to ask the window to recalculate the next responder chain in 
it. 

Sent from my iPhone

> On Sep 29, 2015, at 7:47 PM, Eyal Redler  wrote:
> 
> I have a custom NSView subclass (let's call it "container"). The view 
> contains many subviews and the subviews can have two states: expanded and 
> collapsed.
> When one of the subviews is expanded, it reveals an editable text field, when 
> the subview is collapsed, the field is removed.
> The container needs to also to be able to handle keystrokes (arrow keys) and 
> for that purpose it access first responder implements keyDown.
> The reason I'm handling arrow keys in the container is that there is a 
> concept of "selection" in that view and I want to allow the user to modify 
> the selection using the arrow keys (similar to what you would do with a table 
> view)
> My problem is as follows:
> If I click one of the container subviews - the container will become first 
> responder and the keyboard is handled correctly.
> If, after that, I expand one of the subviews and start editing the text, the 
> text field will grab keyboard handing (which is OK and expected) but, when I 
> collapse that subview, and the editable text field is removed, keyboard focus 
> doesn't come back to the container and no amount of clicking around the other 
> subview of the container will restore that ability. It is as if having edited 
> the text field "Destroyed" the ability of the container to get keyboard focus.
> 
> Thanks in advance 
> 
> 
> 
> Eyal Redler
> 
> "If Uri Geller bends spoons with divine powers, then he's doing it the hard 
> way."
> --James Randi
> www.eyalredler.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/dangerwillrobinsondanger%40gmail.com
> 
> This email sent to dangerwillrobinsondan...@gmail.com

___

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

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

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

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

Re: How to specify Volume to NSURLSession ?

2015-09-29 Thread dangerwillrobinsondanger
That is to say use the data task delegate methods to receive data and write it 
where you want it?

Sent from my iPhone

> On Sep 29, 2015, at 5:39 PM, Mike Abdullah  wrote:
> 
> 
>> On 29 Sep 2015, at 07:02, Gerriet M. Denkmann  wrote:
>> 
>> When I download a file using NSURLSession downloadTaskWithRequest the file 
>> ends up in exactly the wrong volume.
>> Which means: I have to copy it to the right one, which, for really big 
>> files, can take some non-trivial time.
>> 
>> Is it possible to advise NSURLSession which volume to use?
> 
> To my knowledge, it’s not possible, and would make an excellent feature 
> request.
> 
> I think you would implement something similar yourself at present by using a 
> streamed task, and writing the data to disk yourself.
> 
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post 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/dangerwillrobinsondanger%40gmail.com
> 
> This email sent to dangerwillrobinsondan...@gmail.com

___

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

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

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

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

Re: How to specify Volume to NSURLSession ?

2015-09-29 Thread Mike Abdullah

> On 29 Sep 2015, at 10:25, dangerwillrobinsondan...@gmail.com wrote:
> 
> That is to say use the data task delegate methods to receive data and write 
> it where you want it?

Yep, fire up a data task (with delegate, not completion handler). Use 
-URLSession:dataTask:didReceiveResponse:completionHandler: to open up a stream 
or similar somewhere suitable on disk, and write to it in 
-URLSession:dataTask:didReceiveData:
___

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

Please do not post 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

First responder not coming back to container after editing with NSTextField

2015-09-29 Thread Eyal Redler
I have a custom NSView subclass (let's call it "container"). The view contains 
many subviews and the subviews can have two states: expanded and collapsed.
When one of the subviews is expanded, it reveals an editable text field, when 
the subview is collapsed, the field is removed.
The container needs to also to be able to handle keystrokes (arrow keys) and 
for that purpose it access first responder implements keyDown.
The reason I'm handling arrow keys in the container is that there is a concept 
of "selection" in that view and I want to allow the user to modify the 
selection using the arrow keys (similar to what you would do with a table view)
My problem is as follows:
If I click one of the container subviews - the container will become first 
responder and the keyboard is handled correctly.
If, after that, I expand one of the subviews and start editing the text, the 
text field will grab keyboard handing (which is OK and expected) but, when I 
collapse that subview, and the editable text field is removed, keyboard focus 
doesn't come back to the container and no amount of clicking around the other 
subview of the container will restore that ability. It is as if having edited 
the text field "Destroyed" the ability of the container to get keyboard focus.

Thanks in advance 



Eyal Redler

"If Uri Geller bends spoons with divine powers, then he's doing it the hard 
way."
--James Randi
www.eyalredler.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: Where did NSSession put my file ?

2015-09-29 Thread Jens Alfke

> On Sep 28, 2015, at 9:54 PM, Gerriet M. Denkmann  wrote:
> 
> NSURLSessionDelegate and NSURLSessionTaskDelegate methods get called (as 
> expected) but none of the NSURLSessionDownloadDelegate methods ever get 
> called.

Your NSURLSessionDataDelegate should be getting called, with data coming from 
this call:
- (void)URLSession:(NSURLSession *)session 
dataTask:(NSURLSessionDataTask *)dataTask
 didReceiveData:(NSData *)data;

If you want to literally download to a file, you need to call one of the 
-downloadTaskWith… methods on the NSURLSession.

—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

Debug Pref Pane with System Integrity Protection

2015-09-29 Thread Trygve Inda
One of my projects is a System Preference Pane. With 10.11, Xcode's debugger
can't debug it as I get a "can't attach to System Preferences because of
System Integrity Protection".

How can I debug my prefpane under 10.11, as I have done in every OS back to
10.3?



___

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

Please do not post 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

Can't get dynamically sized Collection View cells

2015-09-29 Thread Doug Hill
I’m trying to implement a collection with dynamically sized cells. The WWDC  
session from 2014 “What’s New in Table and Collection Views” talks about how to 
do this by:
• Use autolayout constraints to set the height of the cell based on the content 
size of the subviews.
• Set the estimatedItemSize property of the flow layout object to get the 
scrollbars to be in close the correct location.

This doesn’t seem to work as I see the following log message:

the behavior of the UICollectionViewFlowLayout is not defined because:
the item width must be less than the width of the UICollectionView minus the 
section insets left and right values, minus the content insets left and right 
values.
Please check the values return by the delegate.
The relevant UICollectionViewFlowLayout instance is 
, and it is attached to 
; layer = 
; contentOffset: {0, 0}; contentSize: {205, 66}> 
collection view layout: .
2015-09-29 14:48:29.255 Chartcube[65578:3340001] Make a symbolic breakpoint at 
UICollectionViewFlowLayoutBreakForInvalidSizes to catch this in the debugger.

also
the behavior of the UICollectionViewFlowLayout is not defined because:
the item width must be less than the width of the UICollectionView minus the 
section insets left and right values.
Please check the values return by the delegate.

FWIW I don’t set any other properties of the flow layout.

Doing a Google search leads me to the following page:

http://corsarus.com/2015/collection-view-with-self-sizing-cells/

which discusses this error message and how to add another constraint at runtime 
to fix it. It sets a fixed width constraint of the cell content view. This 
“solution” appears to be a bit of a hack since they did some trial and error to 
figure out how to set it so that it would make things work. This leads me to 
believe there’s something else going on. Also, it would be great to know why I 
get the error in the first place. Maybe there’s some other setting in the flow 
layout that needs to be made?

Can someone comment on how to implement dynamically-sized collection view cells 
correctly? Unfortunately, the WWDC session doesn’t go into detail on how they 
got their collection view to autoresize the cells and there’s isn’t any sample 
code for the project described in the video. It would be great to know the 
“approved” way to implement this behavior.

Thanks!

Doug Hill

___

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

Please do not post 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: questions on WebView for Mac apps

2015-09-29 Thread Jens Alfke

> On Sep 29, 2015, at 8:15 PM, Roland King  wrote:
> 
> is WebView the go-to guy these days or is it WKWebView, which comes with all 
> the things you love about the Safari browsing experience built-in? That seems 
> pretty easy to use. There was a WWDC video on it if I remember correctly. 

WKWebView looks easier to use, but extremely limited. I was pretty disappointed 
by the API. It doesn’t look useable for much more than just showing regular web 
pages (as opposed to building hybrid apps that use HTML for part of their 
rendering.) Last I saw, the PhoneGap people were still scratching their heads 
trying to figure out how to use it, since it doesn’t even work with 
NSURLProtocols.

(I’m working on a Mac app that uses WebView for much of its UI, and was hoping 
I could use WKWebView to port it to iOS, but no dice. My app relies heavily on 
manipulating the DOM from Objective-C.)

—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

Re: Can't get dynamically sized Collection View cells

2015-09-29 Thread Peter Tomaselli
Hi Doug! Funny you mention this, I was trying and failing to do the same thing 
just tonight. 

Thing is, I’ve done it before and have a toy implementation on GitHub[0] to 
prove it! Not that that was helping me just now, of course, but perhaps a link 
to that repo can help you out?

There are additional layers of complication in the linked project because 1. 
the labels inside the cells are themselves line-wrapping if necessary, so it’s 
quite “inside-out” as far as layout goes, and 2. the flow layout is 
“left-justified” instead of “fully-justified”, so be sure to ignore those 
aspects of the code if you do end up peeking.

Anyway, to be brutally honest I can’t for the life of me remember which of the 
methods and/or properties in this old project are critical for getting your 
scenario to work, and which are related solely to mine, but perhaps it’s a 
decent starting point anyway.

IIRC there also was a gotcha here wherein setting up your cell in IB basically 
meant you were SOL as far getting everything to work went (something about 
subviews not being embedded in the contentView properly?), but I could be wrong 
about that. 

Anyway a truly flowy layout is one of the things I most desire so if you gain 
any insights more, or if anyone else can chime in with better advice, I am very 
interested too.

— Peter

[0] https://github.com/Peterbing/CV-AutoLayout

> On Sep 29, 2015, at 6:29 PM, Doug Hill  wrote:
> 
> I’m trying to implement a collection with dynamically sized cells. The WWDC  
> session from 2014 “What’s New in Table and Collection Views” talks about how 
> to do this by:
> • Use autolayout constraints to set the height of the cell based on the 
> content size of the subviews.
> • Set the estimatedItemSize property of the flow layout object to get the 
> scrollbars to be in close the correct location.
> 
> This doesn’t seem to work as I see the following log message:
> 
> the behavior of the UICollectionViewFlowLayout is not defined because:
> the item width must be less than the width of the UICollectionView minus the 
> section insets left and right values, minus the content insets left and right 
> values.
> Please check the values return by the delegate.
> The relevant UICollectionViewFlowLayout instance is 
> , and it is attached to 
>  autoresize = RM+BM; gestureRecognizers = ; layer = 
> ; contentOffset: {0, 0}; contentSize: {205, 66}> 
> collection view layout: .
> 2015-09-29 14:48:29.255 Chartcube[65578:3340001] Make a symbolic breakpoint 
> at UICollectionViewFlowLayoutBreakForInvalidSizes to catch this in the 
> debugger.
> 
> also
> the behavior of the UICollectionViewFlowLayout is not defined because:
> the item width must be less than the width of the UICollectionView minus the 
> section insets left and right values.
> Please check the values return by the delegate.
> 
> FWIW I don’t set any other properties of the flow layout.
> 
> Doing a Google search leads me to the following page:
> 
> http://corsarus.com/2015/collection-view-with-self-sizing-cells/
> 
> which discusses this error message and how to add another constraint at 
> runtime to fix it. It sets a fixed width constraint of the cell content view. 
> This “solution” appears to be a bit of a hack since they did some trial and 
> error to figure out how to set it so that it would make things work. This 
> leads me to believe there’s something else going on. Also, it would be great 
> to know why I get the error in the first place. Maybe there’s some other 
> setting in the flow layout that needs to be made?
> 
> Can someone comment on how to implement dynamically-sized collection view 
> cells correctly? Unfortunately, the WWDC session doesn’t go into detail on 
> how they got their collection view to autoresize the cells and there’s isn’t 
> any sample code for the project described in the video. It would be great to 
> know the “approved” way to implement this behavior.
> 
> Thanks!
> 
> Doug Hill
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post 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/vast.grapes%40gmail.com
> 
> This email sent to vast.gra...@gmail.com


___

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

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

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

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

Re: questions on WebView for Mac apps

2015-09-29 Thread Jens Alfke

> On Sep 29, 2015, at 7:03 PM, Alex Hall  wrote:
> 
> 1. What class do I want to use when making an outlet for my web view UI 
> element?

Don’t use a custom object. There should be a WebView item in the Interface 
Builder object palette already.

> but "WebView" gives me an error: "use of undeclared type 'WebView’".

WebView is in the WebKit framework. To tell the compiler to look in that 
framework, you need to add
@import WebKit
or
#import 

> 2. The class reference makes this looks very complex, and rightly so. Since I 
> don't have an outlet yet I can't test anything, but is this what I'd do to 
> take a known URL and display the page it points to:
> myWebView.mainFrame.loadRequest(someURLRequestObject)

Have you read the WebKit Programming Guide? The “Simple Browsing” section shows 
exactly how to do that. (It looks like your line is correct.)

> 3. Is there any easy way to tell if a URL ends in a webpage or a file?

There’s not really a clear distinction. WebKit just fetches resources over 
HTTP, and depending on the resource’s attributes like Content-Type and 
Content-Disposition it will treat it differently. I don’t think WebView by 
itself will download anything to disk; IIRC you have to hook up some delegates 
to do that.

—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

Re: questions on WebView for Mac apps

2015-09-29 Thread dangerwillrobinsondanger
The lack of native DOM API is the head scratcher at first. 
It leaves you with a message passing API to use  the JSContext Objective-C 
JavaScript API. 
Then you realize it's a performance and security thing and it's pretty much the 
same as the Safari Extensions API . Web views in WKWebView are actually a 
separate process pool you don't own. 
So you can translate the DOM stuff back to JavaScript DOM stuff 

Alternatively you could try delving in to WebKit source code to redeclare 
private classes and methods but it's a big code base. And the message passing 
probably translates to XPC at some level. 


Sent from my iPhone

> On Sep 30, 2015, at 12:28 PM, Jens Alfke  wrote:
> 
> 
>> On Sep 29, 2015, at 8:15 PM, Roland King  wrote:
>> 
>> is WebView the go-to guy these days or is it WKWebView, which comes with all 
>> the things you love about the Safari browsing experience built-in? That 
>> seems pretty easy to use. There was a WWDC video on it if I remember 
>> correctly.
> 
> WKWebView looks easier to use, but extremely limited. I was pretty 
> disappointed by the API. It doesn’t look useable for much more than just 
> showing regular web pages (as opposed to building hybrid apps that use HTML 
> for part of their rendering.) Last I saw, the PhoneGap people were still 
> scratching their heads trying to figure out how to use it, since it doesn’t 
> even work with NSURLProtocols.
> 
> (I’m working on a Mac app that uses WebView for much of its UI, and was 
> hoping I could use WKWebView to port it to iOS, but no dice. My app relies 
> heavily on manipulating the DOM from Objective-C.)
> 
> ―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/dangerwillrobinsondanger%40gmail.com
> 
> This email sent to dangerwillrobinsondan...@gmail.com

___

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

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

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

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

questions on WebView for Mac apps

2015-09-29 Thread Alex Hall
Hello all,
My project is coming along. I'm now to the point where I want to load data from 
a URL into a WebView, but there's surprisingly little (read: next to nothing) 
about doing this in an app on the Mac. That or I'm googling the wrong terms. 
Anyway, what I'm running into are the following:

1. What class do I want to use when making an outlet for my web view UI 
element? I found the class reference:
https://developer.apple.com/library/mac/documentation/Cocoa/Reference/WebKit/Classes/WebView_Class/index.html#//apple_ref/occ/instm/WebView
but "WebView" gives me an error: "use of undeclared type 'WebView'".

2. The class reference makes this looks very complex, and rightly so. Since I 
don't have an outlet yet I can't test anything, but is this what I'd do to take 
a known URL and display the page it points to:
myWebView.mainFrame.loadRequest(someURLRequestObject)
or is there more to it from the outset? I'll eventually use delegates to handle 
progress, errors, and so on, but I want the basics working first.

3. Is there any easy way to tell if a URL ends in a webpage or a file? For 
example, I want to auto-display content from a selected URL, but I don't 
necessarily want to auto-download (potentially huge) files. If I use a download 
delegate, can I handle this behavior there instead of worrying about trying to 
figure things out at the request level?

4. Back to WebView, or whatever it winds up being called. This is a bit off the 
topic, but are there any auto layout gotchas I should know? I've read a lot 
about how terrible scroll views with auto layout can be, and I just want to 
know if a similar thing will happen with this view too.

I think that's it. Thanks, as always, for your help!

--
Have a great day,
Alex Hall
mehg...@icloud.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: questions on WebView for Mac apps

2015-09-29 Thread Roland King

> On 30 Sep 2015, at 10:03, Alex Hall  wrote:
> 
> Hello all,
> My project is coming along. I'm now to the point where I want to load data 
> from a URL into a WebView, but there's surprisingly little (read: next to 
> nothing) about doing this in an app on the Mac. That or I'm googling the 
> wrong terms. Anyway, what I'm running into are the following:
> 
> —

is WebView the go-to guy these days or is it WKWebView, which comes with all 
the things you love about the Safari browsing experience built-in? That seems 
pretty easy to use. There was a WWDC video on it if I remember correctly. 
___

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

Please do not post 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

NSColorPanel and close box

2015-09-29 Thread Matthias Schmidt
Hello,

it’s been a while :-)
I started to rewrite a Plugin from Carbon to Cocoa and I have some trouble with 
the NSColorPane.
The colorPane opens, I can choose any color, change the mode etc, but I can 
close it only with the ESC key.
None of the boxes in the title bar react on a click.
Neither the close box (that’s the one I need) nor the resize box.
A double click in the title bar is resizing the box.
So to see what’s going on I did this:

[ panel setDelegate: sender];

and then:
-(BOOL)respondsToSelector:(SEL)aSelector
{
NSString *methodName = NSStringFromSelector(aSelector);
NSLog(@"antwortet auf Selector: %@", methodName);
return [super respondsToSelector:aSelector];
}

and I get all kind of responses, but none, when I click on one of the buttons 
in the title bar.

I also tried this:
NSButton *closeButton = [[ NSColorPanel sharedColorPanel] 
standardWindowButton:NSWindowCloseButton];
[closeButton setTarget:self];
 [closeButton setAction:@selector(closePanel:)];

but it doesn’t do anything :(

When I press the ESC-key the close buttons nevertheless blinks shortly and then 
windowWillClose gets fired.

I believe I miss something here …

thanks for any hint
Matthias



___

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

Please do not post 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: NSColorPanel and close box

2015-09-29 Thread Jens Alfke
What’s the host app? It sounds like something’s going wrong with event 
dispatching. Or, you’re not using a modal runloop mode, are you?

—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