Chapter 15.2.2. Connecting and Disconnecting

As mentioned previously, the form of connect we used looks like this: connect(src, signal, func); and is about as simple as it gets. Lucky for us, connect never really gets much harder than that. The full signature is connect(src, signal, dest, func). src can be a string that is the ID of a DOM node, or it can be any object that you want to get a signal from. signal is the name of the signal you’re setting up.

dest is an object that you want to define the slot on. When you use the form of connect with a dest object, func can either be a string with the name of the function on the object or a function object itself. Either way, when the function is called, this will be bound to dest.

The connect ...

Get Rapid Web Applications with TurboGears: Using Python to Create Ajax-Powered Sites now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.