From: John Darrington Date: Sun, 12 Sep 2010 15:58:05 +0000 (+0200) Subject: Syntax Window: Don't connect callbacks until all members are initialised. X-Git-Tag: v0.7.6~225 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3b5df2220691e6da7a4fc3ed8b41b1d0a472ea8d;p=pspp-builds.git Syntax Window: Don't connect callbacks until all members are initialised. --- diff --git a/src/ui/gui/psppire-syntax-window.c b/src/ui/gui/psppire-syntax-window.c index d3d5e563..e99302a0 100644 --- a/src/ui/gui/psppire-syntax-window.c +++ b/src/ui/gui/psppire-syntax-window.c @@ -575,10 +575,6 @@ psppire_syntax_window_init (PsppireSyntaxWindow *window) GtkClipboard *clip_selection = gtk_widget_get_clipboard (GTK_WIDGET (window), GDK_SELECTION_CLIPBOARD); GtkClipboard *clip_primary = gtk_widget_get_clipboard (GTK_WIDGET (window), GDK_SELECTION_PRIMARY); - g_signal_connect_swapped (clip_primary, "owner-change", G_CALLBACK (selection_changed), window); - - g_signal_connect (clip_selection, "owner-change", G_CALLBACK (on_owner_change), window); - window->cliptext = NULL; window->edit_delete = get_action_assert (xml, "edit_delete"); @@ -592,11 +588,18 @@ psppire_syntax_window_init (PsppireSyntaxWindow *window) window->sb = get_widget_assert (xml, "statusbar2"); window->text_context = gtk_statusbar_get_context_id (GTK_STATUSBAR (window->sb), "Text Context"); - g_signal_connect (window->buffer, "changed", G_CALLBACK (on_text_changed), window); + g_signal_connect (window->buffer, "changed", + G_CALLBACK (on_text_changed), window); - g_signal_connect (window->buffer, "modified-changed", + g_signal_connect (window->buffer, "modified-changed", G_CALLBACK (on_modified_changed), window); + g_signal_connect_swapped (clip_primary, "owner-change", + G_CALLBACK (selection_changed), window); + + g_signal_connect (clip_selection, "owner-change", + G_CALLBACK (on_owner_change), window); + connect_help (xml); gtk_container_add (GTK_CONTAINER (window), box); @@ -607,7 +610,6 @@ psppire_syntax_window_init (PsppireSyntaxWindow *window) g_object_ref (window->sb); - gtk_box_pack_start (GTK_BOX (box), menubar, FALSE, TRUE, 0); gtk_box_pack_start (GTK_BOX (box), sw, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (box), window->sb, FALSE, TRUE, 0);