the first step in writing a successful GUI library

Is this..

mygui_init (void) {
    if (! connect_to_display()) {
        fprintf(stderr, "Cannot connect to display. You lose.\n");
        exit(1); /* no way to recover from this horrible state */
    }
}

Well, it worked for both GTK and Qt..