From 9c5cceeeb803194ebc6ae450b038e4041c582afd Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Wed, 13 Feb 2002 13:03:48 +0000 Subject: New signal for when the width of the column changes. 2002-02-13 Christopher James Lahey * gal/widgets/e-reflow.c, gal/widgets/e-reflow.h (column_width_changed): New signal for when the width of the column changes. * gal/util/e-util.c, gal/util/e-util.h (e_marshal_NONE__DOUBLE): New marshaller. From gal/menus/ChangeLog: 2002-02-13 Christopher James Lahey * gal-view-etable.c (detach_table): Set view->table_state_changed_id to 0. (detach_tree): Set view->tree_state_changed_id to 0. svn path=/trunk/; revision=15705 --- widgets/menus/gal-view-etable.c | 2 ++ widgets/misc/e-reflow.c | 21 +++++++++++++++++++++ widgets/misc/e-reflow.h | 1 + 3 files changed, 24 insertions(+) (limited to 'widgets') diff --git a/widgets/menus/gal-view-etable.c b/widgets/menus/gal-view-etable.c index 87351866bd..f81482435d 100644 --- a/widgets/menus/gal-view-etable.c +++ b/widgets/menus/gal-view-etable.c @@ -38,6 +38,7 @@ detach_table (GalViewEtable *view) if (view->table_state_changed_id) { gtk_signal_disconnect (GTK_OBJECT (view->table), view->table_state_changed_id); + view->table_state_changed_id = 0; } gtk_object_unref (GTK_OBJECT (view->table)); view->table = NULL; @@ -51,6 +52,7 @@ detach_tree (GalViewEtable *view) if (view->tree_state_changed_id) { gtk_signal_disconnect (GTK_OBJECT (view->tree), view->tree_state_changed_id); + view->tree_state_changed_id = 0; } gtk_object_unref (GTK_OBJECT (view->tree)); view->tree = NULL; diff --git a/widgets/misc/e-reflow.c b/widgets/misc/e-reflow.c index ed83956232..f628dec126 100644 --- a/widgets/misc/e-reflow.c +++ b/widgets/misc/e-reflow.c @@ -68,6 +68,7 @@ enum { enum { SELECTION_EVENT, + COLUMN_WIDTH_CHANGED, LAST_SIGNAL }; @@ -569,6 +570,12 @@ disconnect_set_adjustment (EReflow *reflow) } } +static void +column_width_changed (EReflow *reflow) +{ + gtk_signal_emit (GTK_OBJECT (reflow), signals[COLUMN_WIDTH_CHANGED], reflow->column_width); +} + @@ -606,6 +613,7 @@ e_reflow_set_arg (GtkObject *o, GtkArg *arg, guint arg_id) case ARG_COLUMN_WIDTH: if (reflow->column_width != GTK_VALUE_INT (*arg)) { GtkAdjustment *adjustment = gtk_layout_get_hadjustment(GTK_LAYOUT(item->canvas)); + double old_width = reflow->column_width; reflow->column_width = GTK_VALUE_INT (*arg); adjustment->step_increment = (reflow->column_width + E_REFLOW_FULL_GUTTER) / 2; @@ -616,6 +624,9 @@ e_reflow_set_arg (GtkObject *o, GtkArg *arg, guint arg_id) reflow->need_column_resize = TRUE; gnome_canvas_item_request_update(item); + + if (old_width != reflow->column_width) + column_width_changed (reflow); } break; } @@ -874,6 +885,7 @@ e_reflow_event (GnomeCanvasItem *item, GdkEvent *event) gtk_adjustment_changed(adjustment); e_reflow_resize_children(item); e_canvas_item_request_reflow(item); + column_width_changed (reflow); } reflow->need_column_resize = TRUE; gnome_canvas_item_request_update(item); @@ -1262,6 +1274,14 @@ e_reflow_class_init (EReflowClass *klass) e_marshal_INT__OBJECT_POINTER, GTK_TYPE_INT, 2, GTK_TYPE_OBJECT, GTK_TYPE_GDK_EVENT); + signals [COLUMN_WIDTH_CHANGED] = + gtk_signal_new ("column_width_changed", + GTK_RUN_LAST, + E_OBJECT_CLASS_TYPE (object_class), + GTK_SIGNAL_OFFSET (EReflowClass, column_width_changed), + e_marshal_NONE__DOUBLE, + GTK_TYPE_NONE, 1, GTK_TYPE_DOUBLE); + E_OBJECT_CLASS_ADD_SIGNALS (object_class, signals, LAST_SIGNAL); object_class->set_arg = e_reflow_set_arg; @@ -1277,6 +1297,7 @@ e_reflow_class_init (EReflowClass *klass) item_class->point = e_reflow_point; klass->selection_event = e_reflow_selection_event_real; + klass->column_width_changed = NULL; } static void diff --git a/widgets/misc/e-reflow.h b/widgets/misc/e-reflow.h index 5b699431cc..0aed25945c 100644 --- a/widgets/misc/e-reflow.h +++ b/widgets/misc/e-reflow.h @@ -121,6 +121,7 @@ struct _EReflowClass GnomeCanvasGroupClass parent_class; int (*selection_event) (EReflow *reflow, GnomeCanvasItem *item, GdkEvent *event); + void (*column_width_changed) (EReflow *reflow, double width); }; /* -- cgit v1.2.3