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

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

#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_ioconfiglinux ()
{
  GtkWidget *ioconfiglinux;
  GtkWidget *vbox1;
  GtkWidget *frame3;
  GtkWidget *table3;
  GtkWidget *sndrecord;
  GList *sndrecord_items = NULL;
  GtkWidget *sndplayback;
  GList *sndplayback_items = NULL;
  GtkWidget *label5;
  GtkWidget *label6;
  GtkWidget *frame1;
  GtkWidget *table2;
  GtkWidget *ioaddr;
  GList *ioaddr_items = NULL;
  GtkWidget *devfile;
  GList *devfile_items = NULL;
  GtkWidget *label2;
  GtkWidget *label3;
  GtkWidget *label1;
  GSList *drivergroup_group = NULL;
  GtkWidget *drvdirect;
  GtkWidget *drvppdev;
  GtkWidget *frame2;
  GtkWidget *table1;
  GtkWidget *fpgaclk;
  GList *fpgaclk_items = NULL;
  GtkWidget *label4;
  GtkWidget *hbuttonbox1;
  GtkWidget *buttonok;
  GtkWidget *buttonquit;
  GtkTooltips *tooltips;

  tooltips = gtk_tooltips_new ();

  ioconfiglinux = gtk_window_new (GTK_WINDOW_DIALOG);
  gtk_widget_set_name (ioconfiglinux, "ioconfiglinux");
  gtk_widget_ref (ioconfiglinux);
  gtk_object_set_data_full (GTK_OBJECT (ioconfiglinux), "ioconfiglinux", ioconfiglinux,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_window_set_title (GTK_WINDOW (ioconfiglinux), _("EPPFM Input/Output Configuration"));

  vbox1 = gtk_vbox_new (FALSE, 0);
  gtk_widget_set_name (vbox1, "vbox1");
  gtk_widget_ref (vbox1);
  gtk_object_set_data_full (GTK_OBJECT (ioconfiglinux), "vbox1", vbox1,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (vbox1);
  gtk_container_add (GTK_CONTAINER (ioconfiglinux), vbox1);

  frame3 = gtk_frame_new (_("Soundcard Settings"));
  gtk_widget_set_name (frame3, "frame3");
  gtk_widget_ref (frame3);
  gtk_object_set_data_full (GTK_OBJECT (ioconfiglinux), "frame3", frame3,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (frame3);
  gtk_box_pack_start (GTK_BOX (vbox1), frame3, TRUE, TRUE, 0);
  gtk_container_set_border_width (GTK_CONTAINER (frame3), 5);

  table3 = gtk_table_new (2, 2, FALSE);
  gtk_widget_set_name (table3, "table3");
  gtk_widget_ref (table3);
  gtk_object_set_data_full (GTK_OBJECT (ioconfiglinux), "table3", table3,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (table3);
  gtk_container_add (GTK_CONTAINER (frame3), table3);

  sndrecord = gtk_combo_new ();
  gtk_widget_set_name (sndrecord, "sndrecord");
  gtk_widget_ref (sndrecord);
  gtk_object_set_data_full (GTK_OBJECT (ioconfiglinux), "sndrecord", sndrecord,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (sndrecord);
  gtk_table_attach (GTK_TABLE (table3), sndrecord, 1, 2, 0, 1,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_container_set_border_width (GTK_CONTAINER (sndrecord), 3);
  gtk_combo_set_case_sensitive (GTK_COMBO (sndrecord), TRUE);
  sndrecord_items = g_list_append (sndrecord_items, _("/dev/dsp"));
  sndrecord_items = g_list_append (sndrecord_items, _("/dev/dsp1"));
  gtk_combo_set_popdown_strings (GTK_COMBO (sndrecord), sndrecord_items);
  g_list_free (sndrecord_items);

  sndplayback = gtk_combo_new ();
  gtk_widget_set_name (sndplayback, "sndplayback");
  gtk_widget_ref (sndplayback);
  gtk_object_set_data_full (GTK_OBJECT (ioconfiglinux), "sndplayback", sndplayback,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (sndplayback);
  gtk_table_attach (GTK_TABLE (table3), sndplayback, 1, 2, 1, 2,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_container_set_border_width (GTK_CONTAINER (sndplayback), 3);
  gtk_combo_set_case_sensitive (GTK_COMBO (sndplayback), TRUE);
  sndplayback_items = g_list_append (sndplayback_items, _("/dev/dsp"));
  sndplayback_items = g_list_append (sndplayback_items, _("/dev/dsp1"));
  gtk_combo_set_popdown_strings (GTK_COMBO (sndplayback), sndplayback_items);
  g_list_free (sndplayback_items);

  label5 = gtk_label_new (_("Soundcard for Recording"));
  gtk_widget_set_name (label5, "label5");
  gtk_widget_ref (label5);
  gtk_object_set_data_full (GTK_OBJECT (ioconfiglinux), "label5", label5,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (label5);
  gtk_table_attach (GTK_TABLE (table3), label5, 0, 1, 0, 1,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label5), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label5), 0, 0.5);
  gtk_misc_set_padding (GTK_MISC (label5), 10, 0);

  label6 = gtk_label_new (_("Soundcard for Playback"));
  gtk_widget_set_name (label6, "label6");
  gtk_widget_ref (label6);
  gtk_object_set_data_full (GTK_OBJECT (ioconfiglinux), "label6", label6,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (label6);
  gtk_table_attach (GTK_TABLE (table3), label6, 0, 1, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label6), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label6), 0, 0.5);
  gtk_misc_set_padding (GTK_MISC (label6), 10, 0);

  frame1 = gtk_frame_new (_("Parallel Port Driver Settings"));
  gtk_widget_set_name (frame1, "frame1");
  gtk_widget_ref (frame1);
  gtk_object_set_data_full (GTK_OBJECT (ioconfiglinux), "frame1", frame1,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (frame1);
  gtk_box_pack_start (GTK_BOX (vbox1), frame1, TRUE, TRUE, 0);
  gtk_container_set_border_width (GTK_CONTAINER (frame1), 5);

  table2 = gtk_table_new (2, 4, FALSE);
  gtk_widget_set_name (table2, "table2");
  gtk_widget_ref (table2);
  gtk_object_set_data_full (GTK_OBJECT (ioconfiglinux), "table2", table2,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (table2);
  gtk_container_add (GTK_CONTAINER (frame1), table2);

  ioaddr = gtk_combo_new ();
  gtk_widget_set_name (ioaddr, "ioaddr");
  gtk_widget_ref (ioaddr);
  gtk_object_set_data_full (GTK_OBJECT (ioconfiglinux), "ioaddr", ioaddr,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (ioaddr);
  gtk_table_attach (GTK_TABLE (table2), ioaddr, 3, 4, 0, 1,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (GTK_EXPAND), 0, 0);
  gtk_widget_set_usize (GTK_COMBO (ioaddr)->entry, 104, -2);
  gtk_widget_set_usize (ioaddr, 120, -2);
  gtk_container_set_border_width (GTK_CONTAINER (ioaddr), 3);
  ioaddr_items = g_list_append (ioaddr_items, _("0x378"));
  ioaddr_items = g_list_append (ioaddr_items, _("0x278"));
  gtk_combo_set_popdown_strings (GTK_COMBO (ioaddr), ioaddr_items);
  g_list_free (ioaddr_items);

  devfile = gtk_combo_new ();
  gtk_widget_set_name (devfile, "devfile");
  gtk_widget_ref (devfile);
  gtk_object_set_data_full (GTK_OBJECT (ioconfiglinux), "devfile", devfile,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (devfile);
  gtk_table_attach (GTK_TABLE (table2), devfile, 3, 4, 1, 2,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (GTK_EXPAND), 0, 0);
  gtk_widget_set_usize (GTK_COMBO (devfile)->entry, 104, -2);
  gtk_widget_set_usize (devfile, 120, -2);
  gtk_container_set_border_width (GTK_CONTAINER (devfile), 3);
  gtk_combo_set_case_sensitive (GTK_COMBO (devfile), TRUE);
  devfile_items = g_list_append (devfile_items, _("/dev/ppuser0"));
  devfile_items = g_list_append (devfile_items, _("/dev/ppuser1"));
  gtk_combo_set_popdown_strings (GTK_COMBO (devfile), devfile_items);
  g_list_free (devfile_items);

  label2 = gtk_label_new (_("IO Address"));
  gtk_widget_set_name (label2, "label2");
  gtk_widget_ref (label2);
  gtk_object_set_data_full (GTK_OBJECT (ioconfiglinux), "label2", label2,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (label2);
  gtk_table_attach (GTK_TABLE (table2), label2, 2, 3, 0, 1,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (GTK_EXPAND), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label2), 0, 0.5);
  gtk_misc_set_padding (GTK_MISC (label2), 4, 0);

  label3 = gtk_label_new (_("File"));
  gtk_widget_set_name (label3, "label3");
  gtk_widget_ref (label3);
  gtk_object_set_data_full (GTK_OBJECT (ioconfiglinux), "label3", label3,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (label3);
  gtk_table_attach (GTK_TABLE (table2), label3, 2, 3, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (GTK_EXPAND), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label3), 0, 0.5);
  gtk_misc_set_padding (GTK_MISC (label3), 4, 0);

  label1 = gtk_label_new (_("Driver Selection"));
  gtk_widget_set_name (label1, "label1");
  gtk_widget_ref (label1);
  gtk_object_set_data_full (GTK_OBJECT (ioconfiglinux), "label1", label1,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (label1);
  gtk_table_attach (GTK_TABLE (table2), label1, 0, 1, 0, 1,
                    (GtkAttachOptions) (0),
                    (GtkAttachOptions) (GTK_EXPAND), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label1), GTK_JUSTIFY_LEFT);
  gtk_misc_set_padding (GTK_MISC (label1), 9, 0);

  drvdirect = gtk_radio_button_new_with_label (drivergroup_group, _("Direct Parport Access"));
  drivergroup_group = gtk_radio_button_group (GTK_RADIO_BUTTON (drvdirect));
  gtk_widget_set_name (drvdirect, "drvdirect");
  gtk_widget_ref (drvdirect);
  gtk_object_set_data_full (GTK_OBJECT (ioconfiglinux), "drvdirect", drvdirect,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (drvdirect);
  gtk_table_attach (GTK_TABLE (table2), drvdirect, 1, 2, 0, 1,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (GTK_EXPAND), 0, 0);

  drvppdev = gtk_radio_button_new_with_label (drivergroup_group, _("ppdev Kernel Driver"));
  drivergroup_group = gtk_radio_button_group (GTK_RADIO_BUTTON (drvppdev));
  gtk_widget_set_name (drvppdev, "drvppdev");
  gtk_widget_ref (drvppdev);
  gtk_object_set_data_full (GTK_OBJECT (ioconfiglinux), "drvppdev", drvppdev,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (drvppdev);
  gtk_table_attach (GTK_TABLE (table2), drvppdev, 1, 2, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (GTK_EXPAND), 0, 0);

  frame2 = gtk_frame_new (_("Modem Settings"));
  gtk_widget_set_name (frame2, "frame2");
  gtk_widget_ref (frame2);
  gtk_object_set_data_full (GTK_OBJECT (ioconfiglinux), "frame2", frame2,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (frame2);
  gtk_box_pack_start (GTK_BOX (vbox1), frame2, TRUE, TRUE, 0);
  gtk_container_set_border_width (GTK_CONTAINER (frame2), 5);

  table1 = gtk_table_new (1, 2, FALSE);
  gtk_widget_set_name (table1, "table1");
  gtk_widget_ref (table1);
  gtk_object_set_data_full (GTK_OBJECT (ioconfiglinux), "table1", table1,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (table1);
  gtk_container_add (GTK_CONTAINER (frame2), table1);

  fpgaclk = gtk_combo_new ();
  gtk_widget_set_name (fpgaclk, "fpgaclk");
  gtk_widget_ref (fpgaclk);
  gtk_object_set_data_full (GTK_OBJECT (ioconfiglinux), "fpgaclk", fpgaclk,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (fpgaclk);
  gtk_table_attach (GTK_TABLE (table1), fpgaclk, 1, 2, 0, 1,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (GTK_EXPAND), 0, 0);
  gtk_container_set_border_width (GTK_CONTAINER (fpgaclk), 3);
  fpgaclk_items = g_list_append (fpgaclk_items, _("19666600"));
  fpgaclk_items = g_list_append (fpgaclk_items, _("9830400"));
  gtk_combo_set_popdown_strings (GTK_COMBO (fpgaclk), fpgaclk_items);
  g_list_free (fpgaclk_items);

  label4 = gtk_label_new (_("FPGA clock frequency"));
  gtk_widget_set_name (label4, "label4");
  gtk_widget_ref (label4);
  gtk_object_set_data_full (GTK_OBJECT (ioconfiglinux), "label4", label4,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (label4);
  gtk_table_attach (GTK_TABLE (table1), label4, 0, 1, 0, 1,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (GTK_EXPAND), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label4), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label4), 0, 0.5);
  gtk_misc_set_padding (GTK_MISC (label4), 10, 0);

  hbuttonbox1 = gtk_hbutton_box_new ();
  gtk_widget_set_name (hbuttonbox1, "hbuttonbox1");
  gtk_widget_ref (hbuttonbox1);
  gtk_object_set_data_full (GTK_OBJECT (ioconfiglinux), "hbuttonbox1", hbuttonbox1,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (hbuttonbox1);
  gtk_box_pack_start (GTK_BOX (vbox1), hbuttonbox1, TRUE, TRUE, 0);
  gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox1), GTK_BUTTONBOX_SPREAD);

  buttonok = gtk_button_new_with_label (_("Ok"));
  gtk_widget_set_name (buttonok, "buttonok");
  gtk_widget_ref (buttonok);
  gtk_object_set_data_full (GTK_OBJECT (ioconfiglinux), "buttonok", buttonok,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (buttonok);
  gtk_container_add (GTK_CONTAINER (hbuttonbox1), buttonok);
  GTK_WIDGET_SET_FLAGS (buttonok, GTK_CAN_DEFAULT);
  gtk_tooltips_set_tip (tooltips, buttonok, _("Continue"), NULL);

  buttonquit = gtk_button_new_with_label (_("Quit"));
  gtk_widget_set_name (buttonquit, "buttonquit");
  gtk_widget_ref (buttonquit);
  gtk_object_set_data_full (GTK_OBJECT (ioconfiglinux), "buttonquit", buttonquit,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (buttonquit);
  gtk_container_add (GTK_CONTAINER (hbuttonbox1), buttonquit);
  GTK_WIDGET_SET_FLAGS (buttonquit, GTK_CAN_DEFAULT);
  gtk_tooltips_set_tip (tooltips, buttonquit, _("Quit the application"), NULL);

  gtk_signal_connect (GTK_OBJECT (buttonok), "clicked",
                      GTK_SIGNAL_FUNC (on_configok_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (buttonquit), "clicked",
                      GTK_SIGNAL_FUNC (on_configquit_clicked),
                      NULL);

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

  return ioconfiglinux;
}

GtkWidget*
create_mainwindow ()
{
  GtkWidget *mainwindow;
  GtkWidget *vbox2;
  GtkWidget *handlebox1;
  GtkWidget *menubar1;
  guint tmp_key;
  GtkWidget *file;
  GtkWidget *file_menu;
  GtkAccelGroup *file_menu_accels;
  GtkWidget *dtmf;
  GtkWidget *oscilloscope;
  GtkWidget *spectrum;
  GtkWidget *separator1;
  GtkWidget *quit;
  GtkWidget *help;
  GtkWidget *help_menu;
  GtkAccelGroup *help_menu_accels;
  GtkWidget *about;
  GtkWidget *vbox3;
  GtkWidget *progressbar1;
  GtkWidget *progressbar2;
  GtkWidget *handlebox2;
  GtkWidget *hbox1;
  GtkWidget *buttonptt;
  GtkWidget *button1750;
  GtkWidget *buttonsquelch;
  GtkWidget *buttondtmf;
  GtkWidget *buttonscope;
  GtkWidget *buttonspectrum;
  GtkAccelGroup *accel_group;
  GtkTooltips *tooltips;

  tooltips = gtk_tooltips_new ();

  accel_group = gtk_accel_group_new ();

  mainwindow = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_widget_set_name (mainwindow, "mainwindow");
  gtk_widget_ref (mainwindow);
  gtk_object_set_data_full (GTK_OBJECT (mainwindow), "mainwindow", mainwindow,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_set_events (mainwindow, GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK);
  gtk_window_set_title (GTK_WINDOW (mainwindow), _("EPPFM"));

  vbox2 = gtk_vbox_new (FALSE, 0);
  gtk_widget_set_name (vbox2, "vbox2");
  gtk_widget_ref (vbox2);
  gtk_object_set_data_full (GTK_OBJECT (mainwindow), "vbox2", vbox2,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (vbox2);
  gtk_container_add (GTK_CONTAINER (mainwindow), vbox2);

  handlebox1 = gtk_handle_box_new ();
  gtk_widget_set_name (handlebox1, "handlebox1");
  gtk_widget_ref (handlebox1);
  gtk_object_set_data_full (GTK_OBJECT (mainwindow), "handlebox1", handlebox1,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (handlebox1);
  gtk_box_pack_start (GTK_BOX (vbox2), handlebox1, FALSE, TRUE, 0);

  menubar1 = gtk_menu_bar_new ();
  gtk_widget_set_name (menubar1, "menubar1");
  gtk_widget_ref (menubar1);
  gtk_object_set_data_full (GTK_OBJECT (mainwindow), "menubar1", menubar1,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (menubar1);
  gtk_container_add (GTK_CONTAINER (handlebox1), menubar1);

  file = gtk_menu_item_new_with_label ("");
  tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (file)->child),
                                   _("_File"));
  gtk_widget_add_accelerator (file, "activate_item", accel_group,
                              tmp_key, GDK_MOD1_MASK, 0);
  gtk_widget_set_name (file, "file");
  gtk_widget_ref (file);
  gtk_object_set_data_full (GTK_OBJECT (mainwindow), "file", file,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (file);
  gtk_container_add (GTK_CONTAINER (menubar1), file);
  gtk_tooltips_set_tip (tooltips, file, _("File Menu"), NULL);

  file_menu = gtk_menu_new ();
  gtk_widget_set_name (file_menu, "file_menu");
  gtk_widget_ref (file_menu);
  gtk_object_set_data_full (GTK_OBJECT (mainwindow), "file_menu", file_menu,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_menu_item_set_submenu (GTK_MENU_ITEM (file), file_menu);
  file_menu_accels = gtk_menu_ensure_uline_accel_group (GTK_MENU (file_menu));

  dtmf = gtk_menu_item_new_with_label ("");
  tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (dtmf)->child),
                                   _("_DTMF keypad..."));
  gtk_widget_add_accelerator (dtmf, "activate_item", file_menu_accels,
                              tmp_key, 0, 0);
  gtk_widget_set_name (dtmf, "dtmf");
  gtk_widget_ref (dtmf);
  gtk_object_set_data_full (GTK_OBJECT (mainwindow), "dtmf", dtmf,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (dtmf);
  gtk_container_add (GTK_CONTAINER (file_menu), dtmf);

  oscilloscope = gtk_menu_item_new_with_label ("");
  tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (oscilloscope)->child),
                                   _("_Oscilloscope display..."));
  gtk_widget_add_accelerator (oscilloscope, "activate_item", file_menu_accels,
                              tmp_key, 0, 0);
  gtk_widget_set_name (oscilloscope, "oscilloscope");
  gtk_widget_ref (oscilloscope);
  gtk_object_set_data_full (GTK_OBJECT (mainwindow), "oscilloscope", oscilloscope,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (oscilloscope);
  gtk_container_add (GTK_CONTAINER (file_menu), oscilloscope);

  spectrum = gtk_menu_item_new_with_label ("");
  tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (spectrum)->child),
                                   _("_Spectrum Display..."));
  gtk_widget_add_accelerator (spectrum, "activate_item", file_menu_accels,
                              tmp_key, 0, 0);
  gtk_widget_set_name (spectrum, "spectrum");
  gtk_widget_ref (spectrum);
  gtk_object_set_data_full (GTK_OBJECT (mainwindow), "spectrum", spectrum,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (spectrum);
  gtk_container_add (GTK_CONTAINER (file_menu), spectrum);

  separator1 = gtk_menu_item_new ();
  gtk_widget_set_name (separator1, "separator1");
  gtk_widget_ref (separator1);
  gtk_object_set_data_full (GTK_OBJECT (mainwindow), "separator1", separator1,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (separator1);
  gtk_container_add (GTK_CONTAINER (file_menu), separator1);
  gtk_widget_set_sensitive (separator1, FALSE);

  quit = gtk_menu_item_new_with_label ("");
  tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (quit)->child),
                                   _("_Quit"));
  gtk_widget_add_accelerator (quit, "activate_item", file_menu_accels,
                              tmp_key, 0, 0);
  gtk_widget_set_name (quit, "quit");
  gtk_widget_ref (quit);
  gtk_object_set_data_full (GTK_OBJECT (mainwindow), "quit", quit,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (quit);
  gtk_container_add (GTK_CONTAINER (file_menu), quit);

  help = gtk_menu_item_new_with_label ("");
  tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (help)->child),
                                   _("_Help"));
  gtk_widget_add_accelerator (help, "activate_item", accel_group,
                              tmp_key, GDK_MOD1_MASK, 0);
  gtk_widget_set_name (help, "help");
  gtk_widget_ref (help);
  gtk_object_set_data_full (GTK_OBJECT (mainwindow), "help", help,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (help);
  gtk_container_add (GTK_CONTAINER (menubar1), help);
  gtk_menu_item_right_justify (GTK_MENU_ITEM (help));

  help_menu = gtk_menu_new ();
  gtk_widget_set_name (help_menu, "help_menu");
  gtk_widget_ref (help_menu);
  gtk_object_set_data_full (GTK_OBJECT (mainwindow), "help_menu", help_menu,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_menu_item_set_submenu (GTK_MENU_ITEM (help), help_menu);
  help_menu_accels = gtk_menu_ensure_uline_accel_group (GTK_MENU (help_menu));

  about = gtk_menu_item_new_with_label ("");
  tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (about)->child),
                                   _("_About"));
  gtk_widget_add_accelerator (about, "activate_item", help_menu_accels,
                              tmp_key, 0, 0);
  gtk_widget_set_name (about, "about");
  gtk_widget_ref (about);
  gtk_object_set_data_full (GTK_OBJECT (mainwindow), "about", about,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (about);
  gtk_container_add (GTK_CONTAINER (help_menu), about);

  vbox3 = gtk_vbox_new (FALSE, 0);
  gtk_widget_set_name (vbox3, "vbox3");
  gtk_widget_ref (vbox3);
  gtk_object_set_data_full (GTK_OBJECT (mainwindow), "vbox3", vbox3,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (vbox3);
  gtk_box_pack_start (GTK_BOX (vbox2), vbox3, TRUE, TRUE, 0);

  progressbar1 = gtk_progress_bar_new ();
  gtk_widget_set_name (progressbar1, "progressbar1");
  gtk_widget_ref (progressbar1);
  gtk_object_set_data_full (GTK_OBJECT (mainwindow), "progressbar1", progressbar1,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (progressbar1);
  gtk_box_pack_start (GTK_BOX (vbox3), progressbar1, TRUE, TRUE, 0);
  gtk_progress_configure (GTK_PROGRESS (progressbar1), -40, -40, 0);
  gtk_progress_set_show_text (GTK_PROGRESS (progressbar1), TRUE);

  progressbar2 = gtk_progress_bar_new ();
  gtk_widget_set_name (progressbar2, "progressbar2");
  gtk_widget_ref (progressbar2);
  gtk_object_set_data_full (GTK_OBJECT (mainwindow), "progressbar2", progressbar2,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (progressbar2);
  gtk_box_pack_start (GTK_BOX (vbox3), progressbar2, TRUE, TRUE, 0);
  gtk_progress_configure (GTK_PROGRESS (progressbar2), -40, -40, 0);
  gtk_progress_set_show_text (GTK_PROGRESS (progressbar2), TRUE);

  handlebox2 = gtk_handle_box_new ();
  gtk_widget_set_name (handlebox2, "handlebox2");
  gtk_widget_ref (handlebox2);
  gtk_object_set_data_full (GTK_OBJECT (mainwindow), "handlebox2", handlebox2,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (handlebox2);
  gtk_box_pack_start (GTK_BOX (vbox2), handlebox2, FALSE, TRUE, 0);

  hbox1 = gtk_hbox_new (TRUE, 0);
  gtk_widget_set_name (hbox1, "hbox1");
  gtk_widget_ref (hbox1);
  gtk_object_set_data_full (GTK_OBJECT (mainwindow), "hbox1", hbox1,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (hbox1);
  gtk_container_add (GTK_CONTAINER (handlebox2), hbox1);

  buttonptt = gtk_toggle_button_new_with_label (_("PTT"));
  gtk_widget_set_name (buttonptt, "buttonptt");
  gtk_widget_ref (buttonptt);
  gtk_object_set_data_full (GTK_OBJECT (mainwindow), "buttonptt", buttonptt,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (buttonptt);
  gtk_box_pack_start (GTK_BOX (hbox1), buttonptt, TRUE, TRUE, 0);
  gtk_widget_set_usize (buttonptt, 70, -2);

  button1750 = gtk_button_new_with_label (_("1750"));
  gtk_widget_set_name (button1750, "button1750");
  gtk_widget_ref (button1750);
  gtk_object_set_data_full (GTK_OBJECT (mainwindow), "button1750", button1750,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (button1750);
  gtk_box_pack_start (GTK_BOX (hbox1), button1750, TRUE, TRUE, 0);

  buttonsquelch = gtk_button_new_with_label (_("Squelch off"));
  gtk_widget_set_name (buttonsquelch, "buttonsquelch");
  gtk_widget_ref (buttonsquelch);
  gtk_object_set_data_full (GTK_OBJECT (mainwindow), "buttonsquelch", buttonsquelch,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (buttonsquelch);
  gtk_box_pack_start (GTK_BOX (hbox1), buttonsquelch, TRUE, TRUE, 0);

  buttondtmf = gtk_button_new_with_label (_("DTMF"));
  gtk_widget_set_name (buttondtmf, "buttondtmf");
  gtk_widget_ref (buttondtmf);
  gtk_object_set_data_full (GTK_OBJECT (mainwindow), "buttondtmf", buttondtmf,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (buttondtmf);
  gtk_box_pack_start (GTK_BOX (hbox1), buttondtmf, TRUE, TRUE, 0);

  buttonscope = gtk_button_new_with_label (_("Scope"));
  gtk_widget_set_name (buttonscope, "buttonscope");
  gtk_widget_ref (buttonscope);
  gtk_object_set_data_full (GTK_OBJECT (mainwindow), "buttonscope", buttonscope,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (buttonscope);
  gtk_box_pack_start (GTK_BOX (hbox1), buttonscope, TRUE, TRUE, 0);

  buttonspectrum = gtk_button_new_with_label (_("Spectrum"));
  gtk_widget_set_name (buttonspectrum, "buttonspectrum");
  gtk_widget_ref (buttonspectrum);
  gtk_object_set_data_full (GTK_OBJECT (mainwindow), "buttonspectrum", buttonspectrum,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (buttonspectrum);
  gtk_box_pack_start (GTK_BOX (hbox1), buttonspectrum, TRUE, TRUE, 0);

  gtk_signal_connect (GTK_OBJECT (mainwindow), "delete_event",
                      GTK_SIGNAL_FUNC (on_mainwindow_delete_event),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (mainwindow), "destroy",
                      GTK_SIGNAL_FUNC (on_mainwindow_destroy),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (mainwindow), "key_press_event",
                      GTK_SIGNAL_FUNC (on_mainwindow_key_event),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (mainwindow), "key_release_event",
                      GTK_SIGNAL_FUNC (on_mainwindow_key_event),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (dtmf), "activate",
                      GTK_SIGNAL_FUNC (on_dtmf_activate),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (oscilloscope), "activate",
                      GTK_SIGNAL_FUNC (on_oscilloscope_activate),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (spectrum), "activate",
                      GTK_SIGNAL_FUNC (on_spectrum_activate),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (quit), "activate",
                      GTK_SIGNAL_FUNC (on_quit_activate),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (about), "activate",
                      GTK_SIGNAL_FUNC (on_about_activate),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (buttonptt), "toggled",
                      GTK_SIGNAL_FUNC (on_mainptt_toggled),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (button1750), "pressed",
                      GTK_SIGNAL_FUNC (on_button1750_pressed),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (button1750), "released",
                      GTK_SIGNAL_FUNC (on_button1750_released),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (buttonsquelch), "clicked",
                      GTK_SIGNAL_FUNC (on_buttonsquelch_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (buttondtmf), "clicked",
                      GTK_SIGNAL_FUNC (on_maindtmf_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (buttonscope), "clicked",
                      GTK_SIGNAL_FUNC (on_mainscope_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (buttonspectrum), "clicked",
                      GTK_SIGNAL_FUNC (on_mainspectrum_clicked),
                      NULL);

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

  gtk_window_add_accel_group (GTK_WINDOW (mainwindow), accel_group);

  return mainwindow;
}

GtkWidget*
create_aboutdialog ()
{
  GtkWidget *aboutdialog;
  GtkWidget *dialog_vbox1;
  GtkWidget *vbox5;
  GtkWidget *label7;
  GtkWidget *label8;
  GtkWidget *label9;
  GtkWidget *dialog_action_area1;
  GtkWidget *buttonok;

  aboutdialog = gtk_dialog_new ();
  gtk_widget_set_name (aboutdialog, "aboutdialog");
  gtk_widget_ref (aboutdialog);
  gtk_object_set_data_full (GTK_OBJECT (aboutdialog), "aboutdialog", aboutdialog,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_window_set_title (GTK_WINDOW (aboutdialog), _("About"));
  gtk_window_set_policy (GTK_WINDOW (aboutdialog), TRUE, TRUE, FALSE);

  dialog_vbox1 = GTK_DIALOG (aboutdialog)->vbox;
  gtk_widget_set_name (dialog_vbox1, "dialog_vbox1");
  gtk_widget_ref (dialog_vbox1);
  gtk_object_set_data_full (GTK_OBJECT (aboutdialog), "dialog_vbox1", dialog_vbox1,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (dialog_vbox1);

  vbox5 = gtk_vbox_new (FALSE, 0);
  gtk_widget_set_name (vbox5, "vbox5");
  gtk_widget_ref (vbox5);
  gtk_object_set_data_full (GTK_OBJECT (aboutdialog), "vbox5", vbox5,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (vbox5);
  gtk_box_pack_start (GTK_BOX (dialog_vbox1), vbox5, TRUE, TRUE, 0);

  label7 = gtk_label_new (_("written by:"));
  gtk_widget_set_name (label7, "label7");
  gtk_widget_ref (label7);
  gtk_object_set_data_full (GTK_OBJECT (aboutdialog), "label7", label7,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (label7);
  gtk_box_pack_start (GTK_BOX (vbox5), label7, FALSE, FALSE, 0);
  gtk_misc_set_alignment (GTK_MISC (label7), 0, 0.5);
  gtk_misc_set_padding (GTK_MISC (label7), 4, 3);

  label8 = gtk_label_new (_("Thomas Sailer"));
  gtk_widget_set_name (label8, "label8");
  gtk_widget_ref (label8);
  gtk_object_set_data_full (GTK_OBJECT (aboutdialog), "label8", label8,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (label8);
  gtk_box_pack_start (GTK_BOX (vbox5), label8, FALSE, FALSE, 0);
  gtk_misc_set_padding (GTK_MISC (label8), 4, 4);

  label9 = gtk_label_new (_("HB9JNX/AE4WA"));
  gtk_widget_set_name (label9, "label9");
  gtk_widget_ref (label9);
  gtk_object_set_data_full (GTK_OBJECT (aboutdialog), "label9", label9,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (label9);
  gtk_box_pack_start (GTK_BOX (vbox5), label9, FALSE, FALSE, 0);
  gtk_misc_set_padding (GTK_MISC (label9), 4, 4);

  dialog_action_area1 = GTK_DIALOG (aboutdialog)->action_area;
  gtk_widget_set_name (dialog_action_area1, "dialog_action_area1");
  gtk_widget_ref (dialog_action_area1);
  gtk_object_set_data_full (GTK_OBJECT (aboutdialog), "dialog_action_area1", dialog_action_area1,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (dialog_action_area1);
  gtk_container_set_border_width (GTK_CONTAINER (dialog_action_area1), 10);

  buttonok = gtk_button_new_with_label (_("Ok"));
  gtk_widget_set_name (buttonok, "buttonok");
  gtk_widget_ref (buttonok);
  gtk_object_set_data_full (GTK_OBJECT (aboutdialog), "buttonok", buttonok,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (buttonok);
  gtk_box_pack_start (GTK_BOX (dialog_action_area1), buttonok, FALSE, FALSE, 0);
  gtk_widget_set_usize (buttonok, 80, 27);

  gtk_signal_connect (GTK_OBJECT (aboutdialog), "delete_event",
                      GTK_SIGNAL_FUNC (on_aboutdialog_delete_event),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (buttonok), "clicked",
                      GTK_SIGNAL_FUNC (on_aboutok_clicked),
                      NULL);

  return aboutdialog;
}

GtkWidget*
create_dtmfwindow ()
{
  GtkWidget *dtmfwindow;
  GtkWidget *vbox4;
  GtkWidget *frame4;
  GtkWidget *hbox2;
  GtkWidget *dtmfentry;
  GtkWidget *buttoncleardtmf;
  GtkWidget *frame5;
  GtkWidget *table4;
  GtkWidget *dtmf8;
  GtkWidget *dtmf9;
  GtkWidget *dtmfa;
  GtkWidget *dtmf4;
  GtkWidget *dtmf5;
  GtkWidget *dtmf6;
  GtkWidget *dtmfb;
  GtkWidget *dtmf1;
  GtkWidget *dtmf2;
  GtkWidget *dtmf3;
  GtkWidget *dtmfc;
  GtkWidget *dtmfe;
  GtkWidget *dtmf0;
  GtkWidget *dtmff;
  GtkWidget *dtmfd;
  GtkWidget *dtmf7;

  dtmfwindow = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_widget_set_name (dtmfwindow, "dtmfwindow");
  gtk_widget_ref (dtmfwindow);
  gtk_object_set_data_full (GTK_OBJECT (dtmfwindow), "dtmfwindow", dtmfwindow,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_set_events (dtmfwindow, GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK);
  gtk_window_set_title (GTK_WINDOW (dtmfwindow), _("DTMF Keypad"));

  vbox4 = gtk_vbox_new (FALSE, 0);
  gtk_widget_set_name (vbox4, "vbox4");
  gtk_widget_ref (vbox4);
  gtk_object_set_data_full (GTK_OBJECT (dtmfwindow), "vbox4", vbox4,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (vbox4);
  gtk_container_add (GTK_CONTAINER (dtmfwindow), vbox4);

  frame4 = gtk_frame_new (_("Keys transmitted"));
  gtk_widget_set_name (frame4, "frame4");
  gtk_widget_ref (frame4);
  gtk_object_set_data_full (GTK_OBJECT (dtmfwindow), "frame4", frame4,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (frame4);
  gtk_box_pack_start (GTK_BOX (vbox4), frame4, FALSE, TRUE, 0);
  gtk_container_set_border_width (GTK_CONTAINER (frame4), 5);
  gtk_frame_set_label_align (GTK_FRAME (frame4), 0.01, 0.5);

  hbox2 = gtk_hbox_new (FALSE, 0);
  gtk_widget_set_name (hbox2, "hbox2");
  gtk_widget_ref (hbox2);
  gtk_object_set_data_full (GTK_OBJECT (dtmfwindow), "hbox2", hbox2,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (hbox2);
  gtk_container_add (GTK_CONTAINER (frame4), hbox2);

  dtmfentry = gtk_entry_new ();
  gtk_widget_set_name (dtmfentry, "dtmfentry");
  gtk_widget_ref (dtmfentry);
  gtk_object_set_data_full (GTK_OBJECT (dtmfwindow), "dtmfentry", dtmfentry,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (dtmfentry);
  gtk_box_pack_start (GTK_BOX (hbox2), dtmfentry, TRUE, TRUE, 0);
  gtk_entry_set_editable (GTK_ENTRY (dtmfentry), FALSE);

  buttoncleardtmf = gtk_button_new_with_label (_("Clear"));
  gtk_widget_set_name (buttoncleardtmf, "buttoncleardtmf");
  gtk_widget_ref (buttoncleardtmf);
  gtk_object_set_data_full (GTK_OBJECT (dtmfwindow), "buttoncleardtmf", buttoncleardtmf,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (buttoncleardtmf);
  gtk_box_pack_start (GTK_BOX (hbox2), buttoncleardtmf, FALSE, FALSE, 0);
  gtk_widget_set_usize (buttoncleardtmf, 50, -2);

  frame5 = gtk_frame_new (_("Keypad"));
  gtk_widget_set_name (frame5, "frame5");
  gtk_widget_ref (frame5);
  gtk_object_set_data_full (GTK_OBJECT (dtmfwindow), "frame5", frame5,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (frame5);
  gtk_box_pack_start (GTK_BOX (vbox4), frame5, TRUE, TRUE, 0);
  gtk_container_set_border_width (GTK_CONTAINER (frame5), 5);
  gtk_frame_set_label_align (GTK_FRAME (frame5), 0.01, 0.5);

  table4 = gtk_table_new (4, 4, FALSE);
  gtk_widget_set_name (table4, "table4");
  gtk_widget_ref (table4);
  gtk_object_set_data_full (GTK_OBJECT (dtmfwindow), "table4", table4,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (table4);
  gtk_container_add (GTK_CONTAINER (frame5), table4);

  dtmf8 = gtk_button_new_with_label (_("8"));
  gtk_widget_set_name (dtmf8, "dtmf8");
  gtk_widget_ref (dtmf8);
  gtk_object_set_data_full (GTK_OBJECT (dtmfwindow), "dtmf8", dtmf8,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (dtmf8);
  gtk_table_attach (GTK_TABLE (table4), dtmf8, 1, 2, 0, 1,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);

  dtmf9 = gtk_button_new_with_label (_("9"));
  gtk_widget_set_name (dtmf9, "dtmf9");
  gtk_widget_ref (dtmf9);
  gtk_object_set_data_full (GTK_OBJECT (dtmfwindow), "dtmf9", dtmf9,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (dtmf9);
  gtk_table_attach (GTK_TABLE (table4), dtmf9, 2, 3, 0, 1,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);

  dtmfa = gtk_button_new_with_label (_("A"));
  gtk_widget_set_name (dtmfa, "dtmfa");
  gtk_widget_ref (dtmfa);
  gtk_object_set_data_full (GTK_OBJECT (dtmfwindow), "dtmfa", dtmfa,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (dtmfa);
  gtk_table_attach (GTK_TABLE (table4), dtmfa, 3, 4, 0, 1,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);

  dtmf4 = gtk_button_new_with_label (_("4"));
  gtk_widget_set_name (dtmf4, "dtmf4");
  gtk_widget_ref (dtmf4);
  gtk_object_set_data_full (GTK_OBJECT (dtmfwindow), "dtmf4", dtmf4,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (dtmf4);
  gtk_table_attach (GTK_TABLE (table4), dtmf4, 0, 1, 1, 2,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);

  dtmf5 = gtk_button_new_with_label (_("5"));
  gtk_widget_set_name (dtmf5, "dtmf5");
  gtk_widget_ref (dtmf5);
  gtk_object_set_data_full (GTK_OBJECT (dtmfwindow), "dtmf5", dtmf5,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (dtmf5);
  gtk_table_attach (GTK_TABLE (table4), dtmf5, 1, 2, 1, 2,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);

  dtmf6 = gtk_button_new_with_label (_("6"));
  gtk_widget_set_name (dtmf6, "dtmf6");
  gtk_widget_ref (dtmf6);
  gtk_object_set_data_full (GTK_OBJECT (dtmfwindow), "dtmf6", dtmf6,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (dtmf6);
  gtk_table_attach (GTK_TABLE (table4), dtmf6, 2, 3, 1, 2,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);

  dtmfb = gtk_button_new_with_label (_("B"));
  gtk_widget_set_name (dtmfb, "dtmfb");
  gtk_widget_ref (dtmfb);
  gtk_object_set_data_full (GTK_OBJECT (dtmfwindow), "dtmfb", dtmfb,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (dtmfb);
  gtk_table_attach (GTK_TABLE (table4), dtmfb, 3, 4, 1, 2,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);

  dtmf1 = gtk_button_new_with_label (_("1"));
  gtk_widget_set_name (dtmf1, "dtmf1");
  gtk_widget_ref (dtmf1);
  gtk_object_set_data_full (GTK_OBJECT (dtmfwindow), "dtmf1", dtmf1,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (dtmf1);
  gtk_table_attach (GTK_TABLE (table4), dtmf1, 0, 1, 2, 3,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);

  dtmf2 = gtk_button_new_with_label (_("2"));
  gtk_widget_set_name (dtmf2, "dtmf2");
  gtk_widget_ref (dtmf2);
  gtk_object_set_data_full (GTK_OBJECT (dtmfwindow), "dtmf2", dtmf2,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (dtmf2);
  gtk_table_attach (GTK_TABLE (table4), dtmf2, 1, 2, 2, 3,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);

  dtmf3 = gtk_button_new_with_label (_("3"));
  gtk_widget_set_name (dtmf3, "dtmf3");
  gtk_widget_ref (dtmf3);
  gtk_object_set_data_full (GTK_OBJECT (dtmfwindow), "dtmf3", dtmf3,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (dtmf3);
  gtk_table_attach (GTK_TABLE (table4), dtmf3, 2, 3, 2, 3,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);

  dtmfc = gtk_button_new_with_label (_("C"));
  gtk_widget_set_name (dtmfc, "dtmfc");
  gtk_widget_ref (dtmfc);
  gtk_object_set_data_full (GTK_OBJECT (dtmfwindow), "dtmfc", dtmfc,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (dtmfc);
  gtk_table_attach (GTK_TABLE (table4), dtmfc, 3, 4, 2, 3,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);

  dtmfe = gtk_button_new_with_label (_("*"));
  gtk_widget_set_name (dtmfe, "dtmfe");
  gtk_widget_ref (dtmfe);
  gtk_object_set_data_full (GTK_OBJECT (dtmfwindow), "dtmfe", dtmfe,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (dtmfe);
  gtk_table_attach (GTK_TABLE (table4), dtmfe, 0, 1, 3, 4,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);

  dtmf0 = gtk_button_new_with_label (_("0"));
  gtk_widget_set_name (dtmf0, "dtmf0");
  gtk_widget_ref (dtmf0);
  gtk_object_set_data_full (GTK_OBJECT (dtmfwindow), "dtmf0", dtmf0,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (dtmf0);
  gtk_table_attach (GTK_TABLE (table4), dtmf0, 1, 2, 3, 4,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);

  dtmff = gtk_button_new_with_label (_("#"));
  gtk_widget_set_name (dtmff, "dtmff");
  gtk_widget_ref (dtmff);
  gtk_object_set_data_full (GTK_OBJECT (dtmfwindow), "dtmff", dtmff,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (dtmff);
  gtk_table_attach (GTK_TABLE (table4), dtmff, 2, 3, 3, 4,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);

  dtmfd = gtk_button_new_with_label (_("D"));
  gtk_widget_set_name (dtmfd, "dtmfd");
  gtk_widget_ref (dtmfd);
  gtk_object_set_data_full (GTK_OBJECT (dtmfwindow), "dtmfd", dtmfd,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (dtmfd);
  gtk_table_attach (GTK_TABLE (table4), dtmfd, 3, 4, 3, 4,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);

  dtmf7 = gtk_button_new_with_label (_("7"));
  gtk_widget_set_name (dtmf7, "dtmf7");
  gtk_widget_ref (dtmf7);
  gtk_object_set_data_full (GTK_OBJECT (dtmfwindow), "dtmf7", dtmf7,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (dtmf7);
  gtk_table_attach (GTK_TABLE (table4), dtmf7, 0, 1, 0, 1,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);

  gtk_signal_connect (GTK_OBJECT (dtmfwindow), "key_press_event",
                      GTK_SIGNAL_FUNC (on_dtmfwindow_key_event),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (dtmfwindow), "key_release_event",
                      GTK_SIGNAL_FUNC (on_dtmfwindow_key_event),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (dtmfwindow), "delete_event",
                      GTK_SIGNAL_FUNC (on_dtmfwindow_delete_event),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (buttoncleardtmf), "clicked",
                      GTK_SIGNAL_FUNC (on_dtmfclear_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (dtmf8), "pressed",
                      GTK_SIGNAL_FUNC (on_dtmf_key),
                      (gpointer)0x18);
  gtk_signal_connect (GTK_OBJECT (dtmf8), "released",
                      GTK_SIGNAL_FUNC (on_dtmf_key),
                      (gpointer)0x08);
  gtk_signal_connect (GTK_OBJECT (dtmf9), "pressed",
                      GTK_SIGNAL_FUNC (on_dtmf_key),
                      (gpointer)0x19);
  gtk_signal_connect (GTK_OBJECT (dtmf9), "released",
                      GTK_SIGNAL_FUNC (on_dtmf_key),
                      (gpointer)0x09);
  gtk_signal_connect (GTK_OBJECT (dtmfa), "pressed",
                      GTK_SIGNAL_FUNC (on_dtmf_key),
                      (gpointer)0x1a);
  gtk_signal_connect (GTK_OBJECT (dtmfa), "released",
                      GTK_SIGNAL_FUNC (on_dtmf_key),
                      (gpointer)0x0a);
  gtk_signal_connect (GTK_OBJECT (dtmf4), "pressed",
                      GTK_SIGNAL_FUNC (on_dtmf_key),
                      (gpointer)0x14);
  gtk_signal_connect (GTK_OBJECT (dtmf4), "released",
                      GTK_SIGNAL_FUNC (on_dtmf_key),
                      (gpointer)0x04);
  gtk_signal_connect (GTK_OBJECT (dtmf5), "pressed",
                      GTK_SIGNAL_FUNC (on_dtmf_key),
                      (gpointer)0x15);
  gtk_signal_connect (GTK_OBJECT (dtmf5), "released",
                      GTK_SIGNAL_FUNC (on_dtmf_key),
                      (gpointer)0x05);
  gtk_signal_connect (GTK_OBJECT (dtmf6), "pressed",
                      GTK_SIGNAL_FUNC (on_dtmf_key),
                      (gpointer)0x16);
  gtk_signal_connect (GTK_OBJECT (dtmf6), "released",
                      GTK_SIGNAL_FUNC (on_dtmf_key),
                      (gpointer)0x06);
  gtk_signal_connect (GTK_OBJECT (dtmfb), "pressed",
                      GTK_SIGNAL_FUNC (on_dtmf_key),
                      (gpointer)0x1b);
  gtk_signal_connect (GTK_OBJECT (dtmfb), "released",
                      GTK_SIGNAL_FUNC (on_dtmf_key),
                      (gpointer)0x0b);
  gtk_signal_connect (GTK_OBJECT (dtmf1), "pressed",
                      GTK_SIGNAL_FUNC (on_dtmf_key),
                      (gpointer)0x11);
  gtk_signal_connect (GTK_OBJECT (dtmf1), "released",
                      GTK_SIGNAL_FUNC (on_dtmf_key),
                      (gpointer)0x01);
  gtk_signal_connect (GTK_OBJECT (dtmf2), "pressed",
                      GTK_SIGNAL_FUNC (on_dtmf_key),
                      (gpointer)0x12);
  gtk_signal_connect (GTK_OBJECT (dtmf2), "released",
                      GTK_SIGNAL_FUNC (on_dtmf_key),
                      (gpointer)0x02);
  gtk_signal_connect (GTK_OBJECT (dtmf3), "pressed",
                      GTK_SIGNAL_FUNC (on_dtmf_key),
                      (gpointer)0x13);
  gtk_signal_connect (GTK_OBJECT (dtmf3), "released",
                      GTK_SIGNAL_FUNC (on_dtmf_key),
                      (gpointer)0x03);
  gtk_signal_connect (GTK_OBJECT (dtmfc), "pressed",
                      GTK_SIGNAL_FUNC (on_dtmf_key),
                      (gpointer)0x1c);
  gtk_signal_connect (GTK_OBJECT (dtmfc), "released",
                      GTK_SIGNAL_FUNC (on_dtmf_key),
                      (gpointer)0x0c);
  gtk_signal_connect (GTK_OBJECT (dtmfe), "pressed",
                      GTK_SIGNAL_FUNC (on_dtmf_key),
                      (gpointer)0x1e);
  gtk_signal_connect (GTK_OBJECT (dtmfe), "released",
                      GTK_SIGNAL_FUNC (on_dtmf_key),
                      (gpointer)0x0e);
  gtk_signal_connect (GTK_OBJECT (dtmf0), "pressed",
                      GTK_SIGNAL_FUNC (on_dtmf_key),
                      (gpointer)0x10);
  gtk_signal_connect (GTK_OBJECT (dtmf0), "released",
                      GTK_SIGNAL_FUNC (on_dtmf_key),
                      (gpointer)0x00);
  gtk_signal_connect (GTK_OBJECT (dtmff), "pressed",
                      GTK_SIGNAL_FUNC (on_dtmf_key),
                      (gpointer)0x1f);
  gtk_signal_connect (GTK_OBJECT (dtmff), "released",
                      GTK_SIGNAL_FUNC (on_dtmf_key),
                      (gpointer)0x0f);
  gtk_signal_connect (GTK_OBJECT (dtmfd), "pressed",
                      GTK_SIGNAL_FUNC (on_dtmf_key),
                      (gpointer)0x1d);
  gtk_signal_connect (GTK_OBJECT (dtmfd), "released",
                      GTK_SIGNAL_FUNC (on_dtmf_key),
                      (gpointer)0x0d);
  gtk_signal_connect (GTK_OBJECT (dtmf7), "pressed",
                      GTK_SIGNAL_FUNC (on_dtmf_key),
                      (gpointer)0x17);
  gtk_signal_connect (GTK_OBJECT (dtmf7), "released",
                      GTK_SIGNAL_FUNC (on_dtmf_key),
                      (gpointer)0x07);

  return dtmfwindow;
}

GtkWidget*
create_scopewindow ()
{
  GtkWidget *scopewindow;
  GtkWidget *scope;

  scopewindow = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_widget_set_name (scopewindow, "scopewindow");
  gtk_widget_ref (scopewindow);
  gtk_object_set_data_full (GTK_OBJECT (scopewindow), "scopewindow", scopewindow,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_window_set_title (GTK_WINDOW (scopewindow), _("Scope"));

  scope = scope_new ("scope", NULL, NULL, 128, 0);
  gtk_widget_set_name (scope, "scope");
  gtk_widget_ref (scope);
  gtk_object_set_data_full (GTK_OBJECT (scopewindow), "scope", scope,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (scope);
  gtk_container_add (GTK_CONTAINER (scopewindow), scope);
  gtk_widget_set_usize (scope, 512, 256);
  GTK_WIDGET_UNSET_FLAGS (scope, GTK_CAN_FOCUS);
  GTK_WIDGET_UNSET_FLAGS (scope, GTK_CAN_DEFAULT);

  gtk_signal_connect (GTK_OBJECT (scopewindow), "delete_event",
                      GTK_SIGNAL_FUNC (on_scopewindow_delete_event),
                      NULL);

  return scopewindow;
}

GtkWidget*
create_spectrumwindow ()
{
  GtkWidget *spectrumwindow;
  GtkWidget *spec;

  spectrumwindow = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_widget_set_name (spectrumwindow, "spectrumwindow");
  gtk_widget_ref (spectrumwindow);
  gtk_object_set_data_full (GTK_OBJECT (spectrumwindow), "spectrumwindow", spectrumwindow,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_window_set_title (GTK_WINDOW (spectrumwindow), _("Spectrum"));

  spec = spectrum_new ("spec", NULL, NULL, 256, 0);
  gtk_widget_set_name (spec, "spec");
  gtk_widget_ref (spec);
  gtk_object_set_data_full (GTK_OBJECT (spectrumwindow), "spec", spec,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (spec);
  gtk_container_add (GTK_CONTAINER (spectrumwindow), spec);
  gtk_widget_set_usize (spec, 512, 256);
  GTK_WIDGET_UNSET_FLAGS (spec, GTK_CAN_FOCUS);
  GTK_WIDGET_UNSET_FLAGS (spec, GTK_CAN_DEFAULT);

  gtk_signal_connect (GTK_OBJECT (spectrumwindow), "delete_event",
                      GTK_SIGNAL_FUNC (on_spectrumwindow_delete_event),
                      NULL);

  return spectrumwindow;
}

