Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=grape.git;a=commitdiff;h=659bac51c4ccda81698e9e36e0af43d55c7e9e34

commit 659bac51c4ccda81698e9e36e0af43d55c7e9e34
Author: James Buren <r...@frugalware.org>
Date:   Fri Apr 9 18:05:12 2010 -0500

grape.c
* add callback skeletons

diff --git a/src/grape.c b/src/grape.c
index 4736f54..0bdba71 100644
--- a/src/grape.c
+++ b/src/grape.c
@@ -25,6 +25,31 @@

typedef void (MenuOrButtonCallback) (GtkWidget *widget,gpointer data);

+/* Callback for creating new files. */
+void new_callback(GtkWidget *widget,gpointer data) {
+  g_assert(widget != NULL);
+}
+
+/* Callback for opening files. */
+void open_callback(GtkWidget *widget,gpointer data) {
+  g_assert(widget != NULL);
+}
+
+/* Callback for saving files. */
+void save_callback(GtkWidget *widget,gpointer data) {
+  g_assert(widget != NULL);
+}
+
+/* Callback for saving files as another name. */
+void save_as_callback(GtkWidget *widget,gpointer data) {
+  g_assert(widget != NULL);
+}
+
+/* Callback for when exit has been requested. */
+void quit_callback(GtkWidget *widget,gpointer data) {
+  g_assert(widget != NULL);
+}
+
/* Display a dialog for the user to select a file for
opening or saving. Returns NULL if user cancels. The
string must be freed after you are done using it. */
@@ -147,19 +172,20 @@ void insert_menu_items(GtkWidget *menu,...) {
va_end(args);
}

+/* Allocate a new file menu. */
GtkWidget *file_menu_new(void) {
GtkWidget *file_menu;

file_menu = gtk_menu_new();

insert_menu_items( file_menu,
-                     image_menu_item_new(GTK_STOCK_NEW,NULL),
-                     image_menu_item_new(GTK_STOCK_OPEN,NULL),
+                     image_menu_item_new(GTK_STOCK_NEW,new_callback),
+                     image_menu_item_new(GTK_STOCK_OPEN,open_callback),
gtk_separator_menu_item_new(),
-                     image_menu_item_new(GTK_STOCK_SAVE,NULL),
-                     image_menu_item_new(GTK_STOCK_SAVE_AS,NULL),
+                     image_menu_item_new(GTK_STOCK_SAVE,save_callback),
+                     image_menu_item_new(GTK_STOCK_SAVE_AS,save_as_callback),
gtk_separator_menu_item_new(),
-                     image_menu_item_new(GTK_STOCK_QUIT,NULL),
+                     image_menu_item_new(GTK_STOCK_QUIT,quit_callback),
NULL );

return file_menu;
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to