From 119a5240f57ded266447b485e5a7c0eec6dd67f8 Mon Sep 17 00:00:00 2001 From: jaortega Date: Mon, 26 Feb 2001 23:16:00 +0000 Subject: gtk front-end files --- mixgtk/mixgtk_gen_handlers.c | 79 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 mixgtk/mixgtk_gen_handlers.c (limited to 'mixgtk/mixgtk_gen_handlers.c') diff --git a/mixgtk/mixgtk_gen_handlers.c b/mixgtk/mixgtk_gen_handlers.c new file mode 100644 index 0000000..e472341 --- /dev/null +++ b/mixgtk/mixgtk_gen_handlers.c @@ -0,0 +1,79 @@ +/* -*-c-*- -------------- mixgtk_gen_handlers.c : + * Implementation of the functions declared in mixgtk_gen_handlers.h + * ------------------------------------------------------------------ + * Last change: Time-stamp: "01/02/23 00:36:31 jose" + * ------------------------------------------------------------------ + * Copyright (C) 2001 Free Software Foundation, Inc. + * + * 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 "mixgtk_gen_handlers.h" + +void +on_main_window_destroy (GtkWidget *w, gpointer data) +{ + gtk_main_quit (); +} + +static void +on_file_open_ok_ (GtkWidget *w, gpointer fs) +{ + const gchar *file = gtk_file_selection_get_filename (GTK_FILE_SELECTION (fs)); + g_print ("File %s selected\n", file); + gtk_widget_destroy (GTK_WIDGET (fs)); +} + +static void +on_file_open_destroy_ (GtkWidget *w, gpointer data) +{ + gtk_grab_remove (GTK_WIDGET (w)); +} + +void +on_file_open_activate (GtkWidget *w, gpointer data) +{ + GtkWidget *file = gtk_file_selection_new ("Open program"); + gtk_signal_connect (GTK_OBJECT (file), "destroy", + (GtkSignalFunc) on_file_open_destroy_, + GTK_OBJECT (file)); + gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION (file)->ok_button), + "clicked", (GtkSignalFunc) on_file_open_ok_, + GTK_OBJECT (file)); + gtk_signal_connect_object (GTK_OBJECT (GTK_FILE_SELECTION + (file)->cancel_button), + "clicked", (GtkSignalFunc) gtk_widget_destroy, + GTK_OBJECT (file)); + gtk_widget_show (file); + gtk_grab_add (file); +} + +void +on_file_exit_activate (GtkWidget *w, gpointer data) +{ + g_message ("File_exit activated"); + gtk_main_quit (); +} + +void +on_debug_activate (GtkWidget *w, gpointer data) +{ +} + + + + -- cgit v1.2.3