-Fix: removed 'all' from flags and state of Widget, changing to struct no a union

The code was assuming that bit order was little endian