Re: return press and edit text

2016-11-30 Thread J.E. Schotsman

> On 30 Nov 2016, at 22:04, Quincey Morris 
>  wrote:
> 
> For #2, you shouldn’t need to use any delegates. Instead, you need to get the 
> text field to commit its edit. There is an informal protocol for this 
> (NSEditor), which text fields conform to.
> 
> The problem is that NSWindowController doesn’t implement the other informal 
> protocol (NSEditorRegistration) that is the way that editors are supposed to 
> be kept track of. The easiest way to get around this is for your OK button 
> action to invoke “commitEditing” on the text field. Alternatively, invoke 
> “commitEditing” from the window delegate's “windowWillClose” method (normally 
> in the window controller).

This is my main (utility) window so it’s never closed and I don’t use a window 
controller either.
Looks like I need to keep track of the active text field myself.
commitEditing sounds better than the insertNewLine trick.
Thanks!

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

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

Re: return press and edit text

2016-11-30 Thread Quincey Morris
On Nov 30, 2016, at 10:41 , J.E. Schotsman  wrote:
> 
> a hit on return acts on both the default button and a text field that is 
> being edited in the same window.
> 
> The text field gets the event first, then the OK button, which is probably 
> what the user wants.

I must admit I don’t remember the sequence of “events” for this case, but the 
above doesn’t sound correct. The text field and the button are in different 
responder chains, so even if the event (i.e. NSEvent) isn’t consumed by one, it 
never gets passed to the other. I assume the default button behavior is 
actually mediated via the window.

In any case …

> If I click on OK instead the text edits are ignored (which is not what I want 
> if the text field contains a setting for a job started by the OK press).
> 
> I can see two solutions:
> 
> 1. Make the OK button inactive while any text field is edited
> 2. Make sure hitting the OK button triggers the end of any text editing first.
> 
> Which is to be preferred?

#1 doesn’t sound right, unless perhaps you really wish the user to press Return 
twice to close the dialog (via the keyboard).

For #2, you shouldn’t need to use any delegates. Instead, you need to get the 
text field to commit its edit. There is an informal protocol for this 
(NSEditor), which text fields conform to.

The problem is that NSWindowController doesn’t implement the other informal 
protocol (NSEditorRegistration) that is the way that editors are supposed to be 
kept track of. The easiest way to get around this is for your OK button action 
to invoke “commitEditing” on the text field. Alternatively, invoke 
“commitEditing” from the window delegate's “windowWillClose” method (normally 
in the window controller).

Strangely, NSViewController *does* implement NSEditor/NSEditorRegistration, so 
if your text field is in a view that has a view controller — the window 
controller’s contentViewController, if this is all coming from a storyboard — 
you can instead issue the “commitEditing” to the view controller, and it will 
commit *all* editors. That’s more convenient if you have multiple text fields, 
and/or you don’t want to have to write code with explicit references to 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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: Where are the gears?

2016-11-30 Thread Gary L. Wade
That is a bummer that Apple has made so many reusable images available for 
macOS but not as many for iOS as the original poster wanted.
--
Gary L. Wade
http://www.garywade.com/ 
> On Nov 30, 2016, at 9:55 AM, Richard Charles  wrote:
> 
> 
>> On Nov 30, 2016, at 1:29 AM, Gerriet M. Denkmann  wrote:
>> 
>> I want a UIBarButtonItem with a picture of gears, being used to mean 
>> “Settings”.
>> This symbol is used by many apps for this function; but I cannot find this 
>> image.
>> 
>> Where is it hiding?
> 
> I use this gear image for a toolbar item in a preference panel.
> 
> [NSImage imageNamed:NSImageNameAdvanced]
> 
> --Richard Charles
> 
___

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

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

return press and edit text

2016-11-30 Thread J.E. Schotsman
Hello,

Today I hit an old problem again: a hit on return acts on both the default 
button and a text field that is being edited in the same window.

The text field gets the event first, then the OK button, which is probably what 
the user wants.
If I click on OK instead the text edits are ignored (which is not what I want 
if the text field contains a setting for a job started by the OK press).

I can see two solutions:

1. Make the OK button inactive while any text field is edited
2. Make sure hitting the OK button triggers the end of any text editing first.

Which is to be preferred?

If I am not mistaken either solution requires a custom delegate.
In the first case all text delegates would set a flag in my interface 
controller indicating that the OK button must be inactive (on in 
textShouldBeginEditing and off in textShouldEndEditing).
In the second case according to the Cocoa Text Architecture Guide I need to 
send the active edit text an insertNewline message. So it’s probably best to 
keep it handy in the interface controller 
(myController.activeEditText:NSTextView? set in textShouldBeginEditing and 
textShouldEndEditing).
Does this sound like a plan?

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

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

Re: Vertically Centered Colon

2016-11-30 Thread Doug Hill

> On Nov 29, 2016, at 11:06 PM, Alex Zavatone  wrote:
> 
> 
> On Nov 30, 2016, at 12:10 AM, Doug Hill wrote:
> 
>> After some trial and error, I figured out how to accomplish the San 
>> Francisco font features described below. I updated my document to include 
>> the code to turn on each feature.
>> 
>> http://breaqz.com/font/AlternateStylisticForms.pdf 
>> 
>> 
>> I should make a sample app or blog post but time doesn’t permit at the 
>> moment. Hope this all helps!
>> 
>> Doug Hill
> 
> This doc might help
> https://developer.apple.com/fonts/TrueType-Reference-Manual/RM09/AppendixF.html
>  
> 

A lot of good stuff there. It appears to be some documentation for what's in 
SFNTLayoutTypes.h which is helpful.
However, all the alternate stylistic forms are still numbered selectors so not 
a lot of new information.

Still hoping Apple will make SF font specific features part of the SDK.

Doug
___

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

Please do not post 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 are the gears?

2016-11-30 Thread Richard Charles

> On Nov 30, 2016, at 1:29 AM, Gerriet M. Denkmann  wrote:
> 
> I want a UIBarButtonItem with a picture of gears, being used to mean 
> “Settings”.
> This symbol is used by many apps for this function; but I cannot find this 
> image.
> 
> Where is it hiding?

I use this gear image for a toolbar item in a preference panel.

[NSImage imageNamed:NSImageNameAdvanced]

--Richard Charles


___

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

Please do not post 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 detect rotation in progress in viewDidLayoutSubview

2016-11-30 Thread David Duncan
Create and use a subview. There is no significant cost to an additional 
content-less view.

--
David Duncan @ My iPhone

> On Nov 30, 2016, at 9:46 AM, Andreas Falkenhahn  
> wrote:
> 
>> On 29.11.2016 at 22:28 David Duncan wrote:
>> 
>> Correct, because the owning UIWindow owns the frame of the view
>> controller’s view, and may change it at any time.
>> The simplest way to fix your specific issue is to just set the
>> contentMode to AspectFit. This will automatically center and scale
>> the content for the current orientation to fit within the given bounds.
> 
> Hmm, I'm afraid that won't work because sometimes I also need the
> UIView to appear at a different fixed location that is not equal
> to the center, e.g. in the top-left or bottom-right corner of
> the UIWindow. Any other ideas?
> 
> -- 
> Best regards,
> Andreas Falkenhahnmailto:andr...@falkenhahn.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: Gestures cause crash in Sierra

2016-11-30 Thread Tom Doan
ITOT any gesture which could be interpreted as the start of a scroll 
generated an immediate constrainBoundsRect call with +inf,+inf as 
the origin (apparently a bug/feature in Sierra). My custom 
NSClipView wasn't set up to handle the invalid coordinates (it 
generally passes back whatever is sent to it) which causes the 
crash. Replacing the origin with 0.0,0.0 fixes the problem, but that 
doesn't help with our existing software. 

> On Nov 23, 2016, at 13:32 , Tom Doan  wrote:
> > 
> > OS Version:Mac OS X 10.12 (16A323)
> 
> I´d suggest you try this on 10.12.1, in case it´s a known problem
> that´s fixed. If not, you should probably go ahead and submit a bug
> report with the exception message and backtrace. In cases like this,
> you´ll often get a "triage" response from Apple within a couple
> of days, telling you what additional information they´d like to see.
> 
> If there´s anything rational to be concluded from the information
> you provided, it´s that the 2- and 3-finger swipe is by default a
> scroll, so is there any chance that your scroll range (content size
> and offset) is excessively large, or messed up in some way that you
> can see?
> 
> 


---
1560 Sherman Ave #1029
Evanston, IL 60201
USA



___

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

Please do not post 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 detect rotation in progress in viewDidLayoutSubview

2016-11-30 Thread Andreas Falkenhahn
On 29.11.2016 at 22:28 David Duncan wrote:

> Correct, because the owning UIWindow owns the frame of the view
> controller’s view, and may change it at any time.
> The simplest way to fix your specific issue is to just set the
> contentMode to AspectFit. This will automatically center and scale
> the content for the current orientation to fit within the given bounds.

Hmm, I'm afraid that won't work because sometimes I also need the
UIView to appear at a different fixed location that is not equal
to the center, e.g. in the top-left or bottom-right corner of
the UIWindow. Any other ideas?

-- 
Best regards,
 Andreas Falkenhahnmailto:andr...@falkenhahn.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 are the gears?

2016-11-30 Thread Gerriet M. Denkmann

> On 30 Nov 2016, at 15:33, Alex Zavatone  wrote:
> 
> I made my own since this has been removed.
> 
> I'll send you a few.  Is Illustrator or PDF or PNG OK?

Pdf or Png would be fine.

Thanks a lot!


Kind regards,

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: Where are the gears?

2016-11-30 Thread Alex Zavatone
I made my own since this has been removed.

I'll send you a few.  Is Illustrator or PDF or PNG OK?



On Nov 30, 2016, at 2:29 AM, Gerriet M. Denkmann wrote:

> I want a UIBarButtonItem with a picture of gears, being used to mean 
> “Settings”.
> This symbol is used by many apps for this function; but I cannot find this 
> image.
> 
> Where is it hiding?
> 
> 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/zav%40mac.com
> 
> This email sent to z...@mac.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

Where are the gears?

2016-11-30 Thread Gerriet M. Denkmann
I want a UIBarButtonItem with a picture of gears, being used to mean “Settings”.
This symbol is used by many apps for this function; but I cannot find this 
image.

Where is it hiding?

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