antiright-devel
[Top][All Lists]
Advanced

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

[Antiright-devel] antiright ACE-desktop/guidl/Horizontal_Deskbar....


From: Jeffrey Bedard
Subject: [Antiright-devel] antiright ACE-desktop/guidl/Horizontal_Deskbar....
Date: Thu, 03 May 2007 20:49:20 +0000

CVSROOT:        /sources/antiright
Module name:    antiright
Changes by:     Jeffrey Bedard <jefbed> 07/05/03 20:49:20

Modified files:
        ACE-desktop/guidl: Horizontal_Deskbar.gdl 
        gtkshell       : add_options.c arguments.c button.c button.h 
                         gtkshell.c gtkshell.h guidl_util.c 
                         image_button.c label.c text.c 

Log message:
        Simplified and combined code in several areas.  

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/antiright/ACE-desktop/guidl/Horizontal_Deskbar.gdl?cvsroot=antiright&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/add_options.c?cvsroot=antiright&r1=1.24&r2=1.25
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/arguments.c?cvsroot=antiright&r1=1.20&r2=1.21
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/button.c?cvsroot=antiright&r1=1.32&r2=1.33
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/button.h?cvsroot=antiright&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/gtkshell.c?cvsroot=antiright&r1=1.28&r2=1.29
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/gtkshell.h?cvsroot=antiright&r1=1.37&r2=1.38
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/guidl_util.c?cvsroot=antiright&r1=1.13&r2=1.14
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/image_button.c?cvsroot=antiright&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/label.c?cvsroot=antiright&r1=1.17&r2=1.18
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/text.c?cvsroot=antiright&r1=1.23&r2=1.24

Patches:
Index: ACE-desktop/guidl/Horizontal_Deskbar.gdl
===================================================================
RCS file: 
/sources/antiright/antiright/ACE-desktop/guidl/Horizontal_Deskbar.gdl,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- ACE-desktop/guidl/Horizontal_Deskbar.gdl    30 Apr 2007 17:39:45 -0000      
1.11
+++ ACE-desktop/guidl/Horizontal_Deskbar.gdl    3 May 2007 20:49:20 -0000       
1.12
@@ -3,6 +3,7 @@
 option "rows" 1;
 option "geometry" "+0-0";
 option "undecorated";
+option "no fill";
 // menu button
 // Won't work on some broken versions of GTK, esp. on linux.
 add button "ACE,ACE_32.png::ACE,ACE_32.png::ACE -A 
IDE,Text_Editor_32.png::eclipse-3.2,gtk-execute";
@@ -33,5 +34,6 @@
 add "updating label" "date '+%m/%d/%y%n%H:%M:%S'";
 // Add a user-settable custom updating label.  
 add "separator";
+option "fill";
 add "updating label" "ACE Custom_Updater";
 

Index: gtkshell/add_options.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/add_options.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -b -r1.24 -r1.25
--- gtkshell/add_options.c      3 May 2007 03:42:31 -0000       1.24
+++ gtkshell/add_options.c      3 May 2007 20:49:20 -0000       1.25
@@ -30,21 +30,25 @@
        $(gsh, init);
 }
 
-static void
+static GtkWidget *
 add_piped_label(struct GSH * gsh, const gchar * output)
 {
        gsh_add_label(gsh, output);
+
+       return NULL;
 }
 
-static void
+static GtkWidget *
 add_piped_text(struct GSH * gsh, const gchar * output)
 {
        gsh_text_area_set_text(gsh_text_area(gsh), output);
+
+       return NULL;
 }
 
 static void 
 generic_file_contents(struct GSH * gsh, 
-                     void (*add)(struct GSH *, const gchar *),
+                     GtkWidget * (*add)(struct GSH *, const gchar *),
                      gchar * input)
 {
        (*add)(gsh, input);
@@ -52,7 +56,8 @@
 }
 
 static void 
