From: fliep Date: Thu, 3 Dec 2009 21:00:31 +0000 (+0000) Subject: Improved Glulxercise test program X-Git-Tag: v0.9~268 X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=a21860936ec6781b90faf729569d3b0aac4bf471;p=projects%2Fchimara%2Fchimara.git Improved Glulxercise test program --- diff --git a/tests/glulxercise.c b/tests/glulxercise.c index 6d4b21f..a389d89 100644 --- a/tests/glulxercise.c +++ b/tests/glulxercise.c @@ -9,13 +9,6 @@ typedef struct { GtkWidget *window, *test_picker, *go, *stop, *interp; } Widgets; -gboolean -on_window_delete_event() -{ - gtk_main_quit(); - return TRUE; -} - void on_go_clicked(GtkButton *go, Widgets *w) { @@ -36,7 +29,11 @@ on_go_clicked(GtkButton *go, Widgets *w) gtk_main_quit(); } g_free(fullpath); +} +void +on_interp_started(ChimaraGlk *glk, Widgets *w) +{ gtk_widget_set_sensitive(w->go, FALSE); gtk_widget_set_sensitive(w->stop, TRUE); gtk_widget_set_sensitive(w->test_picker, FALSE); @@ -47,7 +44,11 @@ on_stop_clicked(GtkButton *stop, Widgets *w) { chimara_glk_stop( CHIMARA_GLK(w->interp) ); chimara_glk_wait( CHIMARA_GLK(w->interp) ); +} +void +on_interp_stopped(ChimaraGlk *glk, Widgets *w) +{ gtk_widget_set_sensitive(w->stop, FALSE); gtk_widget_set_sensitive(w->go, TRUE); gtk_widget_set_sensitive(w->test_picker, TRUE); @@ -92,8 +93,11 @@ main(int argc, char *argv[]) w->go = LOAD_WIDGET("go"); w->stop = LOAD_WIDGET("stop"); w->interp = chimara_if_new(); + gtk_widget_set_size_request(w->interp, 500, 600); gtk_box_pack_end_defaults(GTK_BOX(vbox), w->interp); gtk_builder_connect_signals(builder, w); + g_signal_connect(w->interp, "started", G_CALLBACK(on_interp_started), w); + g_signal_connect(w->interp, "stopped", G_CALLBACK(on_interp_stopped), w); gtk_widget_show_all(w->window); gdk_threads_enter(); diff --git a/tests/glulxercise.ui b/tests/glulxercise.ui index 348f44d..934e677 100644 --- a/tests/glulxercise.ui +++ b/tests/glulxercise.ui @@ -3,10 +3,8 @@ - 500 - 600 6 - + True