Re: text field question

2012-02-25 Thread Rick C.
Great thanks everyone I think I got it! :-)

rc



On Feb 25, 2012, at 12:06 AM, Kyle Sluder wrote:

> On Feb 23, 2012, at 5:38 PM, "Rick C."  wrote:
> 
>> Thanks Jan.  What method do you call to make it accept the text?  That's 
>> maybe what I'm looking for...
> 
> As I mentioned before, and is explained in the documentation, you use 
> -[NSWindow makeFirstResponder:] or -[NSObject(NSEditor) commitEditing].
> 
> --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: text field question

2012-02-24 Thread Kyle Sluder
On Feb 23, 2012, at 5:38 PM, "Rick C."  wrote:

> Thanks Jan.  What method do you call to make it accept the text?  That's 
> maybe what I'm looking for...

As I mentioned before, and is explained in the documentation, you use 
-[NSWindow makeFirstResponder:] or -[NSObject(NSEditor) commitEditing].

--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: text field question

2012-02-24 Thread Rick C.
Thanks Jan.  What method do you call to make it accept the text?  That's maybe 
what I'm looking for...



On Feb 23, 2012, at 11:32 PM, Jan E. Schotsman wrote:

> 
> On Feb 23, 2012, at 7:56 AM, Rick C. wrote:
>> 
>> I have a panel with a number of text fields where a user should enter 
>> numeric values.  These text fields are setup with Sent on End Editing so 
>> that if the user presses enter or tabs or changes text fields the value will 
>> be entered.  The problem is sometimes a user just types in a value and 
>> that's it...no enter, no tab, no changing text fields and the value is never 
>> received.  How does everyone else handle this and what can you recommend?
> 
> 
> I have Carbon app that starts a timer whenever typing occurs. After two 
> seconds it accepts the text.
> Not everybody likes it and I suppose you kindof may assume that most users 
> know text entries must be confirmed by pressing enter or return or changing 
> focus.
> 
> 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/rickcorteza%40gmail.com
> 
> This email sent to rickcort...@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: text field question

2012-02-24 Thread Rick C.
Thanks to all for the replies.  In my case there is a certain process that 
takes place (initiated by the user) that will read these values.  Currently if 
the user enters a value but does not click enter or tab, etc. when the process 
starts and I read the text field string it is empty.  In my case I would only 
need to read these values once before the process starts so I wouldn't have to 
worry about the key focus issues...



On Feb 24, 2012, at 6:17 AM, Keary Suska wrote:

> On Feb 22, 2012, at 5:59 PM, Rick C. wrote:
> 
>> I have a panel with a number of text fields where a user should enter 
>> numeric values.  These text fields are setup with Sent on End Editing so 
>> that if the user presses enter or tabs or changes text fields the value will 
>> be entered.  The problem is sometimes a user just types in a value and 
>> that's it...no enter, no tab, no changing text fields and the value is never 
>> received.  How does everyone else handle this and what can you recommend?  
>> Thanks,
> 
> 
> The Interface Builder inspector used to have this issue and it could be 
> really annoying. I would commit any values being entered when the panel loses 
> key focus, via the delegate method -windowDidResignKey: or listening for 
> NSWindowDidResignKeyNotification.
> 
> HTH,
> 
> Keary Suska
> Esoteritech, Inc.
> "Demystifying technology for your home or business"
> 


___

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

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

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

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


Re: text field question

2012-02-24 Thread Keary Suska
On Feb 22, 2012, at 5:59 PM, Rick C. wrote:

> I have a panel with a number of text fields where a user should enter numeric 
> values.  These text fields are setup with Sent on End Editing so that if the 
> user presses enter or tabs or changes text fields the value will be entered.  
> The problem is sometimes a user just types in a value and that's it...no 
> enter, no tab, no changing text fields and the value is never received.  How 
> does everyone else handle this and what can you recommend?  Thanks,


The Interface Builder inspector used to have this issue and it could be really 
annoying. I would commit any values being entered when the panel loses key 
focus, via the delegate method -windowDidResignKey: or listening for 
NSWindowDidResignKeyNotification.

HTH,

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


___

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

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

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

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


Re: text field question

2012-02-23 Thread Michael Babin

On Feb 23, 2012, at 7:24 AM, Michael Babin wrote:

> On Feb 22, 2012, at 6:59 PM, Rick C. wrote:
> 
>> I have a panel with a number of text fields where a user should enter 
>> numeric values.  These text fields are setup with Sent on End Editing so 
>> that if the user presses enter or tabs or changes text fields the value will 
>> be entered.  The problem is sometimes a user just types in a value and 
>> that's it...no enter, no tab, no changing text fields and the value is never 
>> received.  How does everyone else handle this and what can you recommend?  
>> Thanks,
> 
> If you're using bindings, set the Continuously Updates Value flag of the 
> Value binding on your text field.
> 
> If you're not using bindings, implement the controlTextDidChange: method in 
> the text field's delegate (if your text field doesn't have a delegate, set 
> its delegate to the appropriate controller object).