-add_piped_generic(struct GSH * gsh, void (*add)(struct GSH *, const gchar *))
+add_piped_generic(struct GSH * gsh, 
+       GtkWidget * (*add)(struct GSH *, const gchar *))
 {
        generic_file_contents(gsh, add, antiright_read_file(stdin));
 }
@@ -66,7 +71,7 @@
 
 static void
 generic_commanded_add(struct GSH * gsh, const gchar * command, 
-                     void (*add)(struct GSH *, const gchar * ))
+                     GtkWidget * (*add)(struct GSH *, const gchar * ))
 {
        generic_file_contents(gsh, add, antiright_pipe_read(command));
 }
@@ -85,11 +90,11 @@
                {
                case 'b':
                        generic_commanded_add(gsh, argv[*counter],
-                                             &gsh_new_button);
+                               gsh->add_button);
                        break;
                case 'l':
                        generic_commanded_add(gsh, argv[*counter],
-                                             &gsh_new_label);
+                               gsh->add_label);
                }
                break;
        case 'e':

Index: gtkshell/arguments.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/arguments.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -b -r1.20 -r1.21
--- gtkshell/arguments.c        2 May 2007 14:55:31 -0000       1.20
+++ gtkshell/arguments.c        3 May 2007 20:49:20 -0000       1.21
@@ -25,17 +25,6 @@
 
 #define SPLIT_ALL -1
 
-static void
-test_button_or_menubutton(struct GSH * gsh, 
-                         const gchar * string,
-                         gchar ** tokens)
-{
-       if(ARPBOOL(tokens[1]))
-               menubutton_parse(gsh, tokens);
-       else
-               gsh_new_button(gsh, (char *)string);
-}
-
 /* Decide whether to use a regular button or a menu button.  */
 static void
 button_parse(struct GSH * gsh, const gchar * string)
@@ -43,26 +32,18 @@
        gchar **tokens;
 
        tokens=g_strsplit(string, "::", SPLIT_ALL);
-       test_button_or_menubutton(gsh, string, tokens);
+       /* Determine if the button is a regular button or a menu button.  */
+       tokens[1] ? menubutton_parse(gsh, tokens) : $(gsh, add_button, string);
        g_strfreev(tokens);
 }
 
-static void
-test_option_or_argument(struct GSH * gsh, 
-                       int argc, char ** argv, 
-                       int *counter)
-{
-       if (argv[*counter][0] == '-')
-               gsh_handle_switch_arguments(gsh, argc, argv, counter);
-       else
-               button_parse(gsh, argv[*counter]);
-}
-
 void
 gsh_parse_arguments(struct GSH * gsh, gint argc, gchar **argv)
 {
        int counter;
 
        for (counter = 1; counter < argc; counter++)
-               test_option_or_argument(gsh, argc, argv, &counter);
+               (argv[counter][0] == '-') ?
+                       gsh_handle_switch_arguments(gsh, argc, argv, &counter)
+                       : button_parse(gsh, argv[counter]);
 }

Index: gtkshell/button.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/button.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -b -r1.32 -r1.33
--- gtkshell/button.c   2 May 2007 14:55:31 -0000       1.32
+++ gtkshell/button.c   3 May 2007 20:49:20 -0000       1.33
@@ -27,8 +27,8 @@
 {
        GtkWidget * label;
 
-       label = gtk_label_new(formatted);
-       gtk_container_add(GTK_CONTAINER(widget), label);
+       gtk_container_add(GTK_CONTAINER(widget), 
+               label = gtk_label_new(formatted));
        gtk_widget_show(label);
 }
 
