From 224e54373b084f5246e19abebb7e9a6337798918 Mon Sep 17 00:00:00 2001 From: Philip Chimento Date: Thu, 3 Dec 2009 21:00:31 +0000 Subject: [PATCH] Improved Glulxercise test program git-svn-id: http://lassie.dyndns-server.com/svn/gargoyle-gtk@197 ddfedd41-794f-dd11-ae45-00112f111e67 --- tests/glulxercise.c | 18 +++++++++++------- tests/glulxercise.ui | 4 +--- 2 files changed, 12 insertions(+), 10 deletions(-) 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 -- 2.30.2