void create_windows(const char *host_tag, int instance_count) { char tag[64]; /* build a nice identifier string for the window titles */ if (strlen(host_tag) == 0) { strcpy(tag, host_name_default); } else if (strstr(host_tag, host_name_default)) { if (strlen(host_tag) > 63) { snprintf(tag, 64, "...%s", host_tag + strlen(host_tag) - 60); /* hope the unique info is at the end */ } else { strcpy(tag, host_tag); } } else { if (strlen(host_name_default) + strlen(host_tag) > 62) { snprintf(tag, 64, "%s ...%s", host_name_default, host_tag + strlen(host_tag) + strlen(host_name_default) - 59); } else { snprintf(tag, 64, "%s %s", host_name_default, host_tag); } } create_main_window(tag, instance_count); create_ui_context_menu(main_window); create_file_selection(tag); create_about_window(tag); create_notice_window(tag); }
/* +-----------------------------------+ * | Help Menu Related Functions | * +-----------------------------------+ */ void on_menu_help_about_activate (GtkMenuItem *menuitem, gpointer user_data) { static char buf[1024]; GtkWidget *label; if (!about_window) { about_window = create_about_window(); // set version in window snprintf(buf, 1023, _("GOPchop %s (%s)"), VERSION, __DATE__); label = GTK_WIDGET(lookup_widget(GTK_WIDGET(about_window), "about_label_version")); gtk_label_set_text(GTK_LABEL(label), buf); label = GTK_WIDGET(lookup_widget(GTK_WIDGET(about_window), "about_label_cvsid")); gtk_label_set_text(GTK_LABEL(label), GOPchop_cvsid); } gtk_widget_show(about_window); }
void cb_about_window(GtkCheckMenuItem *checkmenuitem, gpointer dat) { create_about_window(); }