@@ -48,30 +48,21 @@
 static void
 setup_callback(struct GSH * gsh, const gchar * command)
 {
-       struct GSH_CBData * cb;
-
-       cb = gsh_new_GSH_CBData(gsh, g_strdup(command));
-       if(!GSH_FLAG(GSH_MENU_BUTTON) 
-          && GTK_IS_MENU_ITEM(gsh->button)) /* menu item button  */
-               (void) g_signal_connect(G_OBJECT(gsh->button), 
-                               "activate", G_CALLBACK(gsh_system_cb), cb);
-       else if(!GSH_FLAG(GSH_MENU_BUTTON)) /* not a menu launcher button */
-               (void) g_signal_connect(G_OBJECT(gsh->button), 
-                               "clicked", G_CALLBACK(gsh_system_cb), cb);
-
-       if(GSH_FLAG(GSH_MENU_BUTTON)) /* Button is a menu launcher button.  */
+       if(!GSH_FLAG(GSH_MENU_BUTTON))
+               (void)g_signal_connect(G_OBJECT(gsh->button), 
+                       GTK_IS_MENU_ITEM(gsh->button) ? "activate" : "clicked",
+                       G_CALLBACK(gsh_system_cb), 
+                       ARNEW(gsh, GSH_CBData, gsh, g_strdup(command)));
+       else
                GSH_UNSET(GSH_MENU_BUTTON);
 }
 
 static void
 create_button(struct GSH * gsh)
 {
-       if(!GTK_IS_MENU(gsh->rows->v) 
-          && !GTK_IS_MENU_BAR(gsh->rows->v))
-               gsh->button = gtk_button_new();
-       else
-               gsh->button = gtk_menu_item_new();
-       gtk_widget_show(gsh->button);
+       gtk_widget_show(gsh->button=(!GTK_IS_MENU(gsh->rows->v) 
+               && !GTK_IS_MENU_BAR(gsh->rows->v)) ? 
+               gtk_button_new() : gtk_menu_item_new());
 }
 
 static void
@@ -82,26 +73,6 @@
        setup_callback(gsh, command);
 }
 
-void
-gsh_command_button(struct GSH * gsh, const gchar *command)
-{
-#ifdef DEBUG
-       ARPASSERT(gsh);
-#endif /* DEBUG */
-
-       create_button(gsh);
-       setup_command_button(gsh, command);
-       {
-               gboolean no_expand_set;
-
-               no_expand_set=GSH_FLAG(GSH_NO_EXPAND);
-               if(!no_expand_set)
-                       GSH_SET(GSH_NO_EXPAND);
-               gsh_manage(gsh, gsh->button);
-               if(!no_expand_set)
-                       GSH_UNSET(GSH_NO_EXPAND);
-       }
-}
 
 static gboolean
 test_pair(struct GSH * gsh, gchar **pair)
@@ -120,7 +91,9 @@
        gchar **pair;
 
        pair=g_strsplit(string, ",", 2);
+#ifdef DEBUG
        ARPASSERT(pair);
+#endif /* DEBUG */
        {
                gboolean return_value;
 
@@ -131,13 +104,25 @@
        }
 }
 
-void
+static void
 gsh_new_button(struct GSH * gsh, const gchar * string)
 {
        if(!test_image_button(gsh, string))     
                gsh_command_button(gsh, string);
 }
 
+void
+gsh_command_button(struct GSH * gsh, const gchar *command)
+{
+#ifdef DEBUG
+       ARPASSERT(gsh);
+#endif /* DEBUG */
+
+       create_button(gsh);
+       setup_command_button(gsh, command);
+       gsh_manage(gsh, gsh->button);
+}
+
 /* This is just a wrapper around gsh_new_button(), to
    follow the convention of returning a created widget.  */
 GtkWidget *

Index: gtkshell/button.h
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/button.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- gtkshell/button.h   27 Apr 2007 02:02:06 -0000      1.7
+++ gtkshell/button.h   3 May 2007 20:49:20 -0000       1.8
@@ -26,9 +26,6 @@
 void
 gsh_command_button(struct GSH * gsh, const gchar *command);
 
-void 
-gsh_new_button(struct GSH * gsh, const gchar * string);
-
 GtkWidget *
 gsh_add_button(struct GSH * gsh, const gchar * string);
 

