Linking GUI and logic