antiright-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Antiright-devel] antiright/gtkshell image_button.c image_button.h


From: Jeffrey Bedard
Subject: [Antiright-devel] antiright/gtkshell image_button.c image_button.h
Date: Fri, 02 Mar 2007 15:04:14 +0000

CVSROOT:        /sources/antiright
Module name:    antiright
Changes by:     Jeffrey Bedard <jefbed> 07/03/02 15:04:14

Added files:
        gtkshell       : image_button.c image_button.h 

Log message:
        Split out image button functions.  

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/image_button.c?cvsroot=antiright&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/image_button.h?cvsroot=antiright&rev=1.1

Patches:
Index: image_button.c
===================================================================
RCS file: image_button.c
diff -N image_button.c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ image_button.c      2 Mar 2007 15:04:14 -0000       1.1
@@ -0,0 +1,52 @@
+/*
+  AntiRight
+  (c) 2002-2007 Jeffrey Bedard
+  address@hidden
+
+  This file is part of AntiRight.
+
+  AntiRight 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.
+
+  AntiRight 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 AntiRight; if not, write to the Free Software
+  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  
USA
+*/
+
+#include "gtkshell.h"
+
+void
+gsh_image_button(struct GSH * gsh, char *command, char *filename)
+{
+       GtkWidget *image;
+
+       image = gtk_image_new_from_file(filename);
+       gsh_command_button(gsh, command);
+       gtk_button_set_image(GTK_BUTTON(gsh->button), image);
+       gtk_button_set_relief(GTK_BUTTON(gsh->button), GTK_RELIEF_NONE);
+}
+
+void
+gsh_handle_add_image_button(struct GSH * gsh, int argc, 
+                           char **argv, int *counter)
+{
+       gsh_count(argc, counter);
+       gsh_image_button(gsh, argv[(*counter)],
+                        argv[(*counter) + 1]);
+       gsh_count(argc, counter);
+}
+void
+gsh_handle_add_unlabeled_image_button(struct GSH * gsh, int argc, 
+                                     char **argv, int *counter)
+{
+       gsh_handle_add_image_button(gsh, argc, argv, counter);
+       gtk_button_set_label(GTK_BUTTON(gsh->button), "");
+}
+

Index: image_button.h
===================================================================
RCS file: image_button.h
diff -N image_button.h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ image_button.h      2 Mar 2007 15:04:14 -0000       1.1
@@ -0,0 +1,37 @@
+/*
+  AntiRight
+  (c) 2002-2007 Jeffrey Bedard
+  address@hidden
+
+  This file is part of AntiRight.
+
+  AntiRight 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.
+
+  AntiRight 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 AntiRight; if not, write to the Free Software
+  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  
USA
+*/
+
+#ifndef GSH_IMAGE_BUTTON_H
+#define GSH_IMAGE_BUTTON_H
+
+void
+gsh_image_button(struct GSH * gsh, char *command, char *filename);
+
+void
+gsh_handle_add_image_button(struct GSH * gsh, int argc, 
+                           char **argv, int *counter);
+
+void
+gsh_handle_add_unlabeled_image_button(struct GSH * gsh, int argc, 
+                                     char **argv, int *counter);
+
+#endif /* GSH_IMAGE_BUTTON_H */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]