antiright-devel
[Top][All Lists]
Advanced

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

[Antiright-devel] antiright Makefile gshterm/Makefile gshterm/mai...


From: Jeffrey Bedard
Subject: [Antiright-devel] antiright Makefile gshterm/Makefile gshterm/mai...
Date: Thu, 08 Feb 2007 23:22:31 +0000

CVSROOT:        /sources/antiright
Module name:    antiright
Changes by:     Jeffrey Bedard <jefbed> 07/02/08 23:22:31

Modified files:
        .              : Makefile 
        gshterm        : Makefile main.c 
        gtkshell       : callbacks.c callbacks.h text.c 
        libantiright   : util.c 
Added files:
        gshterm        : gshterm.c gshterm.h 
Removed files:
        gshedit        : Makefile main.c 

Log message:
        Added tags generation to main makefile.  Added geometry support to 
gshterm.
        Removed gshedit.  

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/antiright/Makefile?cvsroot=antiright&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/antiright/gshedit/Makefile?cvsroot=antiright&r1=1.2&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gshedit/main.c?cvsroot=antiright&r1=1.1&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gshterm/Makefile?cvsroot=antiright&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/antiright/gshterm/main.c?cvsroot=antiright&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/antiright/gshterm/gshterm.c?cvsroot=antiright&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/antiright/gshterm/gshterm.h?cvsroot=antiright&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/callbacks.c?cvsroot=antiright&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/callbacks.h?cvsroot=antiright&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/text.c?cvsroot=antiright&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/antiright/libantiright/util.c?cvsroot=antiright&r1=1.2&r2=1.3

Patches:
Index: Makefile
===================================================================
RCS file: /sources/antiright/antiright/Makefile,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- Makefile    4 Feb 2007 06:58:18 -0000       1.7
+++ Makefile    8 Feb 2007 23:22:30 -0000       1.8
@@ -31,6 +31,7 @@
        cd gtkshell && $(MAKE)
        cd gshterm && $(MAKE)
        cd ACE-desktop && $(MAKE)
+       ctags -t */*.[ch] ACE-desktop/ACE
 
 clean:
        cd libantiright && $(MAKE) clean
@@ -39,7 +40,7 @@
        cd ACE-desktop && $(MAKE) clean
 
 distclean: clean
-       rm -f config.mk
+       rm -f config.mk tags
 
 INSTALL=install
 INSTALL_PROGRAM=$(INSTALL) -c -s

Index: gshterm/Makefile
===================================================================
RCS file: /sources/antiright/antiright/gshterm/Makefile,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- gshterm/Makefile    4 Feb 2007 04:44:24 -0000       1.1
+++ gshterm/Makefile    8 Feb 2007 23:22:30 -0000       1.2
@@ -2,12 +2,12 @@
 
 #CFLAGS+=`pkg-config --cflags gtk+-2.0` -g3 -Wall -W -Werror
 CFLAGS+=`pkg-config --cflags gtk+-2.0` $(DEFS) -I../libantiright -I../gtkshell
-CFLAGS+=`pkg-config --cflags vte` -g3
+CFLAGS+=`pkg-config --cflags vte` 
 LDFLAGS+=-L../libantiright -L../gtkshell
 LDFLAGS+=`pkg-config --libs gtk+-2.0` -lgtkshell -lantiright
 LDFLAGS+=`pkg-config --libs vte`
 
-objects=main.o
+objects=main.o gshterm.o
 all: $(objects) 
        cc -o gshterm $(objects) $(LDFLAGS)
 

Index: gshterm/main.c
===================================================================
RCS file: /sources/antiright/antiright/gshterm/main.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- gshterm/main.c      4 Feb 2007 06:58:18 -0000       1.2
+++ gshterm/main.c      8 Feb 2007 23:22:30 -0000       1.3
@@ -1,6 +1,6 @@
 /*
   AntiRight
-  (c) 2002-2006 Jeffrey Bedard
+  (c) 2007 Jeffrey Bedard
   address@hidden
 
   This file is part of AntiRight.
@@ -20,75 +20,26 @@
   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  
USA
 */
 
