[chimera-dev] binding handlers to SortableTable checkboxes

Eric Pettersen pett at cgl.ucsf.edu
Fri Oct 16 16:16:27 PDT 2015


Hi Jan,
	You don’t say what the data in the table is, but one would normally deal with this by responding to the attribute change in the data rather than intercepting the table trying to set the attribute.  For instance, if your data is an attribute then change it into a property so that you can perform additional actions when the attribute is changed.  Again, I don’t know what your data is or what level of control you have over it, so I’m offering suggestions in the dark here.

—Eric

> On Oct 16, 2015, at 2:55 PM, Jan Kosinski <kosinski at embl.de> wrote:
> 
> Hi again,
> 
> How to attach handlers to checkboxes in the CGLtk SortableTable so the handler is invoked automatically when the checkbox is (un)checked?
> 
> I get it working by subclassing and overriding _widgetCB as below but maybe you have sth more convenient?
> 
> class ComponentSortableTable(SortableTable):
>    def __init__(self,parent,*args,**kwargs):
>        SortableTable.__init__(self,parent,*args,**kwargs)
> 
>    def _widgetCB(self, datum, column, newVal=None):
>        SortableTable._widgetCB(self, datum, column, newVal=newVal)
> 	<my code
> 	if column.title == ‘show’:
>> 	>
> 
> Thanks,
> Jan
> _______________________________________________
> Chimera-dev mailing list
> Chimera-dev at cgl.ucsf.edu
> http://www.rbvi.ucsf.edu/mailman/listinfo/chimera-dev
> 





More information about the Chimera-dev mailing list