'Modify or inquire widget state.
Widget state is returned if statespec is None, otherwise it is
set according to the statespec flags and then a new state spec
is returned indicating which flags were changed. statespec is
expected to be a sequence.'

def state(self, statespec=None):

    if (statespec is not None):
        statespec = '    '.join(statespec)
    return self.tk.splitlist(str(self.tk.call(self._w, 'state', statespec)))