-#include <gtkshell.h>
-#include <vte/vte.h>
-#include <unistd.h>
+#include "gshterm.h"
 
 extern char *gsh_geometry;
-GtkWidget *terminal;
-
-void
-gshterm_exit_cb(GtkWidget *widget, gpointer data)
-{
-       char *sys_command;
-
-       asprintf(&sys_command, "rm -f %s", data);
-       system(sys_command);
-       free(sys_command);
-       exit(0);
-}
 
 int
 main(int argc, char **argv)
 {
-       unsigned int counter;
-       gboolean exec_reached;
-       char *command=""; /* Initialize to empty for
-                            the first concatenation.  */
-       char *sys_command;
        char *script_name;
-       pid_t pid;
-
-       exec_reached=FALSE;
+       GtkWidget *terminal;
 
        gtk_init(&argc, &argv);
        gsh_window=gsh_create_main_window();
-       gsh_check_and_set_geometry();
 
-       terminal=vte_terminal_new();
-       gtk_container_add(GTK_CONTAINER(gsh_window), terminal);
-       vte_terminal_set_size(VTE_TERMINAL(terminal), 80, 32);
-       vte_terminal_set_allow_bold(VTE_TERMINAL(terminal), TRUE);
-       vte_terminal_set_backspace_binding(VTE_TERMINAL(terminal),
-               VTE_ERASE_ASCII_BACKSPACE);
-       gtk_widget_show(terminal);
-
-       for(counter=1; counter < argc; counter++)
-       {
-               if(exec_reached)
-                       asprintf(&command, "%s %s ", command, argv[counter]);
-               else if(!strncmp(argv[counter], "-e", 2))
-                       exec_reached=TRUE;
-       }
-
-       if(!exec_reached)
-               asprintf(&command, "/bin/sh");
-
-       pid=getpid();
-
-       /* This is a workaround for vte's fscking up of option arrays.  */
-       
-       asprintf(&script_name, "/tmp/gshterm.%d", (int)pid);
-       asprintf(&sys_command, "echo '#!/bin/sh' > %s", script_name);
-       system(sys_command);
-       free(sys_command);
-       asprintf(&sys_command, "echo %s >> %s", command, script_name);
-       free(command);
-       system(sys_command);
-       free(sys_command);
-       asprintf(&sys_command, "chmod +x %s", script_name);
-       system(sys_command);
-       free(sys_command);
+       terminal=gshterm_setup_terminal();
+
+       script_name=gshterm_command_script(
+               gshterm_construct_command(argc, argv));
+
+       gsh_check_and_set_geometry();
+       puts(gsh_geometry);
 
        g_signal_connect(G_OBJECT(terminal), "child-exited",
                G_CALLBACK(gshterm_exit_cb), script_name);

Index: gtkshell/callbacks.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/callbacks.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- gtkshell/callbacks.c        1 Feb 2007 20:45:49 -0000       1.1
+++ gtkshell/callbacks.c        8 Feb 2007 23:22:31 -0000       1.2
@@ -27,10 +27,8 @@
 void
 gsh_test_exit()
 {
- if (gsh_button_exits == TRUE)
- {
+       if (gsh_button_exits)
   exit(0);
- }
 }
 
 void

Index: gtkshell/callbacks.h
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/callbacks.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- gtkshell/callbacks.h        1 Feb 2007 20:45:49 -0000       1.1
+++ gtkshell/callbacks.h        8 Feb 2007 23:22:31 -0000       1.2
@@ -23,8 +23,9 @@
 #define GSH_CALLBACKS_H
 
 void
-                system_cb(GtkWidget * widget, gpointer data);
+system_cb(GtkWidget * widget, gpointer data);
 
 void
-                entry_cb(GtkWidget * widget, gpointer data);
+entry_cb(GtkWidget * widget, gpointer data);
+
 #endif

Index: gtkshell/text.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/text.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- gtkshell/text.c     1 Feb 2007 20:45:49 -0000       1.1
+++ gtkshell/text.c     8 Feb 2007 23:22:31 -0000       1.2
@@ -40,7 +40,7 @@
        GtkWidget *entry;
        entry=gsh_setup_command_entry(command);
        g_signal_connect(G_OBJECT(entry), "activate", 
-               G_CALLBACK(gtk_main_quit), (gpointer) command);
+               G_CALLBACK(gtk_main_quit), NULL);
 }
 
 void

