mirror of
https://github.com/cclassic/model-ghdl
synced 2024-11-29 09:13:28 +01:00
GUI: Fixed an error where an error message would re-show the simulation time box
This commit is contained in:
parent
a62951aed2
commit
59e3a4855c
8
gui.c
8
gui.c
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user