#include <gtk/gtksignal.h>
#include <gtk/gtkbox.h>
-#include <glade/glade.h>
#include "helper.h"
#include <libpspp/message.h>
};
psppire_output_window_type =
- g_type_register_static (PSPPIRE_WINDOW_TYPE, "PsppireOutputWindow",
+ g_type_register_static (PSPPIRE_TYPE_WINDOW, "PsppireOutputWindow",
&psppire_output_window_info, 0);
}
return psppire_output_window_type;
}
+static GObjectClass *parent_class;
static void
psppire_output_window_finalize (GObject *object)
{
- g_debug ("%s %p", __FUNCTION__, object);
-
- GObjectClass *class = G_OBJECT_GET_CLASS (object);
-
- GObjectClass *parent_class = g_type_class_peek_parent (class);
-
-
if (G_OBJECT_CLASS (parent_class)->finalize)
(*G_OBJECT_CLASS (parent_class)->finalize) (object);
-
}
static void
psppire_output_window_class_init (PsppireOutputWindowClass *class)
{
+ parent_class = g_type_class_peek_parent (class);
}
static void
psppire_output_window_init (PsppireOutputWindow *window)
{
- GladeXML *xml = XML_NEW ("output-viewer.glade");
+ GtkBuilder *xml = builder_new ("output-viewer.ui");
GtkWidget *box = gtk_vbox_new (FALSE, 0);
window->fp = NULL;
- g_signal_connect (get_widget_assert (xml,"help_about"),
+ g_signal_connect (get_action_assert (xml,"help_about"),
"activate",
G_CALLBACK (about_new),
window);
- g_signal_connect (get_widget_assert (xml,"help_reference"),
+ g_signal_connect (get_action_assert (xml,"help_reference"),
"activate",
G_CALLBACK (reference_manual),
NULL);
-#if 0
- g_signal_connect (get_widget_assert (xml,"windows_minimise-all"),
+ g_signal_connect (get_action_assert (xml,"windows_minimise-all"),
"activate",
- G_CALLBACK (minimise_all_windows),
+ G_CALLBACK (psppire_window_minimise_all),
NULL);
-#endif
+
+ {
+ GtkUIManager *uim = GTK_UI_MANAGER (get_object_assert (xml, "uimanager1", GTK_TYPE_UI_MANAGER));
+
+ PSPPIRE_WINDOW (window)->menu =
+ GTK_MENU_SHELL (gtk_ui_manager_get_widget (uim,"/ui/menubar1/windows_menuitem/windows_minimise-all")->parent);
+ }
g_object_unref (xml);
GtkWidget*
psppire_output_window_new (void)
{
- return GTK_WIDGET (g_object_new (psppire_output_window_get_type (), NULL));
+ return GTK_WIDGET (g_object_new (psppire_output_window_get_type (),
+ "filename", "Output",
+ "description", _("Output Viewer"),
+ NULL));
}
static void reload_viewer (PsppireOutputWindow *ow);
if ( NULL == the_output_viewer )
{
the_output_viewer = PSPPIRE_OUTPUT_WINDOW (psppire_output_window_new ());
- gtk_widget_show (the_output_viewer);
+ gtk_widget_show (GTK_WIDGET (the_output_viewer));
}
reload_viewer (the_output_viewer);
GtkTextIter end_iter;
GtkTextMark *mark ;
- static char *line = NULL;
+ char *line = NULL;
gboolean chars_inserted = FALSE;
mark = gtk_text_buffer_create_mark (ow->buffer, NULL, &end_iter, TRUE);
-
- g_debug ("%s %p\n", __FUNCTION__, ow);
-
#ifdef __CYGWIN__
/*
Apparently Windoze is not capabale of writing to a file whilst