Index: libantiright/util.c
===================================================================
RCS file: /sources/antiright/antiright/libantiright/util.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- libantiright/util.c 1 Feb 2007 20:45:49 -0000       1.2
+++ libantiright/util.c 8 Feb 2007 23:22:31 -0000       1.3
@@ -27,7 +27,7 @@
 {
   void *pointer;
   pointer=malloc(size);
-  assert(pointer != NULL); /* Ensure that the allocation was
+  assert(pointer); /* Ensure that the allocation was
                              successful.  */
   return(pointer);
 }

Index: gshterm/gshterm.c
===================================================================
RCS file: gshterm/gshterm.c
diff -N gshterm/gshterm.c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ gshterm/gshterm.c   8 Feb 2007 23:22:30 -0000       1.1
@@ -0,0 +1,137 @@
+/*
+  AntiRight
+  (c) 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 "gshterm.h"
+
+extern char* gsh_geometry;
+
+void
+gshterm_delete_tmp(gpointer data)
+{
+       char *sys_command;
+
+       asprintf(&sys_command, "rm -f %s", data);
+       system(sys_command);
+       free(sys_command);
+}
+
+void
+gshterm_exit_cb(GtkWidget *widget, gpointer data)
+{
+       gshterm_delete_tmp(data);
+       exit(0);
+}
+
+void
+gshterm_set_terminal_options(GtkWidget *terminal)
+{
+       vte_terminal_set_size(VTE_TERMINAL(terminal), 80, 32);
+       vte_terminal_set_allow_bold(VTE_TERMINAL(terminal), TRUE);
+       vte_terminal_set_backspace_binding(VTE_TERMINAL(terminal),
+               VTE_ERASE_ASCII_BACKSPACE);
+}
+
+GtkWidget *
+gshterm_setup_terminal()
+{
+       GtkWidget *terminal;
+
+       terminal=vte_terminal_new();
+       gtk_container_add(GTK_CONTAINER(gsh_window), terminal);
+       gshterm_set_terminal_options(terminal);
+       gtk_widget_show(terminal);
+
+       return(terminal);
+}
+char*
+gshterm_command_script(char *command)
+{
+       char *sys_command;
+       char *script_name;
+       pid_t pid;
+
+
+       /* This is a workaround for vte's fscking up of option arrays.  */
+
+       pid=getpid();
+
+       asprintf(&script_name, "/tmp/gshterm.%d", (int)pid);
+       asprintf(&sys_command, "echo '#!/bin/sh' > %s", script_name);
+       system(sys_command);
+       free(sys_command);
+
+       asprintf(&sys_command, "echo %s >> %s", command, script_name);
+       free(command);
+       system(sys_command);
+       free(sys_command);
+
+       asprintf(&sys_command, "chmod +x %s", script_name);
+       system(sys_command);
+       free(sys_command);
+
+       return(script_name);
+}
+void
+gshterm_handle_command_line_option(gchar option, gchar *arg)
+{
+       putchar(option);
+       assert(arg);
+       switch(option)
+       {
+               case 'g':
+                       asprintf(&gsh_geometry, arg);
+                       break;
+               default:
+                       g_printerr("unknown option");
+       }
+}
+char*
+gshterm_construct_command(int argc, char **argv)
+{
+       gchar *command;
+       gboolean exec_reached;
+       unsigned int counter;
+
+       command=""; /* Initialize to empty for
+                      the first concatenation.  */
+
+       for(counter=1, exec_reached=FALSE; counter < argc; counter++)
+       {
+               if(exec_reached)
+                       asprintf(&command, "%s %s ", command, argv[counter]);
+               else if(!strncmp(argv[counter], "-e", 2))
+                       exec_reached=TRUE;
+               else if(argv[counter][0] == '-')
+               {
+                       gshterm_handle_command_line_option(
+                               argv[counter][1], argv[counter+1]);
+                       counter++;
+               }
+               g_print("\n\t%s\n", argv[counter]);
+       }
+
+       if(!exec_reached)
+               asprintf(&command, "/bin/sh");
+
+       return(command);
+}
+