Index: gtkshell/gtkshell.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/gtkshell.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -b -r1.28 -r1.29
--- gtkshell/gtkshell.c 3 May 2007 03:42:31 -0000       1.28
+++ gtkshell/gtkshell.c 3 May 2007 20:49:20 -0000       1.29
@@ -104,6 +104,8 @@
        gsh->finalize = &gsh_GSH_finalize;
        gsh->init = &gsh_GSH_init;
        gsh->window = (*(gsh->new_window = &gsh_GSH_new_window))(gsh);
+       gsh->add_button=&gsh_add_button;
+       gsh->add_label=&gsh_add_label;
 }
 
 struct GSH *

Index: gtkshell/gtkshell.h
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/gtkshell.h,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -b -r1.37 -r1.38
--- gtkshell/gtkshell.h 3 May 2007 03:42:31 -0000       1.37
+++ gtkshell/gtkshell.h 3 May 2007 20:49:20 -0000       1.38
@@ -72,6 +72,8 @@
        void (*init)(struct GSH *);
        void (*finalize)(struct GSH *);
        GtkWidget * (*new_window)(struct GSH *);
+       GtkWidget * (*add_button)(struct GSH *, const gchar *);
+       GtkWidget * (*add_label)(struct GSH *, const gchar *);
 };
 
 #include "arguments.h"

Index: gtkshell/guidl_util.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/guidl_util.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- gtkshell/guidl_util.c       3 May 2007 03:42:31 -0000       1.13
+++ gtkshell/guidl_util.c       3 May 2007 20:49:20 -0000       1.14
@@ -66,8 +66,8 @@
 {
        struct GDLEnvironment * env;
 
-       env=(struct GDLEnvironment *)g_malloc(sizeof(struct GDLEnvironment));
-       gsh_setup_GDLEnvironment(env);
+       gsh_setup_GDLEnvironment(env=(struct GDLEnvironment *)g_malloc(
+               sizeof(struct GDLEnvironment)));
 
        return env;
 }

Index: gtkshell/image_button.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/image_button.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- gtkshell/image_button.c     2 May 2007 14:55:31 -0000       1.10
+++ gtkshell/image_button.c     3 May 2007 20:49:20 -0000       1.11
@@ -23,72 +23,76 @@
 #include "gtkshell.h"
 
 static void 
-generic_image_button(struct GSH * gsh, char *command, 
-                    GtkWidget * image)
+set_menu_item_image(struct GSH * gsh, GtkWidget * image)
 {
-       gsh_command_button(gsh, command);
-       if(!GTK_IS_MENU_BAR(gsh->rows->v) && !GTK_IS_MENU_ITEM(gsh->rows->v)
-          && !GTK_IS_MENU(gsh->rows->v))
-       {
-               gtk_button_set_image(GTK_BUTTON(gsh->button), image);
-               gtk_button_set_relief(GTK_BUTTON(gsh->button), GTK_RELIEF_NONE);
-       }
-       else
-       {
                GtkWidget * label;
-               GtkWidget * hrow;
 
                label=gtk_bin_get_child(GTK_BIN(gsh->button));
                gtk_widget_ref(label);
                gtk_container_remove(GTK_CONTAINER(gsh->button), label);
+       {
+               GtkWidget * hrow;
+
                hrow=gtk_hbox_new(FALSE, 2);
                gtk_container_add(GTK_CONTAINER(gsh->button), hrow);
-               gtk_widget_show(hrow);
                gtk_box_pack_start(GTK_BOX(hrow), image, FALSE, FALSE, 0);
-               gtk_widget_show(image);
                gtk_container_add(GTK_CONTAINER(hrow), label);
-
-               gtk_widget_show(label);
+               gtk_widget_show(hrow);
        }
+       gtk_widget_show(image);
+       gtk_widget_show(label);
 }
 
-static GtkWidget *
-get_image(const gchar * name)
+static void
+set_button_image(struct GSH * gsh, GtkWidget * image)
 {
-       GtkWidget *image;
-
-       ARIFB(g_file_test(name, G_FILE_TEST_EXISTS))
-               image = gtk_image_new_from_file(name);
-       else
-       {
-               gchar * prefixed_name;
+       gtk_button_set_image(GTK_BUTTON(gsh->button), image);
+       gtk_button_set_relief(GTK_BUTTON(gsh->button), GTK_RELIEF_NONE);
+}
 
-               ar_asprintf(&prefixed_name, 
-                           "%s/share/ACE-desktop/icons/%s", 
-                           PREFIX, name);
-               ARIFB(g_file_test(prefixed_name, G_FILE_TEST_EXISTS))
+static void 
+generic_image_button(struct GSH * gsh, const gchar *command, 
+                    GtkWidget * image)
+{
+       gsh_command_button(gsh, command);
+       ARIFP(image)
                {
-#ifdef DEBUG
-                       ARBUG("using prefixed image");
-#endif /* DEBUG */
-                       image = gtk_image_new_from_file(prefixed_name);
-               }
+               gtk_widget_show(image);
+               if(!GTK_IS_MENU_BAR(gsh->rows->v) 
+                  && !GTK_IS_MENU_ITEM(gsh->rows->v)
+                  && !GTK_IS_MENU(gsh->rows->v))
+                       set_button_image(gsh, image);
                else
-               {
-#ifdef DEBUG
-                       ARBUG("trying stock image");
-#endif /* DEBUG */
-                       image = gtk_image_new_from_stock(
-                               (const gchar *)name,
-                               GTK_ICON_SIZE_DND);
+                       set_menu_item_image(gsh, image);
                }
+}
+
+/* Get an image from the antiright icon distribution or the GTK stock
+   icon set.  */
+static GtkWidget * 
+get_default_image(const gchar * name)
+{
+       gchar * prefixed_name;
+       GtkWidget * image;
 
+       ar_asprintf(&prefixed_name, "%s/share/ACE-desktop/icons/%s", 
+                           PREFIX, name);
+       image = g_file_test(prefixed_name, G_FILE_TEST_EXISTS)
+               ? gtk_image_new_from_file(prefixed_name)
+               : gtk_image_new_from_stock(name, GTK_ICON_SIZE_DND);
                g_free(prefixed_name);
-       }
 
        return image;
 }
 
+static GtkWidget *
+get_image(const gchar * name)
+{
+       return g_file_test(name, G_FILE_TEST_EXISTS)
+               ? gtk_image_new_from_file(name)
+               : get_default_image(name);
+}
+
 void
 gsh_image_button(struct GSH * gsh, char *command, char *name)
 {

Index: gtkshell/label.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/label.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -b -r1.17 -r1.18
--- gtkshell/label.c    3 May 2007 03:42:31 -0000       1.17
+++ gtkshell/label.c    3 May 2007 20:49:20 -0000       1.18
@@ -35,33 +35,28 @@
        gsh_widget_set_font(label, NULL);
 }
 
-GtkWidget *
-gsh_add_label(struct GSH * gsh, const gchar *text)
+static GtkWidget *
+make_framed_label(GtkWidget * label)
 {
-       GtkWidget *label;
-       GtkWidget *to_be_managed;
-
-       ARPASSERT(gsh);
-
-       label = gtk_label_new(text);
-
-       ARPASSERT(label);
-
-       set_options(gsh, label);
-
-       if(GSH_FLAG(GSH_FRAMED_LABELS))
+       gtk_widget_show(label);
        {
                GtkWidget *frame;
 
-               frame = gtk_frame_new(NULL);
-               gtk_container_add(GTK_CONTAINER(frame), label);
-               gtk_widget_show(label);
-               to_be_managed = frame;
+               gtk_container_add(GTK_CONTAINER(frame=gtk_frame_new(NULL)), 
+                       label);
+
+               return frame;
        }
-       else
-               to_be_managed = label;
+}
+
+GtkWidget *
+gsh_add_label(struct GSH * gsh, const gchar *text)
+{
+       GtkWidget *label;
 
-       gsh_manage(gsh, to_be_managed);
+       set_options(gsh, label=gtk_label_new(text));
+       gsh_manage(gsh, GSH_FLAG(GSH_FRAMED_LABELS) 
+               ? make_framed_label(label) : label);
 
        return label;
 }

Index: gtkshell/text.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/text.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- gtkshell/text.c     3 May 2007 03:42:31 -0000       1.23
+++ gtkshell/text.c     3 May 2007 20:49:20 -0000       1.24
@@ -22,23 +22,24 @@
 
 #include "gtkshell.h"
 
+#define ADD_ENTRY(widget, str) gtk_combo_box_prepend_text(widget, str)
+#define ENTRY(str) ADD_ENTRY(widget, str)
+
 static void
 append_sample_entries(GtkComboBox * widget)
 {
        /* Some sample entries to use when history is not useful, such as a
         * dialog presentation of this field, where the window displaying the
         * field closes on the first activation.  */
-       gtk_combo_box_prepend_text(widget, "ACE -A Terminal");
-       gtk_combo_box_prepend_text(widget, "ACE -A Settings");
-       gtk_combo_box_prepend_text(widget, "ACE -A IDE");
-       gtk_combo_box_prepend_text(widget, "ACE");
+       ENTRY("ACE -A Terminal");
+       ENTRY("ACE -A Settings");
+       ENTRY("ACE -A IDE");
+       ENTRY("ACE");
 }
 
 static void
 setup_entry_cb(struct GSH * gsh, GtkWidget * entry, const gchar * command)
 {
-       struct GSH_CBData * cb;
-
 #ifdef DEBUG
        /* Validate parameters.  */
        ARPASSERT(gsh);
@@ -46,13 +47,10 @@
        ARPASSERT(command);
 #endif /* DEBUG */
 
-       cb=gsh_new_GSH_CBData(gsh, (gpointer)((command != NULL) 
-                             ? command : "echo"));
-
-       (void) g_signal_connect(G_OBJECT(gtk_bin_get_child(GTK_BIN(entry))), 
-                               "activate",
-                               G_CALLBACK(gsh_entry_cb), 
-                               (gpointer) cb);
+       g_signal_connect(G_OBJECT(gtk_bin_get_child(GTK_BIN(entry))), 
+               "activate", G_CALLBACK(gsh_entry_cb), 
+               (gpointer) ARNEW(gsh, GSH_CBData, gsh,
+               (gpointer)(command ? command : "echo")));
 }
 
 GtkWidget *
@@ -64,9 +62,8 @@
        ARPASSERT(gsh);
 #endif /* DEBUG */
 
-       /* Create widget.  */
-       entry = gtk_combo_box_entry_new_text();
-       setup_entry_cb(gsh, entry, command);
+       /* Create widget and assign callback.  */
+       setup_entry_cb(gsh, entry=gtk_combo_box_entry_new_text(), command);
        append_sample_entries(GTK_COMBO_BOX(entry));
        /* Do not fill remaining container area.  */
        gsh_manage(gsh, entry);
@@ -79,15 +76,15 @@
 {
        GtkWidget *text;
 
-       text = gtk_text_view_new();
-       gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(text), GTK_WRAP_WORD);
+       gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(text=gtk_text_view_new()), 
+               GTK_WRAP_WORD);
        gsh_manage(gsh, text);
        gsh_widget_set_font(text, NULL);
 
        return text;
 }
 
-void
+inline void
 gsh_text_area_set_text(GtkWidget * widget, const gchar * text)
 {
        gtk_text_buffer_set_text(
@@ -106,8 +103,8 @@
        {
                gchar * text;
 
-               text=antiright_read_named_file(filename);
-               gsh_text_area_set_text(gsh_text_area(gsh), text);
+               gsh_text_area_set_text(gsh_text_area(gsh), 
+                       text=antiright_read_named_file(filename));
                g_free(text);
        }
        ARIFNP(gsh->geometry)




reply via email to

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