Re: Binding an objects "Enabled" to a button in IB

2010-09-06 Thread Markus Müller
Just use an additional NSObjectController. Its default content is a NSMutableDictionary, add a key here, say lockUI, switch "automatically prepares content" to yes and bind your form fields enabled binding to that controllers lockUI-property (should show up in IB). That is a completly valid and

Re: Binding an objects "Enabled" to a button in IB

2010-08-31 Thread Joanna Carter
Hi Mikael > Joanna: do you mean that by applying Jerry's method, we put parts of the > Controller's duty into the View? Essentially, yes. The primary design idea behind MVC is that there should be absolutely no business logic in the View; the View should provide a means of interacting with the

Re: Binding an objects "Enabled" to a button in IB

2010-08-31 Thread Jerry Krinock
On 2010 Aug 31, at 00:34, Joanna Carter wrote: > Eeeuuuwww!!! > > It might work but is it really code as we know it ? ;-) It's definitely not code, Joanna. That's what the poster asked for, though. Poster wanted to know if we could do it "in IB". > Surely, if you already have a controller f

Re: Binding an objects "Enabled" to a button in IB

2010-08-31 Thread cocoa
Hi Jerry and Joanna, Thank you both for your comments on this. Joanna: do you mean that by applying Jerry's method, we put parts of the Controller's duty into the View? /Mikael > Hi Jerry > >>> Le 30 août 2010 à 13:26, co...@wamundson.eu a écrit : >>> Can this binding be done … completely

Re: Binding an objects "Enabled" to a button in IB

2010-08-31 Thread Joanna Carter
Hi Jerry >> Le 30 août 2010 à 13:26, co...@wamundson.eu a écrit : >> >>> Can this binding be done … completely in the nib file (in IB)? > > The answer is yes because the controller Joanna refers to may be an > NSObjectController from the Library in IB. > > Because the "Bind to" popup in Interf

Re: Binding an objects "Enabled" to a button in IB

2010-08-30 Thread Jerry Krinock
On 2010 Aug 30, at 05:42, Joanna Carter wrote: > The usual way to handle this would be to have a simple boolean property on > the controller class… True, but let's answer the poster's question, > Le 30 août 2010 à 13:26, co...@wamundson.eu a écrit : > >> Can this binding be done … completely

Re: Binding an objects "Enabled" to a button in IB

2010-08-30 Thread Joanna Carter
Le 30 août 2010 à 13:26, co...@wamundson.eu a écrit : > Can the following be done completely in the nib file (in IB)? > > I have a form field whos fields are bound to various attributes of an > object (the object Person has attributes as firstName, lastName, etc.). In > my view I would like lock

Binding an objects "Enabled" to a button in IB

2010-08-30 Thread cocoa
Can the following be done completely in the nib file (in IB)? I have a form field whos fields are bound to various attributes of an object (the object Person has attributes as firstName, lastName, etc.). In my view I would like lock these fields, prohibiting them from being changed, i.e. I'd like