Index: gshterm/gshterm.h
===================================================================
RCS file: gshterm/gshterm.h
diff -N gshterm/gshterm.h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ gshterm/gshterm.h   8 Feb 2007 23:22:30 -0000       1.1
@@ -0,0 +1,48 @@
+/*
+  AntiRight
+  (c) 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 GSHTERM_H
+#define GSHTERM_H
+
+#include <gtkshell.h>
+#include <vte/vte.h>
+#include <unistd.h>
+
+void
+gshterm_delete_tmp(gpointer data);
+
+void
+gshterm_exit_cb(GtkWidget *widget, gpointer data);
+
+void
+gshterm_set_terminal_options(GtkWidget *terminal);
+
+GtkWidget *
+gshterm_setup_terminal();
+
+char*
+gshterm_command_script(char *command);
+
+char*
+gshterm_construct_command(int argc, char **argv);
+
+#endif
+

Index: gshedit/Makefile
===================================================================
RCS file: gshedit/Makefile
diff -N gshedit/Makefile
--- gshedit/Makefile    4 Feb 2007 04:44:24 -0000       1.2
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,18 +0,0 @@
-include ../config.mk
-
-#CFLAGS+=`pkg-config --cflags gtk+-2.0` -g3 -Wall -W -Werror
-CFLAGS+=`pkg-config --cflags gtksourceview-1.0` 
-CFLAGS+=`pkg-config --cflags gtk+-2.0` $(DEFS) -I../libantiright -I../gtkshell
-LDFLAGS+=-L../libantiright -L../gtkshell
-LDFLAGS+=`pkg-config --libs gtksourceview-1.0`
-LDFLAGS+=`pkg-config --libs gtk+-2.0` -lgtkshell -lantiright
-
-objects=main.o
-all: $(objects) 
-       cc -o gshedit $(objects) $(LDFLAGS)
-
-clean:
-       rm -f gshedit *.o 
-install:
-       install gshedit $(PREFIX)/bin
-

Index: gshedit/main.c
===================================================================
RCS file: gshedit/main.c
diff -N gshedit/main.c
--- gshedit/main.c      4 Feb 2007 04:44:24 -0000       1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,277 +0,0 @@
-/*
-  AntiRight
-  (c) 2002-2006 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>
-#include <gtksourceview/gtksourceview.h>
-#include <gtksourceview/gtksourcebuffer.h>
-
-extern char *gsh_geometry;
-GtkWidget *gshedit_widget;
-GtkWidget *gshedit_scrolled_window;
-GtkSourceBuffer *gshedit_buffer;
-GtkSourceTagTable *gshedit_tags;
-
-void
-gshedit_set_font(gchar *font)
-{
-       PangoFontDescription *font_description;
-
-       font_description=pango_font_description_from_string(font);
-       gtk_widget_modify_font(gshedit_widget, font_description);
-       pango_font_description_free(font_description);
-}
-
-void
-gshedit_set_text_options(GtkWidget *text)
-{
-       gshedit_set_font("Mono 12");
-
-       gtk_source_view_set_show_line_numbers(GTK_SOURCE_VIEW(text), TRUE);
-       gtk_source_view_set_show_line_markers(GTK_SOURCE_VIEW(text), TRUE);
-       gtk_source_view_set_tabs_width(GTK_SOURCE_VIEW(text), 8);
-       gtk_source_view_set_auto_indent(GTK_SOURCE_VIEW(text), TRUE);
-       gtk_source_view_set_margin(GTK_SOURCE_VIEW(text), 80);
-       gtk_source_view_set_show_margin(GTK_SOURCE_VIEW(text), TRUE);
-       gtk_source_view_set_highlight_current_line(GTK_SOURCE_VIEW(text), TRUE);
-       gtk_source_view_set_smart_home_end(GTK_SOURCE_VIEW(text), TRUE);
-}
-
-GtkWidget *
-gshedit_new_text(GtkWidget *parent)
-{
-       GtkWidget *text;
-
-       gshedit_tags=gtk_source_tag_table_new();
-       gshedit_buffer=gtk_source_buffer_new(gshedit_tags);
-       text=gtk_source_view_new_with_buffer(gshedit_buffer);
-       
-       gshedit_set_text_options(text);
-
-       gtk_container_add(GTK_CONTAINER(parent), text);
-       gtk_widget_show(text);
-
-       return(text);
-}
-GtkWidget *
-gshedit_setup_scrolled_window(GtkWidget *parent)
-{
-       GtkWidget *scroll;
-
-       scroll=gtk_scrolled_window_new(NULL,NULL);
-       gtk_container_add(GTK_CONTAINER(parent), scroll);
-       gtk_widget_show(scroll);
-
-       return(scroll);
-}
-
-GtkWidget *
-gshedit_menu_button(GtkWidget *parent, gchar *label)
-{
-       GtkWidget *item;
-       item=gtk_menu_item_new_with_mnemonic(label);
-       gtk_menu_append(GTK_MENU(parent), item);
-       gtk_widget_show(item);
-
-       return(item);
-}
-GtkWidget *
-gshedit_submenu(GtkWidget *menu_item)
-{
-       GtkWidget *menu;
-
-       menu=gtk_menu_new();
-       gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_item), menu);
-       gtk_widget_show(menu);
-
-       return(menu);
-}
-void
-gshedit_open_cb(GtkWidget *widget, gpointer data)
-{
-       char *filename;
-
-       filename=antiright_pipe_read("gtkshell -df");
-       free(filename);
-}
-void
-gshedit_save_as_cb(GtkWidget *widget, gpointer data)
-{
-       char *filename;
-
-       filename=antiright_pipe_read("gtkshell -ds");
-       free(filename);
-}
-void
-gshedit_save_cb(GtkWidget *widget, gpointer data)
-{
-}
-void
-gshedit_exit_cb(GtkWidget *widget, gpointer data)
-{
-       exit(0);
-}
-void
-gshedit_font_cb(GtkWidget *widget, gpointer data)
-{
-       char *font;
-
-       font=antiright_pipe_read("gtkshell -dF");
-       gshedit_set_font(font);
-       free(font);
-}
-
-void
-gshedit_setup_file_menu(GtkWidget *file_menu)
-{
-       GtkWidget *menu;
-       GtkWidget *item;
-
-       menu=gshedit_submenu(file_menu);
-
-       item=gshedit_menu_button(menu, "Open");
-       g_signal_connect(G_OBJECT(item), "activate",
-               G_CALLBACK(gshedit_open_cb), NULL);
-       item=gshedit_menu_button(menu, "Save");
-       g_signal_connect(G_OBJECT(item), "activate",
-               G_CALLBACK(gshedit_save_cb), NULL);
-       item=gshedit_menu_button(menu, "Save As...");
-       g_signal_connect(G_OBJECT(item), "activate",
-               G_CALLBACK(gshedit_save_as_cb), NULL);
-       item=gshedit_menu_button(menu, "Exit");
-       g_signal_connect(G_OBJECT(item), "activate",
-               G_CALLBACK(gshedit_exit_cb), NULL);
-
-}
-void
-gshedit_setup_edit_menu(GtkWidget *edit_menu)
-{
-       GtkWidget *menu;
-       GtkWidget *item;
-       
-       menu=gshedit_submenu(edit_menu);
-
-       item=gshedit_menu_button(menu, "Search/Replace...");
-}
-void
-gshedit_setup_view_menu(GtkWidget *view_menu)
-{
-       GtkWidget *menu;
-       GtkWidget *item;
-
-       menu=gshedit_submenu(view_menu);
-
-       item=gshedit_menu_button(menu, "Change Font...");
-       g_signal_connect(G_OBJECT(item), "activate",
-               G_CALLBACK(gshedit_font_cb), NULL);
-}
-void
-gshedit_setup_help_menu(GtkWidget *help_menu)
-{
-       GtkWidget *menu;
-       GtkWidget *item;
-       
-       menu=gshedit_submenu(help_menu);
-
-       item=gshedit_menu_button(menu, "Manual");
-       item=gshedit_menu_button(menu, "About");
-
-}
-void
-gshedit_setup_menus(GtkWidget *menubar)
-{
-       GtkWidget *file_menu, *edit_menu, *view_menu, *help_menu;
-
-       file_menu=gtk_menu_item_new_with_mnemonic("File");
-       gtk_menu_bar_append(GTK_MENU_BAR(menubar), file_menu);
-       gshedit_setup_file_menu(file_menu);
-       gtk_widget_show(file_menu);
-
-       edit_menu=gtk_menu_item_new_with_mnemonic("Edit");
-       gtk_menu_bar_append(GTK_MENU_BAR(menubar), edit_menu);
-       gshedit_setup_edit_menu(edit_menu);
-       gtk_widget_show(edit_menu);
-
-       view_menu=gtk_menu_item_new_with_mnemonic("View");
-       gtk_menu_bar_append(GTK_MENU_BAR(menubar), view_menu);
-       gshedit_setup_view_menu(view_menu);
-       gtk_widget_show(view_menu);
-
-       help_menu=gtk_menu_item_new_with_mnemonic("Help");
-       gtk_menu_item_set_right_justified(GTK_MENU_ITEM(help_menu), TRUE);
-       gtk_menu_bar_append(GTK_MENU_BAR(menubar), help_menu);
-       gshedit_setup_help_menu(help_menu);
-       gtk_widget_show(help_menu);
-}
-
-GtkWidget *
-gshedit_setup_menubar(GtkWidget *parent)
-{
-       GtkWidget *menubar;
-       
-       menubar=gtk_menu_bar_new();
-       gtk_container_add(GTK_CONTAINER(parent), menubar);
-
-       gshedit_setup_menus(menubar);
-
-       gtk_widget_show(menubar);
-
-       return(menubar);
-}
-
-
-int
-main(int argc, char **argv)
-{
-       GtkWidget *vbox;
-       GtkWidget *menubar;
-       
-       gtk_init(&argc, &argv);
-
-       gsh_window = gsh_create_main_window();
-
-       asprintf(&gsh_geometry, "1000x800");
-       gsh_check_and_set_geometry();
-
-       vbox=gtk_vbox_new(FALSE, 2);
-       gtk_container_add(GTK_CONTAINER(gsh_window), vbox);
-       gtk_widget_show(vbox);
-
-       menubar=gshedit_setup_menubar(vbox);
-
-       gshedit_scrolled_window=gshedit_setup_scrolled_window(vbox);
-
-       gtk_box_set_child_packing(
-               GTK_BOX(vbox), menubar, 
-               FALSE, FALSE, 2, GTK_PACK_START);
-       gtk_box_set_child_packing(
-               GTK_BOX(vbox), gshedit_scrolled_window, 
-               TRUE, TRUE, 2, GTK_PACK_END);
-
-       gshedit_widget=gshedit_new_text(gshedit_scrolled_window);
-       
-       gtk_widget_show(gsh_window);
-
-       gtk_main();
-
-       return(0);
-}
-




reply via email to

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