• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Button enabled.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Button enabled.


  • Subject: Re: Button enabled.
  • From: Apparao <email@hidden>
  • Date: Tue, 16 Oct 2007 12:19:50 +0530

Any idea for pt 1 below(if just need to bind the NSButton enable
property to TextField,
to be enabled only iff atleast single character in textfield else disabled)?


Implement a method in your(nib) controller class, which will return bool value, based on the characters availability in the text field.

Set the NSButton enabled properties as below:

1. Select the Bind check box
2. Select your controller from the Bind to: pop up
3. Mention your bool method name in the model key path

I didn't try this. hope it will work.

- Apparao.

On Oct 16, 2007, at 11:40 AM, Michael Flack wrote:

Thanks for the pointer.
Any idea for pt 1 below(if just need to bind the NSButton enable
property to TextField,
to be enabled only iff atleast single character in textfield else disabled)?


On 10/15/07, Apparao <email@hidden> wrote:
Use Custom data formatters. Read the information available at the
following URL:

http://developer.apple.com/documentation/Cocoa/Conceptual/
DataFormatting/index.html?http://developer.apple.com/documentation/
Cocoa/Conceptual/DataFormatting/Articles/ CreatingACustomFormatter.html




On Oct 16, 2007, at 11:10 AM, Michael Flack wrote:

Hi All,
I tried and searched the list extensively for something which seems
simple but doesnt seem to work for me.
My nib has a simple textbox and a button,
1) I want to bind my button to be enabled only iff their is sometext
typed into the textbox
2) Ideally I want as soon as I start typing into textbox it should
call a validate method and replace the value of the allowed value.

So say input to Textbox is "123abc" and only "abc" is valid:-
1) Button enables as soon as something is typed into textbox
2) As you type 123 nothing appear only abc ie the valid input appear
in the textbox.

*Want to achieve this through bindings, not the textbox callbacks.

TIA,
MiƧ
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
40effigent.net

This email sent to email@hidden





_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
This email sent to email@hidden


References: 
 >Button enabled. (From: "Michael Flack" <email@hidden>)
 >Re: Button enabled. (From: Apparao <email@hidden>)
 >Re: Button enabled. (From: "Michael Flack" <email@hidden>)

  • Prev by Date: Re: Button enabled.
  • Next by Date: Re: Memory leaks with NSAppleScript
  • Previous by thread: Re: Button enabled.
  • Next by thread: Kludges when binding to 'value' of Menu Items
  • Index(es):
    • Date
    • Thread