Article Preview
Buy Now
| Print: | |
| PDF: |
Feature
Control Binding in REALbasic
Build User Interfaces Without Writing (Much) Code
Issue: 1.6 (June/July 2003)
Author: Charles Yeomans
Author Bio: Charles Yeomans is a REALbasic developer in Lexington, Kentucky. In his spare time, he practices aikido, where he gets to hit C++ developers.
Article Description: No description available.
Article Length (in bytes): 30,277
Starting Page Number: 17
RBD Number: 1611
Resource File(s):
1611.sit Updated: Friday, October 17, 2003 at 12:21 PM
Related Link(s): None
Known Limitations: None
Excerpt of article text...
Control binding is a visual programming mechanism in which you can make controls communicate by simply wiring them together, with no code needed. REALbasic has many predefined bindings, and allows developers to define their own bindings. Unfortunately, control binding is very nearly undocumented by REAL Software; as a consequence, it goes unused by the majority of RB developers. This article aims to fill the documentation gap and encourage developers to bind.
Using RB's Built-in Control Bindings
A Warmup Example
Let's get a feel for what one can do with a control binding by way of a simple example. Create a new REALbasic project. In Window1, add a Listbox control and a Pushbutton control. In the Open event handler of Listbox1, add a few rows.
Sub Open
me.AddRow "Row 0"
me.AddRow "Row 1"
End Sub
Now, while holding down the Shift and Command keys, click on the listbox and drag the mouse to the push button. Observe that the push button becomes highlighted. This tells you that there is a control binding defined between Listbox and PushButton objects. Release the mouse button while the mouse is over the push button. The New Binding dialog that appears (see Figure 1) lists all of the control bindings defined between Listbox and PushButton. The one binding listed causes the push button to be active if and only if the listbox has a selected row. Select that binding, and click "OK". Window1 will now show a line connecting the listbox and the push button (see Figure 2). You can select the binding by carefully clicking on the line; once it is selected, the binding information is given in the Properties window.
...End of Excerpt. Please purchase the magazine to read the full article.
Article copyrighted by REALbasic Developer magazine. All rights reserved.
|








