diff options
author | jaortega <jaortega> | 2001-03-15 17:26:39 +0000 |
---|---|---|
committer | jaortega <jaortega> | 2001-03-15 17:26:39 +0000 |
commit | 44984f46aa6fdc81fe8e5af29e09c9c624d864c5 (patch) | |
tree | 83bd0d7c26bdb603aa295c5341344420782c25a3 /mixgtk | |
parent | 52cac8c41a50145c385c0c13b95ee290a1628c97 (diff) | |
download | mdk-44984f46aa6fdc81fe8e5af29e09c9c624d864c5.tar.gz mdk-44984f46aa6fdc81fe8e5af29e09c9c624d864c5.tar.bz2 |
0.3 pre-release
Diffstat (limited to 'mixgtk')
-rw-r--r-- | mixgtk/Makefile.am | 4 | ||||
-rw-r--r-- | mixgtk/mixgtk.glade | 2 | ||||
-rw-r--r-- | mixgtk/mixgtk_cmd_dispatcher.c | 36 | ||||
-rw-r--r-- | mixgtk/mixgtk_widgets.c | 3 | ||||
-rw-r--r-- | mixgtk/mixgtk_widgets.h | 3 |
5 files changed, 37 insertions, 11 deletions
diff --git a/mixgtk/Makefile.am b/mixgtk/Makefile.am index eb084a0..f8b1bcf 100644 --- a/mixgtk/Makefile.am +++ b/mixgtk/Makefile.am @@ -15,7 +15,7 @@ INCLUDES = -I$(includedir) -DGLADE_FILE=\""$(pkgdatadir)/mixgtk.glade"\"\ -DLOCAL_GLADE_FILE=\"mixgtk.glade\" LDADD = $(top_builddir)/mixlib/libmix.a - +if MAKE_GUI pkgdata_DATA = mixgtk.glade bin_PROGRAMS = gmixvm gmixvm_SOURCES = mixgtk.c mixgtk_gen_handlers.h mixgtk_gen_handlers.c \ @@ -25,7 +25,7 @@ gmixvm_SOURCES = mixgtk.c mixgtk_gen_handlers.h mixgtk_gen_handlers.c \ mixgtk_mixvm.h mixgtk_mixvm.c \ mixgtk_mixal.h mixgtk_mixal.c \ mixgtk_input.h mixgtk_input.c - +endif diff --git a/mixgtk/mixgtk.glade b/mixgtk/mixgtk.glade index 0ef2698..0d30282 100644 --- a/mixgtk/mixgtk.glade +++ b/mixgtk/mixgtk.glade @@ -23,7 +23,7 @@ <handler>on_main_window_destroy</handler> <last_modification_time>Tue, 20 Feb 2001 21:58:29 GMT</last_modification_time> </signal> - <title>mixgtk</title> + <title>gmixvm</title> <type>GTK_WINDOW_TOPLEVEL</type> <position>GTK_WIN_POS_NONE</position> <modal>False</modal> diff --git a/mixgtk/mixgtk_cmd_dispatcher.c b/mixgtk/mixgtk_cmd_dispatcher.c index 71b5877..11acc1d 100644 --- a/mixgtk/mixgtk_cmd_dispatcher.c +++ b/mixgtk/mixgtk_cmd_dispatcher.c @@ -1,7 +1,7 @@ /* -*-c-*- -------------- mixgtk_cmd_dispatcher.c : * Implementation of the functions declared in mixgtk_cmd_dispatcher.h * ------------------------------------------------------------------ - * Last change: Time-stamp: "01/03/12 02:05:43 jose" + * Last change: Time-stamp: "01/03/15 16:01:43 jose" * ------------------------------------------------------------------ * Copyright (C) 2001 Free Software Foundation, Inc. * @@ -40,6 +40,8 @@ struct mixgtk_dispatch_ size_t out_buffer_size; GtkWidget *prompt; GtkWidget *log; + GtkWidget *status; + guint context; GCompletion *completions; }; @@ -101,8 +103,21 @@ static void load_post_hook_ (mix_vm_cmd_dispatcher_t *dis, const gchar *arg, gpointer data) { - mixgtk_mixal_load_file (); - mixgtk_mixal_update (); + static glong id = -1; + + if (mix_vm_cmd_dispatcher_get_last_result (dis)) + { + gchar *file = g_strdup (arg); + mixgtk_mixal_load_file (); + mixgtk_mixal_update (); + + if (id != -1) + gtk_statusbar_remove (GTK_STATUSBAR (dis_data_.status), + dis_data_.context, (guint)id); + id = + gtk_statusbar_push (GTK_STATUSBAR (dis_data_.status), dis_data_.context, + file); + } } static void @@ -182,22 +197,31 @@ mixgtk_cmd_dispatcher_init (void) if (!dis_data_.prompt) { dis_data_.prompt = mixgtk_widget_factory_get (MIXGTK_WIDGET_PROMPT); - if (!dis_data_.prompt) return FALSE; + g_return_val_if_fail (dis_data_.prompt != NULL, FALSE); dis_data_.log = mixgtk_widget_factory_get (MIXGTK_WIDGET_LOG); - if (!dis_data_.log) return FALSE; + g_return_val_if_fail (dis_data_.log != NULL, FALSE); } if (!dis_data_.dispatcher) { FILE *out = open_memstream (&(dis_data_.out_buffer), &(dis_data_.out_buffer_size)); - if (!out) return FALSE; + g_return_val_if_fail (out != NULL, FALSE); dis_data_.out = out; dis_data_.dispatcher = mix_vm_cmd_dispatcher_new (out, out); mix_vm_cmd_dispatcher_print_time (dis_data_.dispatcher, FALSE); install_hooks_ (); } + if (!dis_data_.status) + { + dis_data_.status = mixgtk_widget_factory_get (MIXGTK_WIDGET_STATUSBAR); + g_return_val_if_fail (dis_data_.status != NULL, FALSE); + dis_data_.context = gtk_statusbar_get_context_id (GTK_STATUSBAR + (dis_data_.status), + "cmd_dis_context"); + } + if (!dis_data_.completions) init_completions_ (); return TRUE; diff --git a/mixgtk/mixgtk_widgets.c b/mixgtk/mixgtk_widgets.c index 13b675e..165da81 100644 --- a/mixgtk/mixgtk_widgets.c +++ b/mixgtk/mixgtk_widgets.c @@ -1,7 +1,7 @@ /* -*-c-*- -------------- mixgtk_widgets.c : * Implementation of the functions declared in mixgtk_widgets.h * ------------------------------------------------------------------ - * Last change: Time-stamp: "01/03/14 16:54:22 jose" + * Last change: Time-stamp: "01/03/15 14:42:37 jose" * ------------------------------------------------------------------ * Copyright (C) 2001 Free Software Foundation, Inc. * @@ -33,6 +33,7 @@ static GladeXML *xml_ = NULL; /* widget names */ static const gchar *names_[] = { "main_window", + "main_statusbar", "word_dialog", "about_dialog", "goto_dialog", diff --git a/mixgtk/mixgtk_widgets.h b/mixgtk/mixgtk_widgets.h index 4a6f281..f20ddc3 100644 --- a/mixgtk/mixgtk_widgets.h +++ b/mixgtk/mixgtk_widgets.h @@ -1,7 +1,7 @@ /* -*-c-*- ---------------- mixgtk_widgets.h : * glade-based factory of mixvm widgets * ------------------------------------------------------------------ - * Last change: Time-stamp: <01/03/14 15:36:43 jose> + * Last change: Time-stamp: <01/03/15 14:42:13 jose> * ------------------------------------------------------------------ * Copyright (C) 2001 Free Software Foundation, Inc. * @@ -31,6 +31,7 @@ /* enumeration of mixvm widget ids */ typedef enum { MIXGTK_WIDGET_MAIN, /* main app window */ + MIXGTK_WIDGET_STATUSBAR, MIXGTK_WIDGET_WORD_DIALOG, /* input dialog for a mix word */ MIXGTK_WIDGET_ABOUT_DIALOG, MIXGTK_WIDGET_GOTO_DIALOG, |