Fix error in console when resizing window. Use new syntax for connecting to events on a widget.