/*
* callbacks.c
*
* Used to callbacks the functions used by support.c module.
*
* Copyright (C) 2007 Atul Raut
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include <gtk/gtk.h>
#include "callbacks.h"
#include "interface.h"
#include "support.h"
#include "string.h"
char *command [10][10];
char *output [10][10];
void run_test (void)
{
int i;
for (i=0; i<10; i++)
{
strcpy (command [i], "AT");
strcpy (output [i], "OK");
}
}
/* called by delete_event to destroy the application window */
void
destroy (GtkWidget *widget, gpointer data)
{
gtk_main_quit ();
}
/* Menu Item Runs shows runtime output */
void
menuitem_Run_response (GtkWindow *window)
{
GtkWidget *view;
GtkTreeModel *model;
GtkWidget *scroll_window;
/* Run test, insert test results */
run_test ();
view = ui_create_view_and_model ();
scroll_window = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scroll_window), GTK_POLICY_ALWAYS, GTK_POLICY_ALWAYS);
// gtk_box_pack_start (GTK_BOX (temp_vbox_Global),view, FALSE, FALSE,0);
gtk_box_pack_start (GTK_BOX (temp_vbox_Global), scroll_window, TRUE, TRUE, 0);
gtk_widget_show (scroll_window);
// gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (scroll_window), view);
gtk_container_add (GTK_CONTAINER (scroll_window), view);
gtk_widget_show (temp_vbox_Global);
gtk_widget_show (view);
}
/* Show "About" information */
void
about_clicked (GtkMenuItem *menuitem, gpointer user_data)
{
}
/* Save output of AT Commands */
void
save_as_clicked (GtkMenuItem *menuitem, gpointer user_data)
{
}