A flexible structure for user interactions to be used in window frameworks and widgets libraries