X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Fui%2Fgui%2Fsyntax-editor.c;h=a9564cb1a563fc959cee8f5c9dc80fe40d914f84;hb=ecd26ec19e9f8a58079a1c5fa06b39484787ab7e;hp=35fd7a5e869aabc3b97a1e8f4caebde5e5846edf;hpb=53aebf50c7b4d81050769d0a6bbe140a643069a3;p=pspp-builds.git diff --git a/src/ui/gui/syntax-editor.c b/src/ui/gui/syntax-editor.c index 35fd7a5e..a9564cb1 100644 --- a/src/ui/gui/syntax-editor.c +++ b/src/ui/gui/syntax-editor.c @@ -33,6 +33,7 @@ #include "window-manager.h" +#include #include #include #include @@ -110,7 +111,7 @@ save_if_modified (struct syntax_editor *se) return ; } - gtk_widget_destroy (e->window); + gtk_widget_destroy (GTK_WIDGET (e->window)); } /* Callback for the File->SaveAs menuitem */ @@ -214,14 +215,16 @@ static void 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; } @@ -325,11 +328,13 @@ new_syntax_editor (void) struct syntax_editor *se ; struct editor_window *e; + connect_help (xml); + se = g_malloc (sizeof (*se)); 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); @@ -360,6 +365,11 @@ new_syntax_editor (void) 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", @@ -401,6 +411,13 @@ new_syntax_editor (void) 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",