/*
 * DO NOT EDIT THIS FILE - it is generated by Glade.
 */

#ifdef HAVE_CONFIG_H
#  include <config.h>
#endif

#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <string.h>

#include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h>

#include "callbacks.h"
#include "interface.h"
#include "support.h"

GtkWidget*
create_smon_window (void)
{
  GtkWidget *smon_window;
  GtkWidget *smon_vbox;
  GtkWidget *menubar;
  guint tmp_key;
  GtkWidget *file_b;
  GtkWidget *file_b_menu;
  GtkAccelGroup *file_b_menu_accels;
  GtkWidget *new_b;
  GtkWidget *open_b;
  GtkWidget *open_port_b;
  GtkWidget *close_port_b;
  GtkWidget *save_b;
  GtkWidget *save_as_b;
  GtkWidget *exit_b;
  GtkWidget *view_b;
  GtkWidget *view_b_menu;
  GtkAccelGroup *view_b_menu_accels;
  GtkWidget *zoom_resize_b;
  GtkWidget *error_messages_b;
  GtkWidget *commands_b;
  GtkWidget *anim_parameters;
  GtkWidget *help_b;
  GtkWidget *help_b_menu;
  GtkAccelGroup *help_b_menu_accels;
  GtkWidget *about_b;
  GtkWidget *smod_handlebox;
  GtkWidget *smon_toolbar;
  GtkWidget *controls_begin_button;
  GtkWidget *controls_prev_button;
  GtkWidget *controls_play_button;
  GtkWidget *controls_succ_button;
  GtkWidget *controls_end_button;
  GtkWidget *smon_vpaned;
  GtkWidget *graph_drawingarea;
  GtkWidget *log_scrolledwindow;
  GtkWidget *log_clist;
  GtkWidget *log_label;
  GtkWidget *smon_statusbar;
  GtkAccelGroup *accel_group;
  GtkTooltips *tooltips;

  tooltips = gtk_tooltips_new ();

  accel_group = gtk_accel_group_new ();

  smon_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_object_set_data (GTK_OBJECT (smon_window), "smon_window", smon_window);
  gtk_widget_set_usize (smon_window, 600, 600);
  gtk_window_set_title (GTK_WINDOW (smon_window), "Siena Monitor");
  gtk_window_set_policy (GTK_WINDOW (smon_window), TRUE, TRUE, FALSE);
  gtk_window_set_wmclass (GTK_WINDOW (smon_window), "SienaMonitor", "SienaMonitor");

  smon_vbox = gtk_vbox_new (FALSE, 0);
  gtk_widget_ref (smon_vbox);
  gtk_object_set_data_full (GTK_OBJECT (smon_window), "smon_vbox", smon_vbox,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (smon_vbox);
  gtk_container_add (GTK_CONTAINER (smon_window), smon_vbox);

  menubar = gtk_menu_bar_new ();
  gtk_widget_ref (menubar);
  gtk_object_set_data_full (GTK_OBJECT (smon_window), "menubar", menubar,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (menubar);
  gtk_box_pack_start (GTK_BOX (smon_vbox), menubar, FALSE, FALSE, 0);

  file_b = gtk_menu_item_new_with_label ("");
  tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (file_b)->child),
                                   "_File");
  gtk_widget_add_accelerator (file_b, "activate_item", accel_group,
                              tmp_key, GDK_MOD1_MASK, (GtkAccelFlags) 0);
  gtk_widget_ref (file_b);
  gtk_object_set_data_full (GTK_OBJECT (smon_window), "file_b", file_b,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (file_b);
  gtk_container_add (GTK_CONTAINER (menubar), file_b);

  file_b_menu = gtk_menu_new ();
  gtk_widget_ref (file_b_menu);
  gtk_object_set_data_full (GTK_OBJECT (smon_window), "file_b_menu", file_b_menu,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_menu_item_set_submenu (GTK_MENU_ITEM (file_b), file_b_menu);
  file_b_menu_accels = gtk_menu_ensure_uline_accel_group (GTK_MENU (file_b_menu));

  new_b = gtk_menu_item_new_with_label ("");
  tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (new_b)->child),
                                   "_New");
  gtk_widget_add_accelerator (new_b, "activate_item", file_b_menu_accels,
                              tmp_key, 0, 0);
  gtk_widget_ref (new_b);
  gtk_object_set_data_full (GTK_OBJECT (smon_window), "new_b", new_b,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (new_b);
  gtk_container_add (GTK_CONTAINER (file_b_menu), new_b);
  gtk_tooltips_set_tip (tooltips, new_b, "starts new event log", NULL);

  open_b = gtk_menu_item_new_with_label ("");
  tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (open_b)->child),
                                   "_Open File");
  gtk_widget_add_accelerator (open_b, "activate_item", file_b_menu_accels,
                              tmp_key, 0, 0);
  gtk_widget_ref (open_b);
  gtk_object_set_data_full (GTK_OBJECT (smon_window), "open_b", open_b,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (open_b);
  gtk_container_add (GTK_CONTAINER (file_b_menu), open_b);
  gtk_tooltips_set_tip (tooltips, open_b, "reads an event log from a file", NULL);
  gtk_widget_add_accelerator (open_b, "activate", accel_group,
                              GDK_O, GDK_CONTROL_MASK,
                              GTK_ACCEL_VISIBLE);

  open_port_b = gtk_menu_item_new_with_label ("");
  tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (open_port_b)->child),
                                   "Open _Port");
  gtk_widget_add_accelerator (open_port_b, "activate_item", file_b_menu_accels,
                              tmp_key, 0, 0);
  gtk_widget_ref (open_port_b);
  gtk_object_set_data_full (GTK_OBJECT (smon_window), "open_port_b", open_port_b,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (open_port_b);
  gtk_container_add (GTK_CONTAINER (file_b_menu), open_port_b);

  close_port_b = gtk_menu_item_new_with_label ("");
  tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (close_port_b)->child),
                                   "_Close Port");
  gtk_widget_add_accelerator (close_port_b, "activate_item", file_b_menu_accels,
                              tmp_key, 0, 0);
  gtk_widget_ref (close_port_b);
  gtk_object_set_data_full (GTK_OBJECT (smon_window), "close_port_b", close_port_b,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (close_port_b);
  gtk_container_add (GTK_CONTAINER (file_b_menu), close_port_b);
  gtk_widget_set_sensitive (close_port_b, FALSE);
  gtk_tooltips_set_tip (tooltips, close_port_b, "Close the input port", NULL);

  save_b = gtk_menu_item_new_with_label ("");
  tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (save_b)->child),
                                   "_Save");
  gtk_widget_add_accelerator (save_b, "activate_item", file_b_menu_accels,
                              tmp_key, 0, 0);
  gtk_widget_ref (save_b);
  gtk_object_set_data_full (GTK_OBJECT (smon_window), "save_b", save_b,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (save_b);
  gtk_container_add (GTK_CONTAINER (file_b_menu), save_b);
  gtk_tooltips_set_tip (tooltips, save_b, "saves current event log to a file", NULL);
  gtk_widget_add_accelerator (save_b, "activate", accel_group,
                              GDK_S, GDK_CONTROL_MASK,
                              GTK_ACCEL_VISIBLE);

  save_as_b = gtk_menu_item_new_with_label ("");
  tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (save_as_b)->child),
                                   "Save _As");
  gtk_widget_add_accelerator (save_as_b, "activate_item", file_b_menu_accels,
                              tmp_key, 0, 0);
  gtk_widget_ref (save_as_b);
  gtk_object_set_data_full (GTK_OBJECT (smon_window), "save_as_b", save_as_b,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (save_as_b);
  gtk_container_add (GTK_CONTAINER (file_b_menu), save_as_b);
  gtk_tooltips_set_tip (tooltips, save_as_b, "saves current event log to a file", NULL);

  exit_b = gtk_menu_item_new_with_label ("");
  tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (exit_b)->child),
                                   "E_xit");
  gtk_widget_add_accelerator (exit_b, "activate_item", file_b_menu_accels,
                              tmp_key, 0, 0);
  gtk_widget_ref (exit_b);
  gtk_object_set_data_full (GTK_OBJECT (smon_window), "exit_b", exit_b,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (exit_b);
  gtk_container_add (GTK_CONTAINER (file_b_menu), exit_b);

  view_b = gtk_menu_item_new_with_label ("");
  tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (view_b)->child),
                                   "_View");
  gtk_widget_add_accelerator (view_b, "activate_item", accel_group,
                              tmp_key, GDK_MOD1_MASK, (GtkAccelFlags) 0);
  gtk_widget_ref (view_b);
  gtk_object_set_data_full (GTK_OBJECT (smon_window), "view_b", view_b,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (view_b);
  gtk_container_add (GTK_CONTAINER (menubar), view_b);

  view_b_menu = gtk_menu_new ();
  gtk_widget_ref (view_b_menu);
  gtk_object_set_data_full (GTK_OBJECT (smon_window), "view_b_menu", view_b_menu,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_menu_item_set_submenu (GTK_MENU_ITEM (view_b), view_b_menu);
  view_b_menu_accels = gtk_menu_ensure_uline_accel_group (GTK_MENU (view_b_menu));

  zoom_resize_b = gtk_menu_item_new_with_label ("");
  tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (zoom_resize_b)->child),
                                   "_Zoom/Resize...");
  gtk_widget_add_accelerator (zoom_resize_b, "activate_item", view_b_menu_accels,
                              tmp_key, 0, 0);
  gtk_widget_ref (zoom_resize_b);
  gtk_object_set_data_full (GTK_OBJECT (smon_window), "zoom_resize_b", zoom_resize_b,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (zoom_resize_b);
  gtk_container_add (GTK_CONTAINER (view_b_menu), zoom_resize_b);

  error_messages_b = gtk_menu_item_new_with_label ("");
  tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (error_messages_b)->child),
                                   "_Error messages");
  gtk_widget_add_accelerator (error_messages_b, "activate_item", view_b_menu_accels,
                              tmp_key, 0, 0);
  gtk_widget_ref (error_messages_b);
  gtk_object_set_data_full (GTK_OBJECT (smon_window), "error_messages_b", error_messages_b,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (error_messages_b);
  gtk_container_add (GTK_CONTAINER (view_b_menu), error_messages_b);

  commands_b = gtk_check_menu_item_new_with_label ("");
  tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (commands_b)->child),
                                   "_Commands");
  gtk_widget_add_accelerator (commands_b, "activate_item", view_b_menu_accels,
                              tmp_key, 0, 0);
  gtk_widget_ref (commands_b);
  gtk_object_set_data_full (GTK_OBJECT (smon_window), "commands_b", commands_b,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (commands_b);
  gtk_container_add (GTK_CONTAINER (view_b_menu), commands_b);
  gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (commands_b), TRUE);
  gtk_check_menu_item_set_show_toggle (GTK_CHECK_MENU_ITEM (commands_b), TRUE);

  anim_parameters = gtk_menu_item_new_with_label ("");
  tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (anim_parameters)->child),
                                   "_Parameters...");
  gtk_widget_add_accelerator (anim_parameters, "activate_item", view_b_menu_accels,
                              tmp_key, 0, 0);
  gtk_widget_ref (anim_parameters);
  gtk_object_set_data_full (GTK_OBJECT (smon_window), "anim_parameters", anim_parameters,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (anim_parameters);
  gtk_container_add (GTK_CONTAINER (view_b_menu), anim_parameters);

  help_b = gtk_menu_item_new_with_label ("");
  tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (help_b)->child),
                                   "_Help");
  gtk_widget_add_accelerator (help_b, "activate_item", accel_group,
                              tmp_key, GDK_MOD1_MASK, (GtkAccelFlags) 0);
  gtk_widget_ref (help_b);
  gtk_object_set_data_full (GTK_OBJECT (smon_window), "help_b", help_b,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (help_b);
  gtk_container_add (GTK_CONTAINER (menubar), help_b);

  help_b_menu = gtk_menu_new ();
  gtk_widget_ref (help_b_menu);
  gtk_object_set_data_full (GTK_OBJECT (smon_window), "help_b_menu", help_b_menu,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_menu_item_set_submenu (GTK_MENU_ITEM (help_b), help_b_menu);
  help_b_menu_accels = gtk_menu_ensure_uline_accel_group (GTK_MENU (help_b_menu));

  about_b = gtk_menu_item_new_with_label ("");
  tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (about_b)->child),
                                   "_About");
  gtk_widget_add_accelerator (about_b, "activate_item", help_b_menu_accels,
                              tmp_key, 0, 0);
  gtk_widget_ref (about_b);
  gtk_object_set_data_full (GTK_OBJECT (smon_window), "about_b", about_b,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (about_b);
  gtk_container_add (GTK_CONTAINER (help_b_menu), about_b);

  smod_handlebox = gtk_handle_box_new ();
  gtk_widget_ref (smod_handlebox);
  gtk_object_set_data_full (GTK_OBJECT (smon_window), "smod_handlebox", smod_handlebox,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (smod_handlebox);
  gtk_box_pack_start (GTK_BOX (smon_vbox), smod_handlebox, FALSE, FALSE, 0);

  smon_toolbar = gtk_toolbar_new (GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_BOTH);
  gtk_widget_ref (smon_toolbar);
  gtk_object_set_data_full (GTK_OBJECT (smon_window), "smon_toolbar", smon_toolbar,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (smon_toolbar);
  gtk_container_add (GTK_CONTAINER (smod_handlebox), smon_toolbar);

  controls_begin_button = gtk_toolbar_append_element (GTK_TOOLBAR (smon_toolbar),
                                GTK_TOOLBAR_CHILD_BUTTON,
                                NULL,
                                "Begin",
                                NULL, NULL,
                                NULL, NULL, NULL);
  gtk_widget_ref (controls_begin_button);
  gtk_object_set_data_full (GTK_OBJECT (smon_window), "controls_begin_button", controls_begin_button,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (controls_begin_button);
  gtk_widget_add_accelerator (controls_begin_button, "clicked", accel_group,
                              GDK_A, GDK_CONTROL_MASK,
                              GTK_ACCEL_VISIBLE);
  gtk_widget_add_accelerator (controls_begin_button, "clicked", accel_group,
                              GDK_P, GDK_MOD1_MASK,
                              GTK_ACCEL_VISIBLE);

  controls_prev_button = gtk_toolbar_append_element (GTK_TOOLBAR (smon_toolbar),
                                GTK_TOOLBAR_CHILD_BUTTON,
                                NULL,
                                "Prev",
                                NULL, NULL,
                                NULL, NULL, NULL);
  gtk_widget_ref (controls_prev_button);
  gtk_object_set_data_full (GTK_OBJECT (smon_window), "controls_prev_button", controls_prev_button,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (controls_prev_button);
  gtk_widget_add_accelerator (controls_prev_button, "clicked", accel_group,
                              GDK_B, GDK_CONTROL_MASK,
                              GTK_ACCEL_VISIBLE);
  gtk_widget_add_accelerator (controls_prev_button, "clicked", accel_group,
                              GDK_P, GDK_CONTROL_MASK,
                              GTK_ACCEL_VISIBLE);

  controls_play_button = gtk_toolbar_append_element (GTK_TOOLBAR (smon_toolbar),
                                GTK_TOOLBAR_CHILD_TOGGLEBUTTON,
                                NULL,
                                "Play",
                                NULL, NULL,
                                NULL, NULL, NULL);
  gtk_widget_ref (controls_play_button);
  gtk_object_set_data_full (GTK_OBJECT (smon_window), "controls_play_button", controls_play_button,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (controls_play_button);
  gtk_widget_add_accelerator (controls_play_button, "clicked", accel_group,
                              GDK_space, GDK_CONTROL_MASK,
                              GTK_ACCEL_VISIBLE);
  gtk_widget_add_accelerator (controls_play_button, "clicked", accel_group,
                              GDK_space, 0,
                              GTK_ACCEL_VISIBLE);
  gtk_widget_add_accelerator (controls_play_button, "clicked", accel_group,
                              GDK_Return, 0,
                              GTK_ACCEL_VISIBLE);
  gtk_widget_add_accelerator (controls_play_button, "clicked", accel_group,
                              GDK_Return, GDK_CONTROL_MASK,
                              GTK_ACCEL_VISIBLE);
  gtk_widget_add_accelerator (controls_play_button, "clicked", accel_group,
                              GDK_S, GDK_CONTROL_MASK,
                              GTK_ACCEL_VISIBLE);

  controls_succ_button = gtk_toolbar_append_element (GTK_TOOLBAR (smon_toolbar),
                                GTK_TOOLBAR_CHILD_BUTTON,
                                NULL,
                                "Succ",
                                NULL, NULL,
                                NULL, NULL, NULL);
  gtk_widget_ref (controls_succ_button);
  gtk_object_set_data_full (GTK_OBJECT (smon_window), "controls_succ_button", controls_succ_button,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (controls_succ_button);
  gtk_widget_add_accelerator (controls_succ_button, "clicked", accel_group,
                              GDK_F, GDK_CONTROL_MASK,
                              GTK_ACCEL_VISIBLE);
  gtk_widget_add_accelerator (controls_succ_button, "clicked", accel_group,
                              GDK_N, GDK_CONTROL_MASK,
                              GTK_ACCEL_VISIBLE);

  controls_end_button = gtk_toolbar_append_element (GTK_TOOLBAR (smon_toolbar),
                                GTK_TOOLBAR_CHILD_BUTTON,
                                NULL,
                                "End",
                                NULL, NULL,
                                NULL, NULL, NULL);
  gtk_widget_ref (controls_end_button);
  gtk_object_set_data_full (GTK_OBJECT (smon_window), "controls_end_button", controls_end_button,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (controls_end_button);
  gtk_widget_add_accelerator (controls_end_button, "clicked", accel_group,
                              GDK_E, GDK_CONTROL_MASK,
                              GTK_ACCEL_VISIBLE);
  gtk_widget_add_accelerator (controls_end_button, "clicked", accel_group,
                              GDK_N, GDK_MOD1_MASK,
                              GTK_ACCEL_VISIBLE);

  smon_vpaned = gtk_vpaned_new ();
  gtk_widget_ref (smon_vpaned);
  gtk_object_set_data_full (GTK_OBJECT (smon_window), "smon_vpaned", smon_vpaned,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (smon_vpaned);
  gtk_box_pack_start (GTK_BOX (smon_vbox), smon_vpaned, TRUE, TRUE, 0);
  gtk_container_set_border_width (GTK_CONTAINER (smon_vpaned), 4);
  gtk_paned_set_handle_size (GTK_PANED (smon_vpaned), 8);
  gtk_paned_set_position (GTK_PANED (smon_vpaned), 400);

  graph_drawingarea = gtk_drawing_area_new ();
  gtk_widget_ref (graph_drawingarea);
  gtk_object_set_data_full (GTK_OBJECT (smon_window), "graph_drawingarea", graph_drawingarea,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (graph_drawingarea);
  gtk_paned_pack1 (GTK_PANED (smon_vpaned), graph_drawingarea, TRUE, TRUE);
  gtk_widget_set_usize (graph_drawingarea, -2, 300);

  log_scrolledwindow = gtk_scrolled_window_new (NULL, NULL);
  gtk_widget_ref (log_scrolledwindow);
  gtk_object_set_data_full (GTK_OBJECT (smon_window), "log_scrolledwindow", log_scrolledwindow,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (log_scrolledwindow);
  gtk_paned_pack2 (GTK_PANED (smon_vpaned), log_scrolledwindow, TRUE, TRUE);
  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (log_scrolledwindow), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);

  log_clist = gtk_clist_new (1);
  gtk_widget_ref (log_clist);
  gtk_object_set_data_full (GTK_OBJECT (smon_window), "log_clist", log_clist,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (log_clist);
  gtk_container_add (GTK_CONTAINER (log_scrolledwindow), log_clist);
  gtk_clist_set_column_width (GTK_CLIST (log_clist), 0, 80);
  gtk_clist_column_titles_hide (GTK_CLIST (log_clist));

  log_label = gtk_label_new ("Trace");
  gtk_widget_ref (log_label);
  gtk_object_set_data_full (GTK_OBJECT (smon_window), "log_label", log_label,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (log_label);
  gtk_clist_set_column_widget (GTK_CLIST (log_clist), 0, log_label);
  gtk_label_set_justify (GTK_LABEL (log_label), GTK_JUSTIFY_LEFT);

  smon_statusbar = gtk_statusbar_new ();
  gtk_widget_ref (smon_statusbar);
  gtk_object_set_data_full (GTK_OBJECT (smon_window), "smon_statusbar", smon_statusbar,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (smon_statusbar);
  gtk_box_pack_start (GTK_BOX (smon_vbox), smon_statusbar, FALSE, TRUE, 0);

  gtk_signal_connect (GTK_OBJECT (new_b), "activate",
                      GTK_SIGNAL_FUNC (on_new_b_activate),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (open_b), "activate",
                      GTK_SIGNAL_FUNC (on_open_b_activate),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (open_port_b), "activate",
                      GTK_SIGNAL_FUNC (on_open_port_b_activate),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (close_port_b), "activate",
                      GTK_SIGNAL_FUNC (on_close_port_b_activate),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (save_b), "activate",
                      GTK_SIGNAL_FUNC (on_save_b_activate),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (save_as_b), "activate",
                      GTK_SIGNAL_FUNC (on_save_as_b_activate),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (exit_b), "activate",
                      GTK_SIGNAL_FUNC (on_exit_b_activate),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (zoom_resize_b), "activate",
                      GTK_SIGNAL_FUNC (on_zoom_resize_b_activate),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (error_messages_b), "activate",
                      GTK_SIGNAL_FUNC (on_error_messages_b_activate),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (commands_b), "activate",
                      GTK_SIGNAL_FUNC (on_commands_b_activate),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (anim_parameters), "activate",
                      GTK_SIGNAL_FUNC (on_anim_param_b_activate),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (about_b), "activate",
                      GTK_SIGNAL_FUNC (on_about_b_activate),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (controls_begin_button), "clicked",
                      GTK_SIGNAL_FUNC (on_controls_begin_button_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (controls_prev_button), "clicked",
                      GTK_SIGNAL_FUNC (on_controls_prev_button_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (controls_play_button), "toggled",
                      GTK_SIGNAL_FUNC (on_controls_play_button_toggled),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (controls_succ_button), "clicked",
                      GTK_SIGNAL_FUNC (on_controls_succ_button_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (controls_end_button), "clicked",
                      GTK_SIGNAL_FUNC (on_controls_end_button_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (log_clist), "select_row",
                      GTK_SIGNAL_FUNC (on_log_clist_select_row),
                      NULL);

  gtk_object_set_data (GTK_OBJECT (smon_window), "tooltips", tooltips);

  gtk_window_add_accel_group (GTK_WINDOW (smon_window), accel_group);

  return smon_window;
}

GtkWidget*
create_save_selection (void)
{
  GtkWidget *save_selection;
  GtkWidget *save_ok_button;
  GtkWidget *save_cancel_button;

  save_selection = gtk_file_selection_new ("Save As");
  gtk_object_set_data (GTK_OBJECT (save_selection), "save_selection", save_selection);
  gtk_container_set_border_width (GTK_CONTAINER (save_selection), 10);
  gtk_window_set_wmclass (GTK_WINDOW (save_selection), "", "SienaMonitor");

  save_ok_button = GTK_FILE_SELECTION (save_selection)->ok_button;
  gtk_object_set_data (GTK_OBJECT (save_selection), "save_ok_button", save_ok_button);
  gtk_widget_show (save_ok_button);
  GTK_WIDGET_SET_FLAGS (save_ok_button, GTK_CAN_DEFAULT);

  save_cancel_button = GTK_FILE_SELECTION (save_selection)->cancel_button;
  gtk_object_set_data (GTK_OBJECT (save_selection), "save_cancel_button", save_cancel_button);
  gtk_widget_show (save_cancel_button);
  GTK_WIDGET_SET_FLAGS (save_cancel_button, GTK_CAN_DEFAULT);

  gtk_signal_connect (GTK_OBJECT (save_ok_button), "clicked",
                      GTK_SIGNAL_FUNC (on_save_ok_button_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (save_cancel_button), "clicked",
                      GTK_SIGNAL_FUNC (on_save_cancel_button_clicked),
                      NULL);

  return save_selection;
}

GtkWidget*
create_open_selection (void)
{
  GtkWidget *open_selection;
  GtkWidget *open_ok_button;
  GtkWidget *open_cancel_button;

  open_selection = gtk_file_selection_new ("Open File");
  gtk_object_set_data (GTK_OBJECT (open_selection), "open_selection", open_selection);
  gtk_container_set_border_width (GTK_CONTAINER (open_selection), 10);
  gtk_window_set_wmclass (GTK_WINDOW (open_selection), "", "SienaMonitor");

  open_ok_button = GTK_FILE_SELECTION (open_selection)->ok_button;
  gtk_object_set_data (GTK_OBJECT (open_selection), "open_ok_button", open_ok_button);
  gtk_widget_show (open_ok_button);
  GTK_WIDGET_SET_FLAGS (open_ok_button, GTK_CAN_DEFAULT);

  open_cancel_button = GTK_FILE_SELECTION (open_selection)->cancel_button;
  gtk_object_set_data (GTK_OBJECT (open_selection), "open_cancel_button", open_cancel_button);
  gtk_widget_show (open_cancel_button);
  GTK_WIDGET_SET_FLAGS (open_cancel_button, GTK_CAN_DEFAULT);

  gtk_signal_connect (GTK_OBJECT (open_ok_button), "clicked",
                      GTK_SIGNAL_FUNC (on_open_ok_button_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (open_cancel_button), "clicked",
                      GTK_SIGNAL_FUNC (on_open_cancel_button_clicked),
                      NULL);

  return open_selection;
}

GtkWidget*
create_zoom_resize_window (void)
{
  GtkWidget *zoom_resize_window;
  GtkWidget *zoom_resize_vbox;
  GtkWidget *resize_frame;
  GtkWidget *resize_vbox;
  GtkWidget *resize_xy_hbox;
  GtkWidget *resize_lock_button;
  GtkWidget *resize_x_hbox;
  GtkWidget *label4;
  GtkObject *resize_x_spinbutton_adj;
  GtkWidget *resize_x_spinbutton;
  GtkWidget *resize_y_hbox;
  GtkWidget *resize_y_label;
  GtkObject *resize_y_spinbutton_adj;
  GtkWidget *resize_y_spinbutton;
  GtkWidget *resize_hbuttonbox;
  GtkWidget *resize_apply_button;
  GtkWidget *resize_reset_button;
  GtkWidget *zoom_frame;
  GtkWidget *zoom_hbox;
  GtkWidget *zoom_m10_button;
  GtkWidget *zoom_m5_button;
  GtkWidget *zoom_p5_button;
  GtkWidget *zoom_p10_button;
  GtkWidget *zoom_resize_separator;
  GtkWidget *zoom_close_hbuttonbox;
  GtkWidget *zoom_resize_close_button;

  zoom_resize_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_object_set_data (GTK_OBJECT (zoom_resize_window), "zoom_resize_window", zoom_resize_window);
  gtk_window_set_title (GTK_WINDOW (zoom_resize_window), "Zoom/Resize");
  gtk_window_set_policy (GTK_WINDOW (zoom_resize_window), FALSE, FALSE, TRUE);

  zoom_resize_vbox = gtk_vbox_new (FALSE, 0);
  gtk_widget_ref (zoom_resize_vbox);
  gtk_object_set_data_full (GTK_OBJECT (zoom_resize_window), "zoom_resize_vbox", zoom_resize_vbox,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (zoom_resize_vbox);
  gtk_container_add (GTK_CONTAINER (zoom_resize_window), zoom_resize_vbox);

  resize_frame = gtk_frame_new ("Resize");
  gtk_widget_ref (resize_frame);
  gtk_object_set_data_full (GTK_OBJECT (zoom_resize_window), "resize_frame", resize_frame,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (resize_frame);
  gtk_box_pack_start (GTK_BOX (zoom_resize_vbox), resize_frame, FALSE, FALSE, 0);
  gtk_container_set_border_width (GTK_CONTAINER (resize_frame), 2);

  resize_vbox = gtk_vbox_new (FALSE, 0);
  gtk_widget_ref (resize_vbox);
  gtk_object_set_data_full (GTK_OBJECT (zoom_resize_window), "resize_vbox", resize_vbox,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (resize_vbox);
  gtk_container_add (GTK_CONTAINER (resize_frame), resize_vbox);

  resize_xy_hbox = gtk_hbox_new (FALSE, 0);
  gtk_widget_ref (resize_xy_hbox);
  gtk_object_set_data_full (GTK_OBJECT (zoom_resize_window), "resize_xy_hbox", resize_xy_hbox,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (resize_xy_hbox);
  gtk_box_pack_start (GTK_BOX (resize_vbox), resize_xy_hbox, TRUE, TRUE, 0);

  resize_lock_button = gtk_check_button_new_with_label ("Lock");
  gtk_widget_ref (resize_lock_button);
  gtk_object_set_data_full (GTK_OBJECT (zoom_resize_window), "resize_lock_button", resize_lock_button,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (resize_lock_button);
  gtk_box_pack_start (GTK_BOX (resize_xy_hbox), resize_lock_button, FALSE, FALSE, 0);
  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (resize_lock_button), TRUE);

  resize_x_hbox = gtk_hbox_new (FALSE, 0);
  gtk_widget_ref (resize_x_hbox);
  gtk_object_set_data_full (GTK_OBJECT (zoom_resize_window), "resize_x_hbox", resize_x_hbox,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (resize_x_hbox);
  gtk_box_pack_start (GTK_BOX (resize_xy_hbox), resize_x_hbox, TRUE, TRUE, 0);

  label4 = gtk_label_new ("X:");
  gtk_widget_ref (label4);
  gtk_object_set_data_full (GTK_OBJECT (zoom_resize_window), "label4", label4,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (label4);
  gtk_box_pack_start (GTK_BOX (resize_x_hbox), label4, FALSE, FALSE, 0);

  resize_x_spinbutton_adj = gtk_adjustment_new (1, 0, 10000, 1, 10, 10);
  resize_x_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (resize_x_spinbutton_adj), 1, 0);
  gtk_widget_ref (resize_x_spinbutton);
  gtk_object_set_data_full (GTK_OBJECT (zoom_resize_window), "resize_x_spinbutton", resize_x_spinbutton,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (resize_x_spinbutton);
  gtk_box_pack_start (GTK_BOX (resize_x_hbox), resize_x_spinbutton, TRUE, TRUE, 0);

  resize_y_hbox = gtk_hbox_new (FALSE, 0);
  gtk_widget_ref (resize_y_hbox);
  gtk_object_set_data_full (GTK_OBJECT (zoom_resize_window), "resize_y_hbox", resize_y_hbox,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (resize_y_hbox);
  gtk_box_pack_start (GTK_BOX (resize_xy_hbox), resize_y_hbox, TRUE, TRUE, 0);

  resize_y_label = gtk_label_new ("Y:");
  gtk_widget_ref (resize_y_label);
  gtk_object_set_data_full (GTK_OBJECT (zoom_resize_window), "resize_y_label", resize_y_label,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (resize_y_label);
  gtk_box_pack_start (GTK_BOX (resize_y_hbox), resize_y_label, FALSE, FALSE, 0);

  resize_y_spinbutton_adj = gtk_adjustment_new (1, 0, 10000, 1, 10, 10);
  resize_y_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (resize_y_spinbutton_adj), 1, 0);
  gtk_widget_ref (resize_y_spinbutton);
  gtk_object_set_data_full (GTK_OBJECT (zoom_resize_window), "resize_y_spinbutton", resize_y_spinbutton,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (resize_y_spinbutton);
  gtk_box_pack_start (GTK_BOX (resize_y_hbox), resize_y_spinbutton, TRUE, TRUE, 0);

  resize_hbuttonbox = gtk_hbutton_box_new ();
  gtk_widget_ref (resize_hbuttonbox);
  gtk_object_set_data_full (GTK_OBJECT (zoom_resize_window), "resize_hbuttonbox", resize_hbuttonbox,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (resize_hbuttonbox);
  gtk_box_pack_start (GTK_BOX (resize_vbox), resize_hbuttonbox, TRUE, TRUE, 0);
  gtk_button_box_set_layout (GTK_BUTTON_BOX (resize_hbuttonbox), GTK_BUTTONBOX_SPREAD);

  resize_apply_button = gtk_button_new_with_label ("Apply");
  gtk_widget_ref (resize_apply_button);
  gtk_object_set_data_full (GTK_OBJECT (zoom_resize_window), "resize_apply_button", resize_apply_button,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (resize_apply_button);
  gtk_container_add (GTK_CONTAINER (resize_hbuttonbox), resize_apply_button);
  GTK_WIDGET_SET_FLAGS (resize_apply_button, GTK_CAN_DEFAULT);

  resize_reset_button = gtk_button_new_with_label ("Reset");
  gtk_widget_ref (resize_reset_button);
  gtk_object_set_data_full (GTK_OBJECT (zoom_resize_window), "resize_reset_button", resize_reset_button,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (resize_reset_button);
  gtk_container_add (GTK_CONTAINER (resize_hbuttonbox), resize_reset_button);
  GTK_WIDGET_SET_FLAGS (resize_reset_button, GTK_CAN_DEFAULT);

  zoom_frame = gtk_frame_new ("Zoom (%)");
  gtk_widget_ref (zoom_frame);
  gtk_object_set_data_full (GTK_OBJECT (zoom_resize_window), "zoom_frame", zoom_frame,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (zoom_frame);
  gtk_box_pack_start (GTK_BOX (zoom_resize_vbox), zoom_frame, FALSE, FALSE, 0);
  gtk_container_set_border_width (GTK_CONTAINER (zoom_frame), 2);

  zoom_hbox = gtk_hbox_new (TRUE, 0);
  gtk_widget_ref (zoom_hbox);
  gtk_object_set_data_full (GTK_OBJECT (zoom_resize_window), "zoom_hbox", zoom_hbox,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (zoom_hbox);
  gtk_container_add (GTK_CONTAINER (zoom_frame), zoom_hbox);
  gtk_container_set_border_width (GTK_CONTAINER (zoom_hbox), 2);

  zoom_m10_button = gtk_button_new_with_label ("-10");
  gtk_widget_ref (zoom_m10_button);
  gtk_object_set_data_full (GTK_OBJECT (zoom_resize_window), "zoom_m10_button", zoom_m10_button,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (zoom_m10_button);
  gtk_box_pack_start (GTK_BOX (zoom_hbox), zoom_m10_button, FALSE, TRUE, 2);

  zoom_m5_button = gtk_button_new_with_label ("-5");
  gtk_widget_ref (zoom_m5_button);
  gtk_object_set_data_full (GTK_OBJECT (zoom_resize_window), "zoom_m5_button", zoom_m5_button,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (zoom_m5_button);
  gtk_box_pack_start (GTK_BOX (zoom_hbox), zoom_m5_button, FALSE, TRUE, 2);

  zoom_p5_button = gtk_button_new_with_label ("+5");
  gtk_widget_ref (zoom_p5_button);
  gtk_object_set_data_full (GTK_OBJECT (zoom_resize_window), "zoom_p5_button", zoom_p5_button,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (zoom_p5_button);
  gtk_box_pack_start (GTK_BOX (zoom_hbox), zoom_p5_button, FALSE, TRUE, 2);

  zoom_p10_button = gtk_button_new_with_label ("+10");
  gtk_widget_ref (zoom_p10_button);
  gtk_object_set_data_full (GTK_OBJECT (zoom_resize_window), "zoom_p10_button", zoom_p10_button,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (zoom_p10_button);
  gtk_box_pack_start (GTK_BOX (zoom_hbox), zoom_p10_button, FALSE, TRUE, 2);

  zoom_resize_separator = gtk_hseparator_new ();
  gtk_widget_ref (zoom_resize_separator);
  gtk_object_set_data_full (GTK_OBJECT (zoom_resize_window), "zoom_resize_separator", zoom_resize_separator,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (zoom_resize_separator);
  gtk_box_pack_start (GTK_BOX (zoom_resize_vbox), zoom_resize_separator, TRUE, TRUE, 0);

  zoom_close_hbuttonbox = gtk_hbutton_box_new ();
  gtk_widget_ref (zoom_close_hbuttonbox);
  gtk_object_set_data_full (GTK_OBJECT (zoom_resize_window), "zoom_close_hbuttonbox", zoom_close_hbuttonbox,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (zoom_close_hbuttonbox);
  gtk_box_pack_start (GTK_BOX (zoom_resize_vbox), zoom_close_hbuttonbox, TRUE, TRUE, 0);

  zoom_resize_close_button = gtk_button_new_with_label ("Close");
  gtk_widget_ref (zoom_resize_close_button);
  gtk_object_set_data_full (GTK_OBJECT (zoom_resize_window), "zoom_resize_close_button", zoom_resize_close_button,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (zoom_resize_close_button);
  gtk_container_add (GTK_CONTAINER (zoom_close_hbuttonbox), zoom_resize_close_button);
  GTK_WIDGET_SET_FLAGS (zoom_resize_close_button, GTK_CAN_DEFAULT);

  gtk_signal_connect (GTK_OBJECT (resize_lock_button), "toggled",
                      GTK_SIGNAL_FUNC (on_resize_lock_button_toggled),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (resize_y_spinbutton), "changed",
                      GTK_SIGNAL_FUNC (on_resize_y_spinbutton_changed),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (resize_apply_button), "clicked",
                      GTK_SIGNAL_FUNC (on_resize_apply_button_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (resize_reset_button), "clicked",
                      GTK_SIGNAL_FUNC (on_resize_reset_button_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (zoom_m10_button), "clicked",
                      GTK_SIGNAL_FUNC (on_zoom_m10_button_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (zoom_m5_button), "clicked",
                      GTK_SIGNAL_FUNC (on_zoom_m5_button_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (zoom_p5_button), "clicked",
                      GTK_SIGNAL_FUNC (on_zoom_p5_button_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (zoom_p10_button), "clicked",
                      GTK_SIGNAL_FUNC (on_zoom_p10_button_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (zoom_resize_close_button), "clicked",
                      GTK_SIGNAL_FUNC (on_zoom_resize_close_button_clicked),
                      NULL);

  return zoom_resize_window;
}

GtkWidget*
create_open_port_dialog (void)
{
  GtkWidget *open_port_dialog;
  GtkWidget *open_port_vbox;
  GtkWidget *open_port_hbox;
  GtkWidget *open_port_label;
  GtkObject *open_port_number_spin_adj;
  GtkWidget *open_port_number_spin;
  GtkWidget *open_port_separator;
  GtkWidget *open_port_hbuttonbox;
  guint open_port_ok_button_key;
  GtkWidget *open_port_ok_button;
  GtkWidget *open_port_cancel_button;
  GtkAccelGroup *accel_group;

  accel_group = gtk_accel_group_new ();

  open_port_dialog = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_object_set_data (GTK_OBJECT (open_port_dialog), "open_port_dialog", open_port_dialog);
  gtk_window_set_title (GTK_WINDOW (open_port_dialog), "Open Event Port");

  open_port_vbox = gtk_vbox_new (FALSE, 0);
  gtk_widget_ref (open_port_vbox);
  gtk_object_set_data_full (GTK_OBJECT (open_port_dialog), "open_port_vbox", open_port_vbox,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (open_port_vbox);
  gtk_container_add (GTK_CONTAINER (open_port_dialog), open_port_vbox);

  open_port_hbox = gtk_hbox_new (FALSE, 0);
  gtk_widget_ref (open_port_hbox);
  gtk_object_set_data_full (GTK_OBJECT (open_port_dialog), "open_port_hbox", open_port_hbox,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (open_port_hbox);
  gtk_box_pack_start (GTK_BOX (open_port_vbox), open_port_hbox, FALSE, FALSE, 0);
  gtk_widget_set_usize (open_port_hbox, 100, -2);

  open_port_label = gtk_label_new ("Port number");
  gtk_widget_ref (open_port_label);
  gtk_object_set_data_full (GTK_OBJECT (open_port_dialog), "open_port_label", open_port_label,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (open_port_label);
  gtk_box_pack_start (GTK_BOX (open_port_hbox), open_port_label, FALSE, FALSE, 0);
  gtk_label_set_justify (GTK_LABEL (open_port_label), GTK_JUSTIFY_RIGHT);
  gtk_misc_set_padding (GTK_MISC (open_port_label), 6, 6);

  open_port_number_spin_adj = gtk_adjustment_new (1996, 0, 32767, 1, 10, 10);
  open_port_number_spin = gtk_spin_button_new (GTK_ADJUSTMENT (open_port_number_spin_adj), 1, 0);
  gtk_widget_ref (open_port_number_spin);
  gtk_object_set_data_full (GTK_OBJECT (open_port_dialog), "open_port_number_spin", open_port_number_spin,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (open_port_number_spin);
  gtk_box_pack_start (GTK_BOX (open_port_hbox), open_port_number_spin, FALSE, FALSE, 0);
  gtk_widget_set_usize (open_port_number_spin, 80, -2);
  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (open_port_number_spin), TRUE);
  gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (open_port_number_spin), TRUE);

  open_port_separator = gtk_hseparator_new ();
  gtk_widget_ref (open_port_separator);
  gtk_object_set_data_full (GTK_OBJECT (open_port_dialog), "open_port_separator", open_port_separator,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (open_port_separator);
  gtk_box_pack_start (GTK_BOX (open_port_vbox), open_port_separator, FALSE, TRUE, 2);

  open_port_hbuttonbox = gtk_hbutton_box_new ();
  gtk_widget_ref (open_port_hbuttonbox);
  gtk_object_set_data_full (GTK_OBJECT (open_port_dialog), "open_port_hbuttonbox", open_port_hbuttonbox,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (open_port_hbuttonbox);
  gtk_box_pack_end (GTK_BOX (open_port_vbox), open_port_hbuttonbox, FALSE, FALSE, 0);
  gtk_button_box_set_layout (GTK_BUTTON_BOX (open_port_hbuttonbox), GTK_BUTTONBOX_SPREAD);
  gtk_button_box_set_child_size (GTK_BUTTON_BOX (open_port_hbuttonbox), 60, 30);
  gtk_button_box_set_child_ipadding (GTK_BUTTON_BOX (open_port_hbuttonbox), 8, 0);

  open_port_ok_button = gtk_button_new_with_label ("");
  open_port_ok_button_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (open_port_ok_button)->child),
                                   "_Ok");
  gtk_widget_add_accelerator (open_port_ok_button, "clicked", accel_group,
                              open_port_ok_button_key, GDK_MOD1_MASK, (GtkAccelFlags) 0);
  gtk_widget_ref (open_port_ok_button);
  gtk_object_set_data_full (GTK_OBJECT (open_port_dialog), "open_port_ok_button", open_port_ok_button,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (open_port_ok_button);
  gtk_container_add (GTK_CONTAINER (open_port_hbuttonbox), open_port_ok_button);
  GTK_WIDGET_SET_FLAGS (open_port_ok_button, GTK_CAN_DEFAULT);

  open_port_cancel_button = gtk_button_new_with_label ("Cancel");
  gtk_widget_ref (open_port_cancel_button);
  gtk_object_set_data_full (GTK_OBJECT (open_port_dialog), "open_port_cancel_button", open_port_cancel_button,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (open_port_cancel_button);
  gtk_container_add (GTK_CONTAINER (open_port_hbuttonbox), open_port_cancel_button);
  GTK_WIDGET_SET_FLAGS (open_port_cancel_button, GTK_CAN_DEFAULT);

  gtk_signal_connect (GTK_OBJECT (open_port_ok_button), "clicked",
                      GTK_SIGNAL_FUNC (on_open_port_ok_button_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (open_port_cancel_button), "clicked",
                      GTK_SIGNAL_FUNC (on_open_port_cancel_button_clicked),
                      NULL);

  gtk_window_add_accel_group (GTK_WINDOW (open_port_dialog), accel_group);

  return open_port_dialog;
}

GtkWidget*
create_quit_dialog (void)
{
  GtkWidget *quit_dialog;
  GtkWidget *quit_vibox;
  GtkWidget *confirm_quit_label;
  GtkWidget *quit_dialog_action_area;
  GtkWidget *quit_hbuttonbox;
  GtkWidget *quit_quit_button;
  GtkWidget *quit_cancel_button;

  quit_dialog = gtk_dialog_new ();
  gtk_object_set_data (GTK_OBJECT (quit_dialog), "quit_dialog", quit_dialog);
  gtk_widget_set_usize (quit_dialog, 200, 100);
  gtk_window_set_title (GTK_WINDOW (quit_dialog), "Confirm Quit");
  gtk_window_set_policy (GTK_WINDOW (quit_dialog), TRUE, TRUE, FALSE);

  quit_vibox = GTK_DIALOG (quit_dialog)->vbox;
  gtk_object_set_data (GTK_OBJECT (quit_dialog), "quit_vibox", quit_vibox);
  gtk_widget_show (quit_vibox);

  confirm_quit_label = gtk_label_new ("Are you sure you want to quit?");
  gtk_widget_ref (confirm_quit_label);
  gtk_object_set_data_full (GTK_OBJECT (quit_dialog), "confirm_quit_label", confirm_quit_label,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (confirm_quit_label);
  gtk_box_pack_start (GTK_BOX (quit_vibox), confirm_quit_label, TRUE, TRUE, 0);

  quit_dialog_action_area = GTK_DIALOG (quit_dialog)->action_area;
  gtk_object_set_data (GTK_OBJECT (quit_dialog), "quit_dialog_action_area", quit_dialog_action_area);
  gtk_widget_show (quit_dialog_action_area);
  gtk_container_set_border_width (GTK_CONTAINER (quit_dialog_action_area), 10);

  quit_hbuttonbox = gtk_hbutton_box_new ();
  gtk_widget_ref (quit_hbuttonbox);
  gtk_object_set_data_full (GTK_OBJECT (quit_dialog), "quit_hbuttonbox", quit_hbuttonbox,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (quit_hbuttonbox);
  gtk_box_pack_start (GTK_BOX (quit_dialog_action_area), quit_hbuttonbox, TRUE, TRUE, 0);
  gtk_button_box_set_layout (GTK_BUTTON_BOX (quit_hbuttonbox), GTK_BUTTONBOX_EDGE);

  quit_quit_button = gtk_button_new_with_label ("Quit");
  gtk_widget_ref (quit_quit_button);
  gtk_object_set_data_full (GTK_OBJECT (quit_dialog), "quit_quit_button", quit_quit_button,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (quit_quit_button);
  gtk_container_add (GTK_CONTAINER (quit_hbuttonbox), quit_quit_button);
  GTK_WIDGET_SET_FLAGS (quit_quit_button, GTK_CAN_DEFAULT);

  quit_cancel_button = gtk_button_new_with_label ("Cancel");
  gtk_widget_ref (quit_cancel_button);
  gtk_object_set_data_full (GTK_OBJECT (quit_dialog), "quit_cancel_button", quit_cancel_button,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (quit_cancel_button);
  gtk_container_add (GTK_CONTAINER (quit_hbuttonbox), quit_cancel_button);
  GTK_WIDGET_SET_FLAGS (quit_cancel_button, GTK_CAN_DEFAULT);

  gtk_signal_connect (GTK_OBJECT (quit_quit_button), "clicked",
                      GTK_SIGNAL_FUNC (on_quit_quit_button_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (quit_cancel_button), "clicked",
                      GTK_SIGNAL_FUNC (on_quit_cancel_button_clicked),
                      NULL);

  return quit_dialog;
}

GtkWidget*
create_about_dialog (void)
{
  GtkWidget *about_dialog;
  GtkWidget *about_dialog_vbox;
  GtkWidget *about_pixmap;
  GtkWidget *about_label;
  GtkWidget *about_action_area;
  GtkWidget *about_hbuttonbox;
  guint about_close_button_key;
  GtkWidget *about_close_button;
  GtkAccelGroup *accel_group;

  accel_group = gtk_accel_group_new ();

  about_dialog = gtk_dialog_new ();
  gtk_object_set_data (GTK_OBJECT (about_dialog), "about_dialog", about_dialog);
  gtk_window_set_title (GTK_WINDOW (about_dialog), "Siena Monitor");
  gtk_window_set_policy (GTK_WINDOW (about_dialog), TRUE, TRUE, FALSE);

  about_dialog_vbox = GTK_DIALOG (about_dialog)->vbox;
  gtk_object_set_data (GTK_OBJECT (about_dialog), "about_dialog_vbox", about_dialog_vbox);
  gtk_widget_show (about_dialog_vbox);
  gtk_container_set_border_width (GTK_CONTAINER (about_dialog_vbox), 10);

  about_pixmap = create_pixmap (about_dialog, NULL);
  gtk_widget_ref (about_pixmap);
  gtk_object_set_data_full (GTK_OBJECT (about_dialog), "about_pixmap", about_pixmap,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (about_pixmap);
  gtk_box_pack_start (GTK_BOX (about_dialog_vbox), about_pixmap, TRUE, TRUE, 0);

  about_label = gtk_label_new ("Siena is a Content-based Networking Project\nhttp://www.cs.colorado.edu/serl/siena/\n\nContact:\nAntonio Carzaniga <carzanig@cs.colorado.edu>\nSoftware Engineering Research Laboratory\nUniversity of Colorado");
  gtk_widget_ref (about_label);
  gtk_object_set_data_full (GTK_OBJECT (about_dialog), "about_label", about_label,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (about_label);
  gtk_box_pack_start (GTK_BOX (about_dialog_vbox), about_label, FALSE, FALSE, 10);

  about_action_area = GTK_DIALOG (about_dialog)->action_area;
  gtk_object_set_data (GTK_OBJECT (about_dialog), "about_action_area", about_action_area);
  gtk_widget_show (about_action_area);
  gtk_container_set_border_width (GTK_CONTAINER (about_action_area), 10);

  about_hbuttonbox = gtk_hbutton_box_new ();
  gtk_widget_ref (about_hbuttonbox);
  gtk_object_set_data_full (GTK_OBJECT (about_dialog), "about_hbuttonbox", about_hbuttonbox,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (about_hbuttonbox);
  gtk_box_pack_start (GTK_BOX (about_action_area), about_hbuttonbox, TRUE, TRUE, 0);

  about_close_button = gtk_button_new_with_label ("");
  about_close_button_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (about_close_button)->child),
                                   "_Close");
  gtk_widget_add_accelerator (about_close_button, "clicked", accel_group,
                              about_close_button_key, GDK_MOD1_MASK, (GtkAccelFlags) 0);
  gtk_widget_ref (about_close_button);
  gtk_object_set_data_full (GTK_OBJECT (about_dialog), "about_close_button", about_close_button,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (about_close_button);
  gtk_container_add (GTK_CONTAINER (about_hbuttonbox), about_close_button);
  GTK_WIDGET_SET_FLAGS (about_close_button, GTK_CAN_DEFAULT);

  gtk_signal_connect (GTK_OBJECT (about_close_button), "clicked",
                      GTK_SIGNAL_FUNC (on_about_close_button_clicked),
                      NULL);

  gtk_window_add_accel_group (GTK_WINDOW (about_dialog), accel_group);

  return about_dialog;
}

GtkWidget*
create_error_dialog (void)
{
  GtkWidget *error_dialog;
  GtkWidget *error_dialog_vbox;
  GtkWidget *error_label;
  GtkWidget *error_action_area;
  GtkWidget *error_hbuttonbox;
  guint error_close_button_key;
  GtkWidget *error_close_button;
  GtkAccelGroup *accel_group;

  accel_group = gtk_accel_group_new ();

  error_dialog = gtk_dialog_new ();
  gtk_object_set_data (GTK_OBJECT (error_dialog), "error_dialog", error_dialog);
  gtk_window_set_title (GTK_WINDOW (error_dialog), "Error");
  gtk_window_set_modal (GTK_WINDOW (error_dialog), TRUE);
  gtk_window_set_policy (GTK_WINDOW (error_dialog), TRUE, TRUE, FALSE);

  error_dialog_vbox = GTK_DIALOG (error_dialog)->vbox;
  gtk_object_set_data (GTK_OBJECT (error_dialog), "error_dialog_vbox", error_dialog_vbox);
  gtk_widget_show (error_dialog_vbox);

  error_label = gtk_label_new ("Error");
  gtk_widget_ref (error_label);
  gtk_object_set_data_full (GTK_OBJECT (error_dialog), "error_label", error_label,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (error_label);
  gtk_box_pack_start (GTK_BOX (error_dialog_vbox), error_label, FALSE, FALSE, 0);
  gtk_misc_set_padding (GTK_MISC (error_label), 10, 10);

  error_action_area = GTK_DIALOG (error_dialog)->action_area;
  gtk_object_set_data (GTK_OBJECT (error_dialog), "error_action_area", error_action_area);
  gtk_widget_show (error_action_area);
  gtk_container_set_border_width (GTK_CONTAINER (error_action_area), 10);

  error_hbuttonbox = gtk_hbutton_box_new ();
  gtk_widget_ref (error_hbuttonbox);
  gtk_object_set_data_full (GTK_OBJECT (error_dialog), "error_hbuttonbox", error_hbuttonbox,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (error_hbuttonbox);
  gtk_box_pack_start (GTK_BOX (error_action_area), error_hbuttonbox, TRUE, TRUE, 0);

  error_close_button = gtk_button_new_with_label ("");
  error_close_button_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (error_close_button)->child),
                                   "_Close");
  gtk_widget_add_accelerator (error_close_button, "clicked", accel_group,
                              error_close_button_key, GDK_MOD1_MASK, (GtkAccelFlags) 0);
  gtk_widget_ref (error_close_button);
  gtk_object_set_data_full (GTK_OBJECT (error_dialog), "error_close_button", error_close_button,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (error_close_button);
  gtk_container_add (GTK_CONTAINER (error_hbuttonbox), error_close_button);
  GTK_WIDGET_SET_FLAGS (error_close_button, GTK_CAN_DEFAULT);

  gtk_signal_connect (GTK_OBJECT (error_close_button), "clicked",
                      GTK_SIGNAL_FUNC (on_error_close_button_clicked),
                      NULL);

  gtk_window_add_accel_group (GTK_WINDOW (error_dialog), accel_group);

  return error_dialog;
}

GtkWidget*
create_anim_param_window (void)
{
  GtkWidget *anim_param_window;
  GtkWidget *anim_param_vbox;
  GtkWidget *anim_speed_hbox;
  GtkWidget *anim_time_hbox;
  GtkWidget *anim_time_label;
  GtkObject *anim_time_spinbutton_adj;
  GtkWidget *anim_time_spinbutton;
  GtkWidget *anim_steps_hbox;
  GtkWidget *anim_steps_label;
  GtkObject *anim_steps_spinbutton_adj;
  GtkWidget *anim_steps_spinbutton;
  GtkWidget *anim_param_separator;
  GtkWidget *anim_param_hbox;
  GtkWidget *anim_param_buttons;
  GtkWidget *anim_param_apply;
  GtkWidget *anim_param_close;

  anim_param_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_object_set_data (GTK_OBJECT (anim_param_window), "anim_param_window", anim_param_window);
  gtk_window_set_title (GTK_WINDOW (anim_param_window), "Animation Parameters");

  anim_param_vbox = gtk_vbox_new (FALSE, 0);
  gtk_widget_ref (anim_param_vbox);
  gtk_object_set_data_full (GTK_OBJECT (anim_param_window), "anim_param_vbox", anim_param_vbox,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (anim_param_vbox);
  gtk_container_add (GTK_CONTAINER (anim_param_window), anim_param_vbox);

  anim_speed_hbox = gtk_hbox_new (FALSE, 0);
  gtk_widget_ref (anim_speed_hbox);
  gtk_object_set_data_full (GTK_OBJECT (anim_param_window), "anim_speed_hbox", anim_speed_hbox,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (anim_speed_hbox);
  gtk_box_pack_start (GTK_BOX (anim_param_vbox), anim_speed_hbox, TRUE, TRUE, 0);

  anim_time_hbox = gtk_hbox_new (FALSE, 0);
  gtk_widget_ref (anim_time_hbox);
  gtk_object_set_data_full (GTK_OBJECT (anim_param_window), "anim_time_hbox", anim_time_hbox,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (anim_time_hbox);
  gtk_box_pack_start (GTK_BOX (anim_speed_hbox), anim_time_hbox, TRUE, TRUE, 0);

  anim_time_label = gtk_label_new ("duration (ms):");
  gtk_widget_ref (anim_time_label);
  gtk_object_set_data_full (GTK_OBJECT (anim_param_window), "anim_time_label", anim_time_label,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (anim_time_label);
  gtk_box_pack_start (GTK_BOX (anim_time_hbox), anim_time_label, FALSE, FALSE, 0);
  gtk_label_set_justify (GTK_LABEL (anim_time_label), GTK_JUSTIFY_RIGHT);
  gtk_misc_set_padding (GTK_MISC (anim_time_label), 3, 0);

  anim_time_spinbutton_adj = gtk_adjustment_new (500, 10, 10000, 10, 100, 100);
  anim_time_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (anim_time_spinbutton_adj), 1, 0);
  gtk_widget_ref (anim_time_spinbutton);
  gtk_object_set_data_full (GTK_OBJECT (anim_param_window), "anim_time_spinbutton", anim_time_spinbutton,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (anim_time_spinbutton);
  gtk_box_pack_start (GTK_BOX (anim_time_hbox), anim_time_spinbutton, TRUE, TRUE, 0);

  anim_steps_hbox = gtk_hbox_new (FALSE, 0);
  gtk_widget_ref (anim_steps_hbox);
  gtk_object_set_data_full (GTK_OBJECT (anim_param_window), "anim_steps_hbox", anim_steps_hbox,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (anim_steps_hbox);
  gtk_box_pack_start (GTK_BOX (anim_speed_hbox), anim_steps_hbox, TRUE, TRUE, 0);

  anim_steps_label = gtk_label_new ("steps");
  gtk_widget_ref (anim_steps_label);
  gtk_object_set_data_full (GTK_OBJECT (anim_param_window), "anim_steps_label", anim_steps_label,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (anim_steps_label);
  gtk_box_pack_start (GTK_BOX (anim_steps_hbox), anim_steps_label, FALSE, FALSE, 0);
  gtk_label_set_justify (GTK_LABEL (anim_steps_label), GTK_JUSTIFY_RIGHT);
  gtk_misc_set_padding (GTK_MISC (anim_steps_label), 5, 0);

  anim_steps_spinbutton_adj = gtk_adjustment_new (10, 1, 100, 1, 10, 10);
  anim_steps_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (anim_steps_spinbutton_adj), 1, 0);
  gtk_widget_ref (anim_steps_spinbutton);
  gtk_object_set_data_full (GTK_OBJECT (anim_param_window), "anim_steps_spinbutton", anim_steps_spinbutton,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (anim_steps_spinbutton);
  gtk_box_pack_start (GTK_BOX (anim_steps_hbox), anim_steps_spinbutton, TRUE, TRUE, 0);

  anim_param_separator = gtk_hseparator_new ();
  gtk_widget_ref (anim_param_separator);
  gtk_object_set_data_full (GTK_OBJECT (anim_param_window), "anim_param_separator", anim_param_separator,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (anim_param_separator);
  gtk_box_pack_start (GTK_BOX (anim_param_vbox), anim_param_separator, TRUE, TRUE, 0);

  anim_param_hbox = gtk_hbox_new (TRUE, 5);
  gtk_widget_ref (anim_param_hbox);
  gtk_object_set_data_full (GTK_OBJECT (anim_param_window), "anim_param_hbox", anim_param_hbox,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (anim_param_hbox);
  gtk_box_pack_start (GTK_BOX (anim_param_vbox), anim_param_hbox, TRUE, TRUE, 0);

  anim_param_buttons = gtk_hbutton_box_new ();
  gtk_widget_ref (anim_param_buttons);
  gtk_object_set_data_full (GTK_OBJECT (anim_param_window), "anim_param_buttons", anim_param_buttons,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (anim_param_buttons);
  gtk_box_pack_start (GTK_BOX (anim_param_hbox), anim_param_buttons, TRUE, TRUE, 0);
  gtk_container_set_border_width (GTK_CONTAINER (anim_param_buttons), 5);

  anim_param_apply = gtk_button_new_with_label ("Apply");
  gtk_widget_ref (anim_param_apply);
  gtk_object_set_data_full (GTK_OBJECT (anim_param_window), "anim_param_apply", anim_param_apply,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (anim_param_apply);
  gtk_container_add (GTK_CONTAINER (anim_param_buttons), anim_param_apply);
  GTK_WIDGET_SET_FLAGS (anim_param_apply, GTK_CAN_DEFAULT);

  anim_param_close = gtk_button_new_with_label ("Close");
  gtk_widget_ref (anim_param_close);
  gtk_object_set_data_full (GTK_OBJECT (anim_param_window), "anim_param_close", anim_param_close,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (anim_param_close);
  gtk_container_add (GTK_CONTAINER (anim_param_buttons), anim_param_close);
  GTK_WIDGET_SET_FLAGS (anim_param_close, GTK_CAN_DEFAULT);

  gtk_signal_connect (GTK_OBJECT (anim_param_apply), "clicked",
                      GTK_SIGNAL_FUNC (on_anim_param_apply_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (anim_param_close), "clicked",
                      GTK_SIGNAL_FUNC (on_anim_param_close_clicked),
                      NULL);

  return anim_param_window;
}

GtkWidget*
create_error_log_window (void)
{
  GtkWidget *error_log_window;
  GtkWidget *error_log_vbox;
  GtkWidget *scrolledwindow1;
  GtkWidget *error_log_text;
  GtkWidget *error_log_hbuttonbox;
  GtkWidget *error_log_close_button;

  error_log_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_object_set_data (GTK_OBJECT (error_log_window), "error_log_window", error_log_window);
  gtk_window_set_title (GTK_WINDOW (error_log_window), "Errors");
  gtk_window_set_default_size (GTK_WINDOW (error_log_window), 500, 400);

  error_log_vbox = gtk_vbox_new (FALSE, 0);
  gtk_widget_ref (error_log_vbox);
  gtk_object_set_data_full (GTK_OBJECT (error_log_window), "error_log_vbox", error_log_vbox,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (error_log_vbox);
  gtk_container_add (GTK_CONTAINER (error_log_window), error_log_vbox);

  scrolledwindow1 = gtk_scrolled_window_new (NULL, NULL);
  gtk_widget_ref (scrolledwindow1);
  gtk_object_set_data_full (GTK_OBJECT (error_log_window), "scrolledwindow1", scrolledwindow1,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (scrolledwindow1);
  gtk_box_pack_start (GTK_BOX (error_log_vbox), scrolledwindow1, TRUE, TRUE, 0);
  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow1), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);

  error_log_text = gtk_text_new (NULL, NULL);
  gtk_widget_ref (error_log_text);
  gtk_object_set_data_full (GTK_OBJECT (error_log_window), "error_log_text", error_log_text,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (error_log_text);
  gtk_container_add (GTK_CONTAINER (scrolledwindow1), error_log_text);

  error_log_hbuttonbox = gtk_hbutton_box_new ();
  gtk_widget_ref (error_log_hbuttonbox);
  gtk_object_set_data_full (GTK_OBJECT (error_log_window), "error_log_hbuttonbox", error_log_hbuttonbox,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (error_log_hbuttonbox);
  gtk_box_pack_start (GTK_BOX (error_log_vbox), error_log_hbuttonbox, FALSE, TRUE, 0);

  error_log_close_button = gtk_button_new_with_label ("Close");
  gtk_widget_ref (error_log_close_button);
  gtk_object_set_data_full (GTK_OBJECT (error_log_window), "error_log_close_button", error_log_close_button,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (error_log_close_button);
  gtk_container_add (GTK_CONTAINER (error_log_hbuttonbox), error_log_close_button);
  GTK_WIDGET_SET_FLAGS (error_log_close_button, GTK_CAN_DEFAULT);

  gtk_signal_connect (GTK_OBJECT (error_log_close_button), "clicked",
                      GTK_SIGNAL_FUNC (on_error_log_close_button_clicked),
                      NULL);

  return error_log_window;
}

GtkWidget*
create_graph_popup_menu (void)
{
  GtkWidget *graph_popup_menu;
  GtkAccelGroup *graph_popup_menu_accels;
  GtkWidget *graph_p_redraw;
  guint tmp_key;
  GtkWidget *graph_p_implicit;
  GtkWidget *graph_p_separator1;
  GtkWidget *graph_p_labels;
  GtkWidget *graph_p_notifications;
  GtkWidget *graph_p_subscriptions;
  GtkWidget *graph_p_unsubscriptions;
  GtkWidget *graph_p_advertisements_b;
  GtkWidget *graph_p_unadvertisements_b;
  GtkWidget *graph_p_separator2;
  GtkWidget *graph_p_delete_node;
  GtkWidget *graph_p_clear_graph;
  GtkAccelGroup *accel_group;
  GtkTooltips *tooltips;

  tooltips = gtk_tooltips_new ();

  accel_group = gtk_accel_group_new ();

  graph_popup_menu = gtk_menu_new ();
  gtk_object_set_data (GTK_OBJECT (graph_popup_menu), "graph_popup_menu", graph_popup_menu);
  graph_popup_menu_accels = gtk_menu_ensure_uline_accel_group (GTK_MENU (graph_popup_menu));

  graph_p_redraw = gtk_menu_item_new_with_label ("Redraw");
  gtk_widget_ref (graph_p_redraw);
  gtk_object_set_data_full (GTK_OBJECT (graph_popup_menu), "graph_p_redraw", graph_p_redraw,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (graph_p_redraw);
  gtk_container_add (GTK_CONTAINER (graph_popup_menu), graph_p_redraw);
  gtk_tooltips_set_tip (tooltips, graph_p_redraw, "redraw the graph", NULL);
  gtk_widget_add_accelerator (graph_p_redraw, "activate", accel_group,
                              GDK_L, GDK_CONTROL_MASK,
                              GTK_ACCEL_VISIBLE);

  graph_p_implicit = gtk_check_menu_item_new_with_label ("");
  tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (graph_p_implicit)->child),
                                   "_Implicit Node Creation");
  gtk_widget_add_accelerator (graph_p_implicit, "activate_item", graph_popup_menu_accels,
                              tmp_key, 0, 0);
  gtk_widget_ref (graph_p_implicit);
  gtk_object_set_data_full (GTK_OBJECT (graph_popup_menu), "graph_p_implicit", graph_p_implicit,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (graph_p_implicit);
  gtk_container_add (GTK_CONTAINER (graph_popup_menu), graph_p_implicit);
  gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (graph_p_implicit), TRUE);
  gtk_check_menu_item_set_show_toggle (GTK_CHECK_MENU_ITEM (graph_p_implicit), TRUE);

  graph_p_separator1 = gtk_menu_item_new ();
  gtk_widget_ref (graph_p_separator1);
  gtk_object_set_data_full (GTK_OBJECT (graph_popup_menu), "graph_p_separator1", graph_p_separator1,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (graph_p_separator1);
  gtk_container_add (GTK_CONTAINER (graph_popup_menu), graph_p_separator1);
  gtk_widget_set_sensitive (graph_p_separator1, FALSE);

  graph_p_labels = gtk_check_menu_item_new_with_label ("");
  tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (graph_p_labels)->child),
                                   "_Labels");
  gtk_widget_add_accelerator (graph_p_labels, "activate_item", graph_popup_menu_accels,
                              tmp_key, 0, 0);
  gtk_widget_ref (graph_p_labels);
  gtk_object_set_data_full (GTK_OBJECT (graph_popup_menu), "graph_p_labels", graph_p_labels,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (graph_p_labels);
  gtk_container_add (GTK_CONTAINER (graph_popup_menu), graph_p_labels);
  gtk_tooltips_set_tip (tooltips, graph_p_labels, "Toggle visualization of node labels", NULL);
  gtk_check_menu_item_set_show_toggle (GTK_CHECK_MENU_ITEM (graph_p_labels), TRUE);

  graph_p_notifications = gtk_check_menu_item_new_with_label ("");
  tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (graph_p_notifications)->child),
                                   "_Notifications");
  gtk_widget_add_accelerator (graph_p_notifications, "activate_item", graph_popup_menu_accels,
                              tmp_key, 0, 0);
  gtk_widget_ref (graph_p_notifications);
  gtk_object_set_data_full (GTK_OBJECT (graph_popup_menu), "graph_p_notifications", graph_p_notifications,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (graph_p_notifications);
  gtk_container_add (GTK_CONTAINER (graph_popup_menu), graph_p_notifications);
  gtk_tooltips_set_tip (tooltips, graph_p_notifications, "toggle animation of notifications", NULL);
  gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (graph_p_notifications), TRUE);
  gtk_check_menu_item_set_show_toggle (GTK_CHECK_MENU_ITEM (graph_p_notifications), TRUE);

  graph_p_subscriptions = gtk_check_menu_item_new_with_label ("");
  tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (graph_p_subscriptions)->child),
                                   "_Subscriptions");
  gtk_widget_add_accelerator (graph_p_subscriptions, "activate_item", graph_popup_menu_accels,
                              tmp_key, 0, 0);
  gtk_widget_ref (graph_p_subscriptions);
  gtk_object_set_data_full (GTK_OBJECT (graph_popup_menu), "graph_p_subscriptions", graph_p_subscriptions,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (graph_p_subscriptions);
  gtk_container_add (GTK_CONTAINER (graph_popup_menu), graph_p_subscriptions);
  gtk_tooltips_set_tip (tooltips, graph_p_subscriptions, "toggle animation of subscriptions", NULL);
  gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (graph_p_subscriptions), TRUE);
  gtk_check_menu_item_set_show_toggle (GTK_CHECK_MENU_ITEM (graph_p_subscriptions), TRUE);

  graph_p_unsubscriptions = gtk_check_menu_item_new_with_label ("");
  tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (graph_p_unsubscriptions)->child),
                                   "_Unsubscriptions");
  gtk_widget_add_accelerator (graph_p_unsubscriptions, "activate_item", graph_popup_menu_accels,
                              tmp_key, 0, 0);
  gtk_widget_ref (graph_p_unsubscriptions);
  gtk_object_set_data_full (GTK_OBJECT (graph_popup_menu), "graph_p_unsubscriptions", graph_p_unsubscriptions,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (graph_p_unsubscriptions);
  gtk_container_add (GTK_CONTAINER (graph_popup_menu), graph_p_unsubscriptions);
  gtk_tooltips_set_tip (tooltips, graph_p_unsubscriptions, "toggle animation of unsubscriptions", NULL);
  gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (graph_p_unsubscriptions), TRUE);
  gtk_check_menu_item_set_show_toggle (GTK_CHECK_MENU_ITEM (graph_p_unsubscriptions), TRUE);

  graph_p_advertisements_b = gtk_check_menu_item_new_with_label ("");
  tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (graph_p_advertisements_b)->child),
                                   "_Advertisements");
  gtk_widget_add_accelerator (graph_p_advertisements_b, "activate_item", graph_popup_menu_accels,
                              tmp_key, 0, 0);
  gtk_widget_ref (graph_p_advertisements_b);
  gtk_object_set_data_full (GTK_OBJECT (graph_popup_menu), "graph_p_advertisements_b", graph_p_advertisements_b,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (graph_p_advertisements_b);
  gtk_container_add (GTK_CONTAINER (graph_popup_menu), graph_p_advertisements_b);
  gtk_check_menu_item_set_show_toggle (GTK_CHECK_MENU_ITEM (graph_p_advertisements_b), TRUE);

  graph_p_unadvertisements_b = gtk_check_menu_item_new_with_label ("");
  tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (graph_p_unadvertisements_b)->child),
                                   "Una_dvertisements");
  gtk_widget_add_accelerator (graph_p_unadvertisements_b, "activate_item", graph_popup_menu_accels,
                              tmp_key, 0, 0);
  gtk_widget_ref (graph_p_unadvertisements_b);
  gtk_object_set_data_full (GTK_OBJECT (graph_popup_menu), "graph_p_unadvertisements_b", graph_p_unadvertisements_b,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (graph_p_unadvertisements_b);
  gtk_container_add (GTK_CONTAINER (graph_popup_menu), graph_p_unadvertisements_b);
  gtk_check_menu_item_set_show_toggle (GTK_CHECK_MENU_ITEM (graph_p_unadvertisements_b), TRUE);

  graph_p_separator2 = gtk_menu_item_new ();
  gtk_widget_ref (graph_p_separator2);
  gtk_object_set_data_full (GTK_OBJECT (graph_popup_menu), "graph_p_separator2", graph_p_separator2,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (graph_p_separator2);
  gtk_container_add (GTK_CONTAINER (graph_popup_menu), graph_p_separator2);
  gtk_widget_set_sensitive (graph_p_separator2, FALSE);

  graph_p_delete_node = gtk_menu_item_new_with_label ("Delete Node");
  gtk_widget_ref (graph_p_delete_node);
  gtk_object_set_data_full (GTK_OBJECT (graph_popup_menu), "graph_p_delete_node", graph_p_delete_node,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (graph_p_delete_node);
  gtk_container_add (GTK_CONTAINER (graph_popup_menu), graph_p_delete_node);
  gtk_tooltips_set_tip (tooltips, graph_p_delete_node, "delete the node at this position", NULL);

  graph_p_clear_graph = gtk_menu_item_new_with_label ("Clear Graph");
  gtk_widget_ref (graph_p_clear_graph);
  gtk_object_set_data_full (GTK_OBJECT (graph_popup_menu), "graph_p_clear_graph", graph_p_clear_graph,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (graph_p_clear_graph);
  gtk_container_add (GTK_CONTAINER (graph_popup_menu), graph_p_clear_graph);
  gtk_tooltips_set_tip (tooltips, graph_p_clear_graph, "deletes all nodes and links", NULL);

  gtk_signal_connect (GTK_OBJECT (graph_p_redraw), "activate",
                      GTK_SIGNAL_FUNC (on_graph_p_redraw_activate),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (graph_p_labels), "activate",
                      GTK_SIGNAL_FUNC (on_graph_p_labels_activate),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (graph_p_delete_node), "activate",
                      GTK_SIGNAL_FUNC (on_graph_p_delete_node_activate),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (graph_p_clear_graph), "activate",
                      GTK_SIGNAL_FUNC (on_graph_p_clear_graph_activate),
                      NULL);

  gtk_object_set_data (GTK_OBJECT (graph_popup_menu), "tooltips", tooltips);

  gtk_menu_set_accel_group (GTK_MENU (graph_popup_menu), accel_group);

  return graph_popup_menu;
}

