Part of pida.utils.rat.sensitive View In Hierarchy
The L{SignalBind} helps you connect a signal from a widget that will affect the sensitive state of your target widget. For example if we want a button the be sensitive only when a text entry has some text in it we do the following:: btn = gtk.Button() cnt = rat.sensitive.SensitiveController(btn) entry = gtk.Entry() sig_bind = rat.sensitive.SignalBind(cnt) sig_bind.bind(entry, "text", "changed", lambda txt: len(txt) > 0) Summing it up, the L{SignalBind} connects a property and a signal of a certain widget to a controller. Reference counting is thought of, this means that if the L{SignalBind} has not references back to it it will call the L{SignalBind.unbind} method.
Line # | Kind | Name | Docs |
---|---|---|---|
135 | Class | _Callback | The callback object is used to remove circular dependencies. |
150 | Method | __init__ | Undocumented |
155 | Method | bind | Connects the affecter through a certain signal to the sensitive binder. |
174 | Method | unbind | Calling the unbind method will remove the L{SensitiveController} |
188 | Method | __del__ | Undocumented |
Connects the affecter through a certain signal to the sensitive binder. @param affecter: the widget that has a certain property, which will be triggered by a certain signal. @param property: the property which will be evaluated by the condition when the signal is called @param signal: the signal that is triggered when the property is changed @param condition: the condition is a function that accepts one value which is the property's value.