def rebuild_editor ( self ):
        panel = self.control
        panel.SetSizer( None )
        panel.DestroyChildren()

        cur_value = parse_value( self.value )

        # Create a sizer to manage the radio buttons:
        labels = self.names
        values = self.values
        n      = len( labels )
        cols   = self.factory.cols
        rows   = (n + cols - 1) / cols
        incr   = [ n / cols ] * cols
        rem    = n % cols

        for i in range( cols ):
            incr[i] += (rem > i)
        incr[-1] = -(reduce( lambda x, y: x + y, incr[:-1], 0 ) - 1)

        if cols > 1:
           sizer = wx.GridSizer( 0, cols, 2, 4 )
        else:
           sizer = wx.BoxSizer( wx.VERTICAL )

        # Add the set of all possible choices:
        index = 0
        for i in range( rows ):
            for j in range( cols ):
                if n > 0:
                    label   = labels[ index ]
                    control = wx.CheckBox( panel, -1, label )
                    control.value = value = values[ index ]
                    control.SetValue( value in cur_value )
                    wx.EVT_CHECKBOX( panel, control.GetId(), self.update_object)
                    index += incr[j]
                    n     -= 1
                else:
                    control = wx.CheckBox( panel, -1, '' )
                    control.Show( False )

                sizer.Add( control, 0, wx.NORTH, 5 )

        # Lay out the controls:
        panel.SetSizerAndFit( sizer )

        # FIXME: There are cases where one of the parent panel's of the check
        # list editor has a fixed 'min size' which prevents the check list
        # editor from expanding correctly, so we currently are making sure
        # that all of the parent panels do not have a fixed min size before
        # doing the layout/refresh:
        parent = panel.GetParent()
        while isinstance( parent, wx.Panel ):
            parent.SetMinSize( wx.Size( -1, -1 ) )
            panel  = parent
            parent = parent.GetParent()

        panel.Layout()
        panel.Refresh()

    #---------------------------------------------------------------------------
    #  Handles the user clicking one of the 'custom' check boxes:
    #---------------------------------------------------------------------------
Rebuilds the editor after its definition is modified.
dataset/ETHPy150Open enthought/traitsui/traitsui/wx/check_list_editor.py/CustomEditor.rebuild_editor