'Return a single widget that should be placed in the second tree column.
The widget must be given three attributes:
sigChanged  a signal that is emitted when the widget\'s value is changed
value       a function that returns the value
setValue    a function that sets the value
This is a good function to override in subclasses.'

def makeWidget(self):

    opts = self.param.opts
    t = opts['type']
    if (t in ('int', 'float')):
        defs = {'value': 0, 'min': None, 'max': None, 'step': 1.0, 'dec': False, 'siPrefix': False, 'suffix': '', 'decimals': 3}
        if (t == 'int'):
            defs['int'] = True
            defs['minStep'] = 1.0
        for k in defs:
            if (k in opts):
                defs[k] = opts[k]
        if ('limits' in opts):
            (defs['min'], defs['max']) = opts['limits']
        w = SpinBox()
        w.setOpts(**defs)
        w.sigChanged = w.sigValueChanged
        w.sigChanging = w.sigValueChanging
    elif (t == 'bool'):
        w = QtGui.QCheckBox()
        w.sigChanged = w.toggled
        w.value = w.isChecked
        w.setValue = w.setChecked
        w.setEnabled((not opts.get('readonly', False)))
        self.hideWidget = False
    elif (t == 'str'):
        w = QtGui.QLineEdit()
        w.setStyleSheet('border:    0px')
        w.sigChanged = w.editingFinished
        w.value = (lambda : asUnicode(w.text()))
        w.setValue = (lambda v: w.setText(asUnicode(v)))
        w.sigChanging = w.textChanged
    elif (t == 'color'):
        w = ColorButton()
        w.sigChanged = w.sigColorChanged
        w.sigChanging = w.sigColorChanging
        w.value = w.color
        w.setValue = w.setColor
        self.hideWidget = False
        w.setFlat(True)
        w.setEnabled((not opts.get('readonly', False)))
    elif (t == 'colormap'):
        from ..widgets.GradientWidget import GradientWidget
        w = GradientWidget(orientation='bottom')
        w.sigChanged = w.sigGradientChangeFinished
        w.sigChanging = w.sigGradientChanged
        w.value = w.colorMap
        w.setValue = w.setColorMap
        self.hideWidget = False
    else:
        raise Exception(("Unknown    type    '%s'" % asUnicode(t)))
    return w
