/* Put the complete text file into a text page.  */
static void text_page_set_text(GtkWidget *page, const char *absolute_path)
/* Put the complete text file into a text page.  */
static void text_page_set_text(GtkWidget *page, const char *absolute_path)
{
    FILE *text_file;
    char line[4096+1];
    text_file = ws_fopen(absolute_path, "r");
    if (text_file != NULL) {
        while (fgets(line, sizeof line, text_file) != NULL) {
            text_page_insert(page, line, (int) strlen(line));
        }
        if(ferror(text_file)) {
            simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Error reading file \"%s\": %s",
                          absolute_path, g_strerror(errno));
        }
        fclose(text_file);
    } else {
        simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Could not open file \"%s\": %s",
                      absolute_path, g_strerror(errno));
    }
}