Refactor window dimension member and creation.
Rework sample programs.