Patch for a select all feature



Hi,

following your code for the cut, copy and paste features,
I made select all. ( I hope you didn't already do this :-)
I don't know if it is really useful but sometimes it can be
and most word processing programs have it.

I simply added this to src/send-message.c near the equivalent paste stuff:

The prototype:
---------
static void select_all_cb(GtkWidget* widget, BalsaSendmsg *bsmsg);

The menu entry:
----------
 {
           GNOME_APP_UI_ITEM, N_ ("Select all"), NULL,
           (gpointer) select_all_cb, NULL, NULL, GNOME_APP_PIXMAP_NONE,
           NULL, 'S', GDK_CONTROL_MASK, NULL
   },


The function:
--------
static void
select_all_cb (GtkWidget * widget, BalsaSendmsg *bsmsg)
{
        gtk_editable_select_region(GTK_EDITABLE(bsmsg->text),
                                   0, -1); /* -1 equals EOF. It works. */
}

P.S.: I had to use GNOME_APP_UI_ITEM as otherwise you
wouldn't have a shortcut, but I didn't choose a PIXMAP,
perhaps you could do that.
_______________________________________
Michael Duelli
m.duelli@web.de
http://home.snafu.de/duelli





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