As pointed out by a sharper reader than I, these methods would change the 
behavior of these fields to always updating on each change.

If you're looking for a method that would preserve the behavior of changes only 
sent when exiting the field (tab, enter) or when the window is closed (or 
similar event),
I'd recommend the approach in the TextEdit sample's Preferences class:

https://developer.apple.com/library/mac/#samplecode/TextEdit/Listings/Preferences_m.html

Particularly, the -[Preferences windowShouldClose:] method, where you set the 
window's firstResponder to nil.


___

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: text field question

2012-02-23 Thread Kyle Sluder
On Thu, Feb 23, 2012 at 5:24 AM, Michael Babin  wrote:
>> I have a panel with a number of text fields where a user should enter 
>> numeric values.  These text fields are setup with Sent on End Editing so 
>> that if the user presses enter or tabs or changes text fields the value will 
>> be entered.  The problem is sometimes a user just types in a value and 
>> that's it...no enter, no tab, no changing text fields and the value is never 
>> received.  How does everyone else handle this and what can you recommend?  
>> Thanks,
>
> If you're using bindings, set the Continuously Updates Value flag of the 
> Value binding on your text field.
>
> If you're not using bindings, implement the controlTextDidChange: method in 
> the text field's delegate (if your text field doesn't have a delegate, set 
> its delegate to the appropriate controller object).

Both of these will defeat Rick's desired goal of _not_ having the
values update until the user chooses to.

--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: text field question

2012-02-23 Thread Kyle Sluder
On Feb 22, 2012, at 4:59 PM, "Rick C."  wrote:

> Hi,
> 
> I have a panel with a number of text fields where a user should enter numeric 
> values.  These text fields are setup with Sent on End Editing so that if the 
> user presses enter or tabs or changes text fields the value will be entered.  
> The problem is sometimes a user just types in a value and that's it...no 
> enter, no tab, no changing text fields and the value is never received.  How 
> does everyone else handle this and what can you recommend?  

This is a FAQ, though the specifics of the answer are situation-dependent.

The gist is: send [panel makeFirstResponder:panel] at the appropriate time. Or 
it you're using bindings, send -commitEditing. The "appropriate time" in the 
case of a persistent panel is probably when it's about to lose key window 
status.

If your users want to see the results of their input without having to dismiss 
or leave the panel, they will understand having to press Return to commit 
editing.

--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: text field question

2012-02-23 Thread Jan E. Schotsman


On Feb 23, 2012, at 7:56 AM, Rick C. wrote:


I have a panel with a number of text fields where a user should  
enter numeric values.  These text fields are setup with Sent on End  
Editing so that if the user presses enter or tabs or changes text  
fields the value will be entered.  The problem is sometimes a user  
just types in a value and that's it...no enter, no tab, no changing  
text fields and the value is never received.  How does everyone else  
handle this and what can you recommend?



I have Carbon app that starts a timer whenever typing occurs. After  
two seconds it accepts the text.
Not everybody likes it and I suppose you kindof may assume that most  
users know text entries must be confirmed by pressing enter or return  
or changing focus.


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: text field question

2012-02-23 Thread Michael Babin
On Feb 22, 2012, at 6:59 PM, Rick C. wrote:

> I have a panel with a number of text fields where a user should enter numeric 
> values.  These text fields are setup with Sent on End Editing so that if the 
> user presses enter or tabs or changes text fields the value will be entered.  
> The problem is sometimes a user just types in a value and that's it...no 
> enter, no tab, no changing text fields and the value is never received.  How 
> does everyone else handle this and what can you recommend?  Thanks,

If you're using bindings, set the Continuously Updates Value flag of the Value 
binding on your text field.

If you're not using bindings, implement the controlTextDidChange: method in the 
text field's delegate (if your text field doesn't have a delegate, set its 
delegate to the appropriate controller object).


___

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


text field question

2012-02-23 Thread Rick C.
Hi,

I have a panel with a number of text fields where a user should enter numeric 
values.  These text fields are setup with Sent on End Editing so that if the 
user presses enter or tabs or changes text fields the value will be entered.  
The problem is sometimes a user just types in a value and that's it...no enter, 
no tab, no changing text fields and the value is never received.  How does 
everyone else handle this and what can you recommend?  Thanks,

rc

PS - My apologies if this was duplicated due to the mailing list being offline 
for the past day...
___

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