Create a selector of the specified type. Also attaches the function `func` as an `on_trait_change` listener for the trait `trait` of the selector. This is an internal function which should not be called by the user. Parameters ---------- int_type: type The type of
(int_type, func, trait, **kwargs)
| 1086 | |
| 1087 | |
| 1088 | def _create_selector(int_type, func, trait, **kwargs): |
| 1089 | """Create a selector of the specified type. |
| 1090 | |
| 1091 | Also attaches the function `func` as an `on_trait_change` listener |
| 1092 | for the trait `trait` of the selector. |
| 1093 | |
| 1094 | This is an internal function which should not be called by the user. |
| 1095 | |
| 1096 | Parameters |
| 1097 | ---------- |
| 1098 | |
| 1099 | int_type: type |
| 1100 | The type of selector to be added. |
| 1101 | func: function |
| 1102 | The call back function. It should take at least two arguments. The name |
| 1103 | of the trait and the value of the trait are passed as arguments. |
| 1104 | trait: string |
| 1105 | The name of the Selector trait whose change triggers the |
| 1106 | call back function `func`. |
| 1107 | """ |
| 1108 | interaction = _add_interaction(int_type, **kwargs) |
| 1109 | if func is not None: |
| 1110 | interaction.on_trait_change(func, trait) |
| 1111 | return interaction |
| 1112 | |
| 1113 | |
| 1114 | def brush_int_selector(func=None, trait='selected', **kwargs): |
no test coverage detected
searching dependent graphs…