The requirement to call send_creation_events from outside the constructor makes the presence of a helper function convenient. Rename ui_create_dialog to window_create, and move it to window.h.