#include "window-manager.h"
+#include <data/dictionary.h>
#include <language/lexer/lexer.h>
#include <language/command.h>
#include <data/procedure.h>
return ;
}
- gtk_widget_destroy (e->window);
+ gtk_widget_destroy (GTK_WIDGET (e->window));
}
/* Callback for the File->SaveAs menuitem */
execute_syntax (const struct syntax_editor *se, GtkTextIter start,
GtkTextIter stop)
{
+ g_return_if_fail (proc_has_source (the_dataset));
+
getl_append_source (the_source_stream,
create_syntax_editor_source (se, start, stop));
for (;;)
{
+ const struct dictionary *dict = dataset_dict (the_dataset);
int result = cmd_parse (se->lexer, the_dataset,
- proc_has_source (the_dataset)
- ? CMD_STATE_DATA : CMD_STATE_INITIAL);
-
+ dict_get_var_cnt (dict) > 0 ?
+ CMD_STATE_DATA : CMD_STATE_INITIAL);
if (result == CMD_EOF || result == CMD_FINISH)
break;
}
e = (struct editor_window *)se;
- e->window = get_widget_assert (xml, "syntax_editor");
+ e->window = GTK_WINDOW (get_widget_assert (xml, "syntax_editor"));
text_view = get_widget_assert (xml, "syntax_text_view");
se->buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text_view));
se->lexer = lex_create (the_source_stream);
G_CALLBACK (about_new),
e->window);
+ g_signal_connect (get_widget_assert (xml,"help_reference"),
+ "activate",
+ G_CALLBACK (reference_manual),
+ NULL);
+
g_signal_connect (get_widget_assert (xml, "file_save"),
"activate",
se);
+ g_signal_connect (get_widget_assert (xml,"windows_minimise_all"),
+ "activate",
+ G_CALLBACK (minimise_all_windows),
+ NULL);
+
+
+
g_object_unref (xml);
g_signal_connect (e->window, "delete-event",