Todays Update:

I added preliminary support for Cocoa Bindings.

Consider this code snippet (self below is an object containing the gui object 
handles):
    
    
    self.win = newWindow("Cocoa Bindings Demo 1", 462, 128, winStyle)
    
    self.chk = newCheckBox(self.win, "Enabled?", 18, 18, 78, 22) #iVar="state"
    self.txt = newTextField(self.win, "", 102, 18, 340, 22)
    self.slider = newSlider(self.win, 18, 48, 428, 19, nil) #iVar="Value"
    
    # Bind TextBox and Slider value
    # Each can update the other
    self.txt.link("value",self.slider,"Value")
    self.slider.link("value", self.slider,"Value")
    
    # Bind Checkbox and Slider state.
    # Checkbox controls enabled/disabled state of Slider!
    self.slider.link("enabled", self.chk,"state")
    
    
    Run

Without having to create any callbacks, this allows me to:

  * Have the Textbox and Slider communicate their values to one another
  * Control the enabled/disabled state of the Slider, based on whether the 
Checkbox is checked or not.



Cocoa Bindings are a really cool feature that can dramatically reduce the 
amount of code one would need to implement functionality.

The 'examples' folder in the repository has 'bindtest.nim', for those who want 
to see this in action.

AIR.

Reply via email to