Commit c11eed99 authored by Zbigniew Chyla's avatar Zbigniew Chyla Committed by Arturo Espinosa

Creating auto_expr menu every time it is popped up instead of using one

1998-04-09 Zbigniew Chyla <cyba@t19.ds.pwr.wroc.pl>

	* src/workbook.c: Creating auto_expr menu every time it is popped
        up instead of using one object all the time (and referencing to
        invalid workbook from "activate" signal handler).

        * src/item-grid.c: (item_grid_popup_menu): Fixed memory leak
        (gnumeric_popup_menu used instead of gtk_menu_popup).
parent 36ab057f
1998-04-09 Zbigniew Chyla <cyba@t19.ds.pwr.wroc.pl>
* src/workbook.c: Creating auto_expr menu every time it is popped
up instead of using one object all the time (and referencing to
invalid workbook from "activate" signal handler).
* src/item-grid.c: (item_grid_popup_menu): Fixed memory leak
(gnumeric_popup_menu used instead of gtk_menu_popup).
1999-04-11 Michael Meeks <michael@imaginator.com> 1999-04-11 Michael Meeks <michael@imaginator.com>
* src/expr.c (eval_funccall): New array / 'area' tokens added, * src/expr.c (eval_funccall): New array / 'area' tokens added,
......
1998-04-09 Zbigniew Chyla <cyba@t19.ds.pwr.wroc.pl>
* src/workbook.c: Creating auto_expr menu every time it is popped
up instead of using one object all the time (and referencing to
invalid workbook from "activate" signal handler).
* src/item-grid.c: (item_grid_popup_menu): Fixed memory leak
(gnumeric_popup_menu used instead of gtk_menu_popup).
1999-04-11 Michael Meeks <michael@imaginator.com> 1999-04-11 Michael Meeks <michael@imaginator.com>
* src/expr.c (eval_funccall): New array / 'area' tokens added, * src/expr.c (eval_funccall): New array / 'area' tokens added,
......
1998-04-09 Zbigniew Chyla <cyba@t19.ds.pwr.wroc.pl>
* src/workbook.c: Creating auto_expr menu every time it is popped
up instead of using one object all the time (and referencing to
invalid workbook from "activate" signal handler).
* src/item-grid.c: (item_grid_popup_menu): Fixed memory leak
(gnumeric_popup_menu used instead of gtk_menu_popup).
1999-04-11 Michael Meeks <michael@imaginator.com> 1999-04-11 Michael Meeks <michael@imaginator.com>
* src/expr.c (eval_funccall): New array / 'area' tokens added, * src/expr.c (eval_funccall): New array / 'area' tokens added,
......
1998-04-09 Zbigniew Chyla <cyba@t19.ds.pwr.wroc.pl>
* src/workbook.c: Creating auto_expr menu every time it is popped
up instead of using one object all the time (and referencing to
invalid workbook from "activate" signal handler).
* src/item-grid.c: (item_grid_popup_menu): Fixed memory leak
(gnumeric_popup_menu used instead of gtk_menu_popup).
1999-04-11 Michael Meeks <michael@imaginator.com> 1999-04-11 Michael Meeks <michael@imaginator.com>
* src/expr.c (eval_funccall): New array / 'area' tokens added, * src/expr.c (eval_funccall): New array / 'area' tokens added,
......
#include <gnome-factory.idl> #include <gnome-factory.idl>
#include <Table.idl> #include <Table.idl>
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include "color.h" #include "color.h"
#include "dialogs.h" #include "dialogs.h"
#include "cursors.h" #include "cursors.h"
#include "gnome-util.h"
static GnomeCanvasItem *item_grid_parent_class; static GnomeCanvasItem *item_grid_parent_class;
...@@ -586,7 +587,7 @@ item_grid_popup_menu (ItemGrid *item_grid, GdkEvent *event, int col, int row) ...@@ -586,7 +587,7 @@ item_grid_popup_menu (ItemGrid *item_grid, GdkEvent *event, int col, int row)
menu = create_popup_menu (item_grid, show_paste); menu = create_popup_menu (item_grid, show_paste);
gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, 3, event->button.time); gnumeric_popup_menu (GTK_MENU (menu), (GdkEventButton *) event);
} }
static int static int
......
...@@ -1194,28 +1194,26 @@ change_auto_expr (GtkWidget *item, Workbook *wb) ...@@ -1194,28 +1194,26 @@ change_auto_expr (GtkWidget *item, Workbook *wb)
static void static void
change_auto_expr_menu (GtkWidget *widget, GdkEventButton *event, Workbook *wb) change_auto_expr_menu (GtkWidget *widget, GdkEventButton *event, Workbook *wb)
{ {
static GtkWidget *menu; GtkWidget *menu;
GtkWidget *item;
if (!menu){ int i;
GtkWidget *item;
int i;
menu = gtk_menu_new (); menu = gtk_menu_new ();
for (i = 0; quick_compute_routines [i].displayed_name; i++){ for (i = 0; quick_compute_routines [i].displayed_name; i++){
item = gtk_menu_item_new_with_label ( item = gtk_menu_item_new_with_label (
_(quick_compute_routines [i].displayed_name)); _(quick_compute_routines [i].displayed_name));
gtk_menu_append (GTK_MENU (menu), item); gtk_menu_append (GTK_MENU (menu), item);
gtk_widget_show (item); gtk_widget_show (item);
gtk_signal_connect (GTK_OBJECT (item), "activate", gtk_signal_connect (GTK_OBJECT (item), "activate",
GTK_SIGNAL_FUNC(change_auto_expr), wb); GTK_SIGNAL_FUNC(change_auto_expr), wb);
gtk_object_set_data (GTK_OBJECT (item), "expr", gtk_object_set_data (GTK_OBJECT (item), "expr",
quick_compute_routines [i].function); quick_compute_routines [i].function);
gtk_object_set_data (GTK_OBJECT (item), "name", gtk_object_set_data (GTK_OBJECT (item), "name",
_(quick_compute_routines [i].displayed_name)); _(quick_compute_routines [i].displayed_name));
}
} }
gtk_menu_popup (GTK_MENU (menu), NULL, NULL, 0, NULL, event->button, event->time);
gnumeric_popup_menu (GTK_MENU (menu), event);
} }
/* /*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment