1
0
mirror of https://github.com/cclassic/model-ghdl synced 2024-11-24 08:45:05 +01:00

GUI: Fixed an error where an error message would re-show the simulation time box

This commit is contained in:
Markus Koch 2016-05-08 16:17:11 +02:00
parent a62951aed2
commit 59e3a4855c

8
gui.c
View File

@ -16,8 +16,11 @@ int showMessage(int message_type, char *text, char *defaultText, char **reply) {
GtkWidget *buttonBox;
GtkWidget *mainBox;
GtkWidget *label;
gboolean ret;
char *entryText;
ret = true;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(window), "model-ghdl");
@ -71,17 +74,18 @@ int showMessage(int message_type, char *text, char *defaultText, char **reply) {
if (MESSAGE_IS_INPUT(message_type)) {
entryText = (char*) gtk_entry_get_text(GTK_ENTRY(entry));
if (entryText[0] == 0) {
return false;
ret = false;
}
else {
*reply = realloc(*reply, sizeof(char)*strlen(entryText));
if (*reply != NULL)
strcpy(*reply, entryText);
return true;
ret = true;
}
}
gtk_widget_destroy(window);
return ret;
}
static void okay( GtkWidget *widget,