[gnumeric] Compilation: dead kittens. (Still incomplete.)



commit 3c1a5512685802d5e08c22c8002b902f542ffc3e
Author: Morten Welinder <terra gnome org>
Date:   Fri Nov 5 16:38:13 2010 -0400

    Compilation: dead kittens.  (Still incomplete.)

 configure.in                              |   31 +++++++++++++-
 src/dead-kittens.h                        |   61 ++++++++++++++++++++++++----
 src/dialogs/dialog-cell-format.c          |    9 +---
 src/dialogs/dialog-delete-cells.c         |    2 +-
 src/dialogs/dialog-doc-metadata.c         |    2 +-
 src/dialogs/dialog-fill-series.c          |    8 ++--
 src/dialogs/dialog-insert-cells.c         |    2 +-
 src/dialogs/dialog-printer-setup.c        |    8 ++-
 src/dialogs/dialog-search.c               |    2 +-
 src/dialogs/dialog-stf-fixed-page.c       |   36 +++++++++++++----
 src/dialogs/dialog-stf-format-page.c      |   22 +++++++---
 src/dialogs/dialog-stf-preview.c          |    8 ++-
 src/dialogs/dialog-tabulate.c             |   39 +++++++++++++------
 src/gnm-pane.c                            |    2 +-
 src/gui-file.c                            |   14 +++---
 src/gui-util.c                            |   23 ++++++-----
 src/io-context-gtk.c                      |    8 ++--
 src/item-bar.c                            |   37 ++++++++++--------
 src/item-cursor.c                         |    2 +-
 src/item-edit.c                           |    6 ++-
 src/sheet-control-gui.c                   |   21 ++++++----
 src/sheet-object-widget.c                 |   34 ++++++++--------
 src/wbc-gtk-actions.c                     |    4 +-
 src/wbc-gtk-edit.c                        |   12 +++--
 src/wbc-gtk.c                             |   35 +++++++++--------
 src/widgets/gnm-cell-combo-view.c         |   31 ++++++++-------
 src/widgets/gnm-dao.c                     |    2 +-
 src/widgets/gnm-filter-combo-view.c       |    4 +-
 src/widgets/gnm-notebook.c                |   20 ++++++---
 src/widgets/gnumeric-cell-renderer-text.c |    2 +-
 src/widgets/gnumeric-expr-entry.c         |    3 +-
 src/widgets/widget-editable-label.c       |    9 ++--
 src/widgets/widget-font-selector.c        |    3 +-
 33 files changed, 325 insertions(+), 177 deletions(-)
---
diff --git a/configure.in b/configure.in
index c604c37..c040f2b 100644
--- a/configure.in
+++ b/configure.in
@@ -689,14 +689,39 @@ LIBS="$GNUMERIC_LIBS $LIBS"
 AC_CHECK_FUNCS(g_option_context_set_delocalize g_hash_table_get_keys)
 AC_CHECK_FUNCS(pango_font_map_create_context)
 AC_CHECK_FUNCS(gtk_adjustment_configure gtk_adjustment_set_lower gtk_adjustment_set_upper gtk_adjustment_get_page_size)
-AC_CHECK_FUNCS(gtk_check_menu_item_get_active)
 AC_CHECK_FUNCS(gtk_dialog_get_content_area gtk_dialog_get_action_area)
-AC_CHECK_FUNCS(gtk_entry_get_text_length gtk_entry_set_icon_from_stock gtk_entry_get_buffer )
+AC_CHECK_FUNCS(gtk_entry_get_text_length gtk_entry_set_icon_from_stock gtk_entry_get_buffer gtk_entry_get_text_area)
 AC_CHECK_FUNCS(gtk_layout_get_bin_window)
 AC_CHECK_FUNCS(gtk_orientable_set_orientation)
-AC_CHECK_FUNCS(gtk_widget_get_visible gtk_widget_set_visible gtk_widget_get_state gtk_widget_is_toplevel gtk_widget_get_window gtk_widget_get_can_focus gtk_widget_has_focus gtk_widget_get_style gtk_widget_get_allocation)
+AC_CHECK_FUNCS(gtk_table_get_size)
+AC_CHECK_FUNCS(gtk_tree_view_column_get_button)
+AC_CHECK_FUNCS(gtk_widget_get_visible gtk_widget_set_visible gtk_widget_get_state gtk_widget_is_toplevel gtk_widget_get_window gtk_widget_get_can_focus gtk_widget_has_focus gtk_widget_get_style gtk_widget_get_allocation gtk_widget_is_sensitive gtk_widget_set_can_focus gtk_widget_get_realized)
 AC_CHECK_FUNCS(gsf_infile_msvba_steal_modules gsf_open_pkg_foreach_rel )
 
+AC_MSG_CHECKING([working GTK_WIDGET_REALIZED.])
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <gtk/gtk.h>]],
+				[[GtkWidget *w = NULL;
+				(void)(GTK_WIDGET_REALIZED (w));]])],
+               [AC_DEFINE(HAVE_WORKING_GTK_WIDGET_REALIZED, 1, [Define if GTK_WIDGET_REALIZED exists and works])
+		AC_MSG_RESULT(yes)],
+	       [AC_MSG_RESULT(no)])
+
+AC_MSG_CHECKING([for GtkEntry::text_area])
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <gtk/gtk.h>]],
+				[[GtkEntry *e = NULL;
+				(void)(e->text_area);]])],
+               [AC_DEFINE(HAVE_GTK_ENTRY_TEXT_AREA, 1, [Define if GtkEntry::text_area exists])
+		AC_MSG_RESULT(yes)],
+	       [AC_MSG_RESULT(no)])
+
+AC_MSG_CHECKING([for GtkTreeViewColumn::button])
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <gtk/gtk.h>]],
+				[[GtkTreeViewColumn *c = NULL;
+				(void)(c->button);]])],
+               [AC_DEFINE(HAVE_GTK_TREE_VIEW_COLUMN_BUTTON, 1, [Define if GtkTreeViewColumn::button exists])
+		AC_MSG_RESULT(yes)],
+	       [AC_MSG_RESULT(no)])
+
 AC_MSG_CHECKING([for PANGO_WEIGHT_THIN etc.])
 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pango/pango.h>]],
 				[[(void)(PANGO_WEIGHT_THIN == 42);
diff --git a/src/dead-kittens.h b/src/dead-kittens.h
index f6f2899..6d3c1f3 100644
--- a/src/dead-kittens.h
+++ b/src/dead-kittens.h
@@ -15,8 +15,16 @@
 #define gtk_entry_get_text_length(x) g_utf8_strlen (gtk_entry_get_text (x), -1)
 #endif
 
+#ifndef HAVE_GTK_ENTRY_GET_TEXT_AREA
+#  ifdef HAVE_GTK_ENTRY_TEXT_AREA
+#    define gtk_entry_get_text_area(x) ((x)->text_area)
+#  else
+#    define gtk_entry_get_text_area(x) ((x)->_g_sealed__text_area)
+#  endif
+#endif
+
 #ifndef HAVE_GTK_LAYOUT_GET_BIN_WINDOW
-#define gtk_layout_get_bin_window(x) (x)->bin_window
+#define gtk_layout_get_bin_window(x) ((x)->bin_window)
 #endif
 
 #ifndef HAVE_GTK_WIDGET_SET_VISIBLE
@@ -27,6 +35,10 @@
 #define gtk_widget_get_visible(_w_) GTK_WIDGET_VISIBLE(_w_)
 #endif
 
+#ifndef HAVE_GTK_WIDGET_IS_SENSITIVE
+#define gtk_widget_is_sensitive(w) GTK_WIDGET_IS_SENSITIVE (w)
+#endif
+
 #ifndef HAVE_GTK_WIDGET_IS_TOPLEVEL
 #define gtk_widget_is_toplevel(w_) (GTK_WIDGET_FLAGS ((w_)) & GTK_TOPLEVEL)
 #endif
@@ -44,19 +56,31 @@
 #endif
 
 #ifndef HAVE_GTK_WIDGET_GET_STYLE
-#define gtk_widget_get_style(w) (w)->style
+#define gtk_widget_get_style(w) ((w)->style)
 #endif
 
 #ifndef HAVE_GTK_WIDGET_HAS_FOCUS
 #define gtk_widget_has_focus(w) GTK_WIDGET_HAS_FOCUS (w)
 #endif
 
-#ifndef  HAVE_GTK_DIALOG_GET_CONTENT_AREA
-#define gtk_dialog_get_content_area(w) ((w)->vbox)
+#ifndef HAVE_GTK_WIDGET_SET_CAN_FOCUS
+#define gtk_widget_set_can_focus(w,t)					\
+	do {								\
+		if (t) GTK_WIDGET_SET_FLAGS ((w), GTK_CAN_FOCUS);	\
+		else GTK_WIDGET_UNSET_FLAGS ((w), GTK_CAN_FOCUS);	\
+	} while (0)		     
+#endif
+
+#ifndef HAVE_GTK_WIDGET_GET_REALIZED
+#  ifdef HAVE_WORKING_GTK_WIDGET_REALIZED
+#    define gtk_widget_get_realized(w) GTK_WIDGET_REALIZED (w)
+#  else
+#    define gtk_widget_get_realized(wid) (((GTK_OBJECT (wid)->_g_sealed__flags) & GTK_REALIZED) != 0)
+#  endif
 #endif
 
-#ifndef HAVE_GTK_CHECK_MENU_ITEM_GET_ACTIVE
-#define gtk_check_menu_item_get_active(cm) ((cm)->active)
+#ifndef  HAVE_GTK_DIALOG_GET_CONTENT_AREA
+#define gtk_dialog_get_content_area(w) ((w)->vbox)
 #endif
 
 #ifndef HAVE_GTK_ADJUSTMENT_CONFIGURE
@@ -72,17 +96,36 @@
 #endif
 
 #ifndef HAVE_GTK_ADJUSTMENT_GET_PAGE_SIZE
-#define gtk_adjustment_get_page_size (_a) ((_a)->page_size)
+#define gtk_adjustment_get_page_size(_a) ((_a)->page_size)
 #endif
 
 #ifndef HAVE_GTK_ADJUSTMENT_SET_LOWER
 #define gtk_adjustment_set_lower (_a,_l) \
-  g_object_set (_a, "lower", (double)(_l), NULL)
+  g_object_set ((_a), "lower", (double)(_l), NULL)
 #endif
 
 #ifndef HAVE_GTK_ADJUSTMENT_SET_UPPER
 #define gtk_adjustment_set_upper (_a,_u) \
-  g_object_set (_a, "upper", (double)(_u), NULL)
+  g_object_set ((_a), "upper", (double)(_u), NULL)
+#endif
+
+#ifndef HAVE_GTK_TABLE_GET_SIZE
+/* At first sealed with no accessors.  */
+#define gtk_table_get_size(_t,_r,_c) do {		\
+  int *_pr = (_r);					\
+  int *_pc = (_c);					\
+  if (_pr) g_object_get (_t, "n-rows", _pr, NULL);	\
+  if (_pc) g_object_get (_t, "n-cols", _pc, NULL);	\
+} while (0)
+#endif
+
+/* This function does not exist in gtk+ yet.  634100.  */
+#ifndef HAVE_GTK_TREE_VIEW_COLUMN_GET_BUTTON
+#  ifdef HAVE_GTK_TREE_VIEW_COLUMN_BUTTON
+#    define gtk_tree_view_column_get_button(_c) ((_c)->button)
+#  else
+#    define gtk_tree_view_column_get_button(_c) ((_c)->_g_sealed__button)
+#  endif
 #endif
 
 #endif
diff --git a/src/dialogs/dialog-cell-format.c b/src/dialogs/dialog-cell-format.c
index 49f1a4a..6bce5e4 100644
--- a/src/dialogs/dialog-cell-format.c
+++ b/src/dialogs/dialog-cell-format.c
@@ -2384,17 +2384,14 @@ set_initial_focus (FormatState *s)
 		focus_widget = NULL;
 
 
-#ifdef HAVE_GTK_WIDGET_GET_CAN_FOCUS
 	if (focus_widget
+#ifdef HAVE_GTK_WIDGET_GET_CAN_FOCUS
 	    && gtk_widget_get_can_focus (focus_widget)
-	    && gtk_widget_is_sensitive (focus_widget))
-		gtk_widget_grab_focus (focus_widget);
 #else
-	if (focus_widget
 	    && GTK_WIDGET_CAN_FOCUS (focus_widget)
-	    && GTK_WIDGET_IS_SENSITIVE (focus_widget))
-		gtk_widget_grab_focus (focus_widget);
 #endif
+	    && gtk_widget_is_sensitive (focus_widget))
+		gtk_widget_grab_focus (focus_widget);
 }
 
 static void
diff --git a/src/dialogs/dialog-delete-cells.c b/src/dialogs/dialog-delete-cells.c
index 1195f73..2947bc6 100644
--- a/src/dialogs/dialog-delete-cells.c
+++ b/src/dialogs/dialog-delete-cells.c
@@ -70,7 +70,7 @@ cb_delete_cell_ok_clicked (DeleteCellState *state)
 	g_return_if_fail (radio_0 != NULL);
 
 	i = gtk_radio_group_get_selected
-		(GTK_RADIO_BUTTON (radio_0)->group);
+	  (gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio_0)));
 
 	cols = state->sel->end.col - state->sel->start.col + 1;
 	rows = state->sel->end.row - state->sel->start.row + 1;
diff --git a/src/dialogs/dialog-doc-metadata.c b/src/dialogs/dialog-doc-metadata.c
index 6d60d21..47e582c 100644
--- a/src/dialogs/dialog-doc-metadata.c
+++ b/src/dialogs/dialog-doc-metadata.c
@@ -1054,7 +1054,7 @@ cb_dialog_doc_metadata_remove_clicked (GtkWidget         *remove_bt,
 			       &list_iter);
 
 	/* Clear entries on 'Properties' page */
-	entry = GTK_ENTRY (GTK_BIN (state->ppt_name)->child);
+	entry = GTK_ENTRY (gtk_bin_get_child (GTK_BIN (state->ppt_name)));
 	gtk_entry_set_text (entry, "");
 
 	gtk_entry_set_text (state->ppt_value, "");
diff --git a/src/dialogs/dialog-fill-series.c b/src/dialogs/dialog-fill-series.c
index 52e1cd4..7587725 100644
--- a/src/dialogs/dialog-fill-series.c
+++ b/src/dialogs/dialog-fill-series.c
@@ -98,17 +98,17 @@ cb_fill_series_ok_clicked (G_GNUC_UNUSED GtkWidget *button,
 	/* Read the `Series in' radio buttons. */
 	radio = go_gtk_builder_get_widget (state->base.gui, "series_in_rows");
 	fs->series_in_rows = ! gtk_radio_group_get_selected
-	        (GTK_RADIO_BUTTON (radio)->group);
+	        (gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio)));
 
 	/* Read the `Type' radio buttons. */
 	radio = go_gtk_builder_get_widget (state->base.gui, "type_linear");
 	fs->type = gtk_radio_group_get_selected
-	        (GTK_RADIO_BUTTON (radio)->group);
+	        (gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio)));
 
 	/* Read the `Date unit' radio buttons. */
 	radio = go_gtk_builder_get_widget (state->base.gui, "unit_day");
 	fs->date_unit = gtk_radio_group_get_selected
-	        (GTK_RADIO_BUTTON (radio)->group);
+	        (gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio)));
 
 	fs->is_step_set = ! entry_to_float (GTK_ENTRY (state->step_entry),
 					    &fs->step_value, TRUE);
@@ -133,7 +133,7 @@ cb_type_button_clicked (G_GNUC_UNUSED GtkWidget *button,
 
 	/* Read the `Type' radio buttons. */
 	radio = go_gtk_builder_get_widget (state->base.gui, "type_linear");
-	type = gtk_radio_group_get_selected (GTK_RADIO_BUTTON (radio)->group);
+	type = gtk_radio_group_get_selected (gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio)));
 
 	if (type == FillSeriesTypeDate)
 		gtk_widget_set_sensitive (state->date_steps_type, TRUE);
diff --git a/src/dialogs/dialog-insert-cells.c b/src/dialogs/dialog-insert-cells.c
index 967fd0a..667fe80 100644
--- a/src/dialogs/dialog-insert-cells.c
+++ b/src/dialogs/dialog-insert-cells.c
@@ -71,7 +71,7 @@ cb_insert_cell_ok_clicked (G_GNUC_UNUSED GtkWidget *button,
 	g_return_if_fail (radio_0 != NULL);
 
 	i = gtk_radio_group_get_selected
-		(GTK_RADIO_BUTTON (radio_0)->group);
+	  (gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio_0)));
 
 	cols = state->sel->end.col - state->sel->start.col + 1;
 	rows = state->sel->end.row - state->sel->start.row + 1;
diff --git a/src/dialogs/dialog-printer-setup.c b/src/dialogs/dialog-printer-setup.c
index c4f0de1..9b25b87 100644
--- a/src/dialogs/dialog-printer-setup.c
+++ b/src/dialogs/dialog-printer-setup.c
@@ -406,6 +406,7 @@ margin_preview_page_available_size(PrinterSetupState *state,
 	guint *widths, *heights;
 	GtkRequisition requisition;
 	guint top_att, bottom_att, left_att, right_att, i;
+	int nrows, ncols;
 
 	/* Reset available size to zero*/
 	available_size->width = 0;
@@ -413,8 +414,9 @@ margin_preview_page_available_size(PrinterSetupState *state,
 
 	table = GTK_TABLE (go_gtk_builder_get_widget (state->gui, "table-paper-selector"));
 
-	widths = g_new0(guint, table->ncols);
-	heights = g_new0(guint, table->nrows);
+	gtk_table_get_size (table, &nrows, &ncols);
+	widths = g_new0(guint, ncols);
+	heights = g_new0(guint, nrows);
 
 	container = GTK_BOX (go_gtk_builder_get_widget (state->gui,
 						   "container-paper-sample"));
@@ -2123,7 +2125,7 @@ display_order_icon (GtkToggleButton *toggle, PrinterSetupState *state)
 {
 	GtkWidget *show, *hide;
 
-	if (toggle->active){
+	if (gtk_toggle_button_get_active (toggle)){
 		show = state->icon_rd;
 		hide = state->icon_dr;
 	} else {
diff --git a/src/dialogs/dialog-search.c b/src/dialogs/dialog-search.c
index 0201097..b7949fb 100644
--- a/src/dialogs/dialog-search.c
+++ b/src/dialogs/dialog-search.c
@@ -426,7 +426,7 @@ cb_next (G_GNUC_UNUSED GtkWidget *widget,
 static void
 cb_focus_on_entry (GtkWidget *widget, GtkWidget *entry)
 {
-        if (GTK_TOGGLE_BUTTON (widget)->active)
+        if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)))
 		gtk_widget_grab_focus (GTK_WIDGET (gnm_expr_entry_get_entry
 						   (GNM_EXPR_ENTRY (entry))));
 }
diff --git a/src/dialogs/dialog-stf-fixed-page.c b/src/dialogs/dialog-stf-fixed-page.c
index 033fe1a..09e5ccb 100644
--- a/src/dialogs/dialog-stf-fixed-page.c
+++ b/src/dialogs/dialog-stf-fixed-page.c
@@ -26,6 +26,7 @@
 #include <gui-util.h>
 #include <gdk/gdkkeysyms.h>
 #include <gtk/gtk.h>
+#include <dead-kittens.h>
 
 /*************************************************************************************************
  * MISC UTILITY FUNCTIONS
@@ -205,7 +206,7 @@ select_column (StfDialogData *pagedata, int col)
 		return;
 
 	column = stf_preview_get_column (pagedata->fixed.renderdata, col);
-	gtk_widget_grab_focus (column->button);
+	gtk_widget_grab_focus (gtk_tree_view_column_get_button (column));
 }
 
 static gboolean
@@ -295,18 +296,29 @@ cb_col_button_press (GtkWidget *button,
 	StfDialogData *data = g_object_get_data (G_OBJECT (button), "fixed-data");
 
 	if (event->type == GDK_2BUTTON_PRESS && event->button == 1) {
+		GtkAllocation bca, ba;
+		int offset;
 		/* Split column.  */
 
 		/* Correct for indentation of button.  */
-		int offset = GTK_BIN (button)->child->allocation.x - button->allocation.x;
+		gtk_widget_get_allocation (gtk_bin_get_child (GTK_BIN (button)),
+					   &bca);
+		gtk_widget_get_allocation (button, &ba);
+		offset = bca.x - ba.x;
 		make_new_column (data, col, (int)event->x - offset, FALSE);
 
 		return TRUE;
 	}
 
 	if (event->type == GDK_BUTTON_PRESS && event->button == 3) {
+		GtkAllocation bca, ba;
+		int offset;
+
 		/* Correct for indentation of button.  */
-		int offset = GTK_BIN (button)->child->allocation.x - button->allocation.x;
+		gtk_widget_get_allocation (gtk_bin_get_child (GTK_BIN (button)),
+					   &bca);
+		gtk_widget_get_allocation (button, &ba);
+		offset = bca.x - ba.x;
 
 		fixed_context_menu (data, event, col, (int)event->x - offset);
 		return TRUE;
@@ -389,6 +401,8 @@ fixed_page_update_preview (StfDialogData *pagedata)
 			stf_preview_get_column (renderdata, i);
 		GtkCellRenderer *cell =
 			stf_preview_get_cell_renderer (renderdata, i);
+		GtkWidget *button =
+			gtk_tree_view_column_get_button (column);
 
 		gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
 
@@ -396,12 +410,12 @@ fixed_page_update_preview (StfDialogData *pagedata)
 			      "family", "monospace",
 			      NULL);
 
-		g_object_set_data (G_OBJECT (column->button), "fixed-data", pagedata);
+		g_object_set_data (G_OBJECT (button), "fixed-data", pagedata);
 		g_object_set (G_OBJECT (column), "clickable", TRUE, NULL);
-		g_signal_connect (column->button, "button_press_event",
+		g_signal_connect (button, "button_press_event",
 				  G_CALLBACK (cb_col_button_press),
 				  GINT_TO_POINTER (i));
-		g_signal_connect (column->button, "key_press_event",
+		g_signal_connect (button, "key_press_event",
 				  G_CALLBACK (cb_col_key_press),
 				  GINT_TO_POINTER (i));
 	}
@@ -462,6 +476,7 @@ static void
 queue_redraw (GtkWidget *widget, int x)
 {
 	int hh, xo;
+	GtkAllocation a;
 
 	if (x < 0)
 		return;
@@ -469,9 +484,10 @@ queue_redraw (GtkWidget *widget, int x)
 	gtk_tree_view_convert_bin_window_to_widget_coords
 		(GTK_TREE_VIEW (widget), 0, 0, &xo, &hh);
 
+	gtk_widget_get_allocation (widget, &a);
 	gtk_widget_queue_draw_area (widget,
 				    x + xo, hh,
-				    1, widget->allocation.height - hh);
+				    1, a.height - hh);
 }
 
 
@@ -529,12 +545,16 @@ cb_treeview_expose (GtkWidget *widget,
 		    StfDialogData *pagedata)
 {
 	int ruler_x = pagedata->fixed.ruler_x;
-	int height = widget->allocation.height;
+	int height;
 	cairo_t *cr;
+	GtkAllocation a;
 
 	if (ruler_x < 0)
 		return FALSE;
 
+	gtk_widget_get_allocation (widget, &a);
+	height = a.height;
+
 	cr = gdk_cairo_create (event->window);
 	cairo_rectangle (cr, ruler_x, 0, ruler_x + 1, height);
 	cairo_clip (cr);
diff --git a/src/dialogs/dialog-stf-format-page.c b/src/dialogs/dialog-stf-format-page.c
index 22e3e18..01f5d58 100644
--- a/src/dialogs/dialog-stf-format-page.c
+++ b/src/dialogs/dialog-stf-format-page.c
@@ -99,7 +99,7 @@ tree_view_clamp_column_visible (GtkTreeView       *tree_view,
 	GtkAdjustment *hadjustment = gtk_tree_view_get_hadjustment (tree_view);
 	double hval = gtk_adjustment_get_value (hadjustment);
 	double hps = gtk_adjustment_get_page_size (hadjustment);
-	GtkWidget *button = column->button;
+	GtkWidget *button = gtk_tree_view_column_get_button (column);
 	GtkAllocation ba;
 
 	gtk_widget_get_allocation (button, &ba);
@@ -438,13 +438,20 @@ cb_col_event (GtkWidget *widget, GdkEvent *event, gpointer _col)
 
 		if (event_button->button == 1) {
 			GtkWidget *check = g_object_get_data (G_OBJECT (widget), "checkbox");
+			GtkAllocation a;
 			/*
-			 * We use overlapping buttons and that does not actually work...
+			 * We use overlapping buttons and that does not
+			 * actually work...
 			 *
 			 * In a square area the height of the hbox, click the
 			 * checkbox.
 			 */
-			int xmax = GTK_BIN (widget)->child->allocation.height;
+			int xmax;
+
+			gtk_widget_get_allocation
+				(gtk_bin_get_child (GTK_BIN (widget)),
+				 &a);
+			xmax = a.height;
 			if (event_button->x <= xmax)
 				gtk_button_clicked (GTK_BUTTON (check));
 		} else if (event_button->button == 3) {
@@ -589,6 +596,7 @@ format_page_update_preview (StfDialogData *pagedata)
 	for (i = old_part; i < renderdata->colcount; i++) {
 		GtkTreeViewColumn *column =
 			stf_preview_get_column (renderdata, i);
+		GtkWidget *button = gtk_tree_view_column_get_button (column);
 
 		if (NULL == g_object_get_data (G_OBJECT (column), "checkbox")) {
 			GtkWidget *vbox = gtk_vbox_new (FALSE,5);
@@ -642,11 +650,11 @@ format_page_update_preview (StfDialogData *pagedata)
 			g_object_set_data (G_OBJECT (column), "checkbox", check);
 			g_object_set_data (G_OBJECT (column), "checkbox-autofit", check_autofit);
 			g_object_set_data (G_OBJECT (column), "formatlabel", format_label);
-			g_object_set_data (G_OBJECT (column->button),
+			g_object_set_data (G_OBJECT (button),
 					   "pagedata", pagedata);
-			g_object_set_data (G_OBJECT (column->button),
+			g_object_set_data (G_OBJECT (button),
 					   "checkbox", check);
-			g_object_set_data (G_OBJECT (column->button),
+			g_object_set_data (G_OBJECT (button),
 					   "formatlabel", format_label);
 			g_object_set (G_OBJECT (column), "clickable", TRUE, NULL);
 
@@ -662,7 +670,7 @@ format_page_update_preview (StfDialogData *pagedata)
 					  "clicked",
 					  G_CALLBACK (cb_format_clicked),
 					  GINT_TO_POINTER (i));
-			g_signal_connect (G_OBJECT (column->button),
+			g_signal_connect (G_OBJECT (button),
 					  "event",
 					  G_CALLBACK (cb_col_event),
 					  GINT_TO_POINTER (i));
diff --git a/src/dialogs/dialog-stf-preview.c b/src/dialogs/dialog-stf-preview.c
index 4e1fc37..aec947e 100644
--- a/src/dialogs/dialog-stf-preview.c
+++ b/src/dialogs/dialog-stf-preview.c
@@ -317,13 +317,15 @@ stf_preview_find_column (RenderData_t *renderdata, int x, int *pcol, int *dx)
 	/* Figure out what column we pressed in.  */
 	for (col = 0; 1; col++) {
 		GtkWidget *w;
+		GtkAllocation a;
 		GtkTreeViewColumn *column =
 			stf_preview_get_column (renderdata, col);
 		if (!column)
 			break;
-		w = GTK_BIN (column->button)->child;
-		if (x < w->allocation.x + w->allocation.width) {
-			*dx = x - w->allocation.x;
+		w = gtk_bin_get_child (GTK_BIN (gtk_tree_view_column_get_button (column)));
+		gtk_widget_get_allocation (w, &a);
+		if (x < a.x + a.width) {
+			*dx = x - a.x;
 			break;
 		}
 	}
diff --git a/src/dialogs/dialog-tabulate.c b/src/dialogs/dialog-tabulate.c
index 48c2845..f5913e3 100644
--- a/src/dialogs/dialog-tabulate.c
+++ b/src/dialogs/dialog-tabulate.c
@@ -116,16 +116,20 @@ static GnmExprEntry *
 get_table_expr_entry (GtkTable *t, int y, int x)
 {
 	GList *l;
+	GList *children = gtk_container_get_children (GTK_CONTAINER (t));
+	GnmExprEntry *res = NULL;
 
-	for (l = t->children; l; l = l->next) {
+	for (l = children; l; l = l->next) {
 		GtkTableChild *child = l->data;
 		if (child->left_attach == x && child->top_attach == y &&
 		    IS_GNM_EXPR_ENTRY (child->widget)) {
-			return GNM_EXPR_ENTRY (child->widget);
+			res = GNM_EXPR_ENTRY (child->widget);
+			break;
 		}
 	}
 
-	return NULL;
+	g_list_free (children);
+	return res;
 }
 
 static int
@@ -134,22 +138,27 @@ get_table_float_entry (GtkTable *t, int y, int x, GnmCell *cell, gnm_float *numb
 {
 	GList *l;
 	GOFormat *format;
+	GList *children = gtk_container_get_children (GTK_CONTAINER (t));
+	int res = 3;
 
 	*wp = NULL;
-	for (l = t->children; l; l = l->next) {
+	for (l = children; l; l = l->next) {
 		GtkTableChild *child = l->data;
 		if (child->left_attach == x && child->top_attach == y &&
 		    GTK_IS_ENTRY (child->widget)) {
 			*wp = GTK_ENTRY (child->widget);
 			format = gnm_style_get_format (gnm_cell_get_style (cell));
-			return (with_default ?
+			res = (with_default ?
 				entry_to_float_with_format_default (GTK_ENTRY (child->widget), number,
 							   TRUE, format, default_float) :
 				entry_to_float_with_format (GTK_ENTRY (child->widget), number,
 							   TRUE, format));
+			break;
 		}
 	}
-	return 3;
+	g_list_free (children);
+
+	return res;
 }
 
 static void
@@ -176,13 +185,17 @@ tabulate_ok_clicked (G_GNUC_UNUSED GtkWidget *widget, DialogState *dd)
 	int row;
 	gboolean with_coordinates;
 	GnmTabulateInfo *data;
+	int nrows;
+	GnmCell **cells;
+	gnm_float *minima, *maxima, *steps;
 
-	GnmCell **cells = g_new (GnmCell *, dd->source_table->nrows);
-	gnm_float *minima = g_new (gnm_float, dd->source_table->nrows);
-	gnm_float *maxima = g_new (gnm_float, dd->source_table->nrows);
-	gnm_float *steps = g_new (gnm_float, dd->source_table->nrows);
+	gtk_table_get_size (dd->source_table, &nrows, NULL);
+	cells = g_new (GnmCell *, nrows);
+	minima = g_new (gnm_float, nrows);
+	maxima = g_new (gnm_float, nrows);
+	steps = g_new (gnm_float, nrows);
 
-	for (row = 1; row < dd->source_table->nrows; row++) {
+	for (row = 1; row < nrows; row++) {
 		GtkEntry *e_w;
 		GnmExprEntry *w = get_table_expr_entry (dd->source_table, row, COL_CELL);
 
@@ -312,6 +325,7 @@ dialog_tabulate (WBCGtk *wbcg, Sheet *sheet)
 	GtkDialog *dialog;
 	DialogState *dd;
 	int i;
+	int nrows;
 
 	g_return_if_fail (wbcg != NULL);
 
@@ -339,7 +353,8 @@ dialog_tabulate (WBCGtk *wbcg, Sheet *sheet)
 		NULL);
 
 	dd->source_table = GTK_TABLE (go_gtk_builder_get_widget (gui, "source_table"));
-	for (i = 1; i < dd->source_table->nrows; i++) {
+	gtk_table_get_size (dd->source_table, &nrows, NULL);
+	for (i = 1; i < nrows; i++) {
 		GnmExprEntry *ge = gnm_expr_entry_new (wbcg, TRUE);
 		gnm_expr_entry_set_flags (ge,
 			GNM_EE_SINGLE_RANGE | GNM_EE_SHEET_OPTIONAL,
diff --git a/src/gnm-pane.c b/src/gnm-pane.c
index 53fcc88..ce14952 100644
--- a/src/gnm-pane.c
+++ b/src/gnm-pane.c
@@ -924,7 +924,7 @@ gnm_pane_init (GnmPane *pane)
 	pane->im_block_edit_start = FALSE;
 	pane->im_first_focus = TRUE;
 
-	GTK_WIDGET_SET_FLAGS (canvas, GTK_CAN_FOCUS);
+	gtk_widget_set_can_focus (GTK_WIDGET (canvas), TRUE);
 	GTK_WIDGET_SET_FLAGS (canvas, GTK_CAN_DEFAULT);
 
 	g_signal_connect (G_OBJECT (pane->im_context), "commit",
diff --git a/src/gui-file.c b/src/gui-file.c
index 8ec1eb2..16632dd 100644
--- a/src/gui-file.c
+++ b/src/gui-file.c
@@ -272,7 +272,7 @@ gui_file_open (WBCGtk *wbcg, char const *default_format)
 
 	advanced_button = gtk_button_new_with_mnemonic (_("Advanc_ed"));
 	gtk_widget_show (advanced_button);
-	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (fsel)->action_area),
+	gtk_box_pack_start (GTK_BOX (gtk_dialog_get_action_area (GTK_DIALOG (fsel))),
 			    advanced_button, FALSE, TRUE, 6);
 	gtk_dialog_add_buttons (GTK_DIALOG (fsel),
 				GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
@@ -562,9 +562,9 @@ gui_file_save_as (WBCGtk *wbcg, WorkbookView *wb_view)
 
 	if (wbcg2) {
 		GtkWidget *nb = GTK_WIDGET (wbcg2->notebook_area);
-		wb_view_preferred_size (wb_view,
-					nb->allocation.width,
-					nb->allocation.height);
+		GtkAllocation a;
+		gtk_widget_get_allocation (nb, &a);
+		wb_view_preferred_size (wb_view, a.width, a.height);
         }
 
 	success = check_multiple_sheet_support_if_needed (fs, GTK_WINDOW (fsel), wb_view);
@@ -599,9 +599,9 @@ gui_file_save (WBCGtk *wbcg, WorkbookView *wb_view)
 
 	if (wbcg2) {
 		GtkWidget *nb = GTK_WIDGET (wbcg2->notebook_area);
-		wb_view_preferred_size (wb_view,
-					nb->allocation.width,
-					nb->allocation.height);
+		GtkAllocation a;
+		gtk_widget_get_allocation (nb, &a);
+		wb_view_preferred_size (wb_view, a.width, a.height);
 	}
 
 	if (wb->file_format_level < GO_FILE_FL_AUTO)
diff --git a/src/gui-util.c b/src/gui-util.c
index 2629928..274d891 100644
--- a/src/gui-util.c
+++ b/src/gui-util.c
@@ -141,7 +141,7 @@ gnumeric_go_error_info_list_dialog_new (GSList *errs)
 
 	gtk_container_add (GTK_CONTAINER (scrolled_window), GTK_WIDGET (view));
 	gtk_widget_show_all (GTK_WIDGET (scrolled_window));
-	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), scrolled_window, TRUE, TRUE, 0);
+	gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), scrolled_window, TRUE, TRUE, 0);
 
 	gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CLOSE);
 	return dialog;
@@ -248,7 +248,7 @@ cb_save_sizes (GtkWidget *dialog, const char *key)
 	}
 
 	r = g_memdup (&dialog->allocation, sizeof (dialog->allocation));
-	gdk_window_get_position (dialog->window, &r->x, &r->y);
+	gdk_window_get_position (gtk_widget_get_window (dialog), &r->x, &r->y);
 	g_hash_table_replace (h, g_strdup (key), r);
 }
 
@@ -341,7 +341,7 @@ gnumeric_dialog_raise_if_exists (WBCGtk *wbcg, char const *key)
 	/* Ensure we only pop up one copy per workbook */
 	ctxt = g_object_get_data (G_OBJECT (wbcg), key);
 	if (ctxt && GTK_IS_WINDOW (ctxt->dialog)) {
-		gdk_window_raise (ctxt->dialog->window);
+		gdk_window_raise (gtk_widget_get_window (ctxt->dialog));
 		return ctxt->dialog;
 	} else
 		return NULL;
@@ -355,7 +355,7 @@ cb_activate_default (GtkWindow *window)
 	 * to activate the focus widget.
 	 */
 	return window->default_widget &&
-		GTK_WIDGET_IS_SENSITIVE (window->default_widget) &&
+		gtk_widget_is_sensitive (window->default_widget) &&
 		gtk_window_activate_default (window);
 }
 
@@ -403,7 +403,7 @@ gtk_radio_group_get_selected (GSList *radio_group)
 	for (i = 0, l = radio_group; l; l = l->next, i++){
 		GtkRadioButton *button = l->data;
 
-		if (GTK_TOGGLE_BUTTON (button)->active)
+		if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button)))
 			return c - i - 1;
 	}
 
@@ -1023,7 +1023,8 @@ focus_on_entry (GtkEntry *entry)
 		return;
 	gtk_widget_grab_focus (GTK_WIDGET(entry));
 	gtk_editable_set_position (GTK_EDITABLE (entry), 0);
-	gtk_editable_select_region (GTK_EDITABLE (entry), 0, entry->text_length);
+	gtk_editable_select_region (GTK_EDITABLE (entry), 0,
+				    gtk_entry_get_text_length (entry));
 }
 
 gboolean
@@ -1201,13 +1202,13 @@ gnm_link_button_and_entry (GtkWidget *button, GtkWidget *entry)
 void
 gnm_widget_set_cursor (GtkWidget *w, GdkCursor *cursor)
 {
-	gdk_window_set_cursor (w->window, cursor);
+	gdk_window_set_cursor (gtk_widget_get_window (w), cursor);
 }
 
 void
 gnm_widget_set_cursor_type (GtkWidget *w, GdkCursorType ct)
 {
-	GdkDisplay *display = gdk_drawable_get_display (w->window);
+	GdkDisplay *display = gdk_drawable_get_display (gtk_widget_get_window (w));
 	GdkCursor *cursor = gdk_cursor_new_for_display (display, ct);
 	gnm_widget_set_cursor (w, cursor);
 	gdk_cursor_unref (cursor);
@@ -1300,18 +1301,18 @@ gnumeric_message_dialog_new (GtkWindow * parent,
 		hbox = gtk_hbox_new (FALSE, 0);
 		gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, TRUE, 0);
 		gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0);
-		gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox, TRUE, TRUE, 0);
+		gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), hbox, TRUE, TRUE, 0);
 
 		gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
 		gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
 		gtk_misc_set_alignment (GTK_MISC (label), 0.0 , 0.0);
 		gtk_box_set_spacing (GTK_BOX (hbox), 12);
 		gtk_container_set_border_width (GTK_CONTAINER (hbox), 6);
-		gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 12);
+		gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), 12);
 		gtk_container_set_border_width (GTK_CONTAINER (dialog), 6);
 		gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
 		gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
-		gtk_widget_show_all (GTK_WIDGET (GTK_DIALOG (dialog)->vbox));
+		gtk_widget_show_all (GTK_WIDGET (gtk_dialog_get_content_area (GTK_DIALOG (dialog))));
 	}
 
 	return dialog;
diff --git a/src/io-context-gtk.c b/src/io-context-gtk.c
index 07ac7f3..0bcff14 100644
--- a/src/io-context-gtk.c
+++ b/src/io-context-gtk.c
@@ -91,7 +91,7 @@ cb_realize (GtkWindow *window, void *dummy)
 {
 	int sx, sy;
 	GdkWindowHints hints;
-	GtkAllocation *allocation;
+	GtkAllocation allocation;
 	GdkGeometry geom;
 	GdkRectangle rect;
 
@@ -100,10 +100,10 @@ cb_realize (GtkWindow *window, void *dummy)
 	gdk_screen_get_monitor_geometry (window->screen, 0, &rect);
 	sx = rect.width;
 	sy = rect.height;
-	allocation = &GTK_WIDGET (window)->allocation;
+	gtk_widget_get_allocation (GTK_WIDGET (window), &allocation);
 
-	geom.base_width = allocation->width;
-	geom.base_height = allocation->height;
+	geom.base_width = allocation.width;
+	geom.base_height = allocation.height;
 	geom.min_width = geom.max_width = geom.base_width;
 	geom.min_height = geom.max_height = geom.base_height;
 
diff --git a/src/item-bar.c b/src/item-bar.c
index 1212f37..9c3b7cd 100644
--- a/src/item-bar.c
+++ b/src/item-bar.c
@@ -240,10 +240,11 @@ ib_draw_cell (ItemBar const * const ib, cairo_t *cr,
 	      ColRowSelectionType const type,
 	      char const * const str, GocRect *rect)
 {
-	GtkLayout	*canvas = GTK_LAYOUT (ib->base.canvas);
-	GtkWidget   *widget = GTK_WIDGET (canvas);
-	PangoFont	*font;
-	PangoRectangle   size;
+	GtkLayout *canvas = GTK_LAYOUT (ib->base.canvas);
+	GtkWidget *widget = GTK_WIDGET (canvas);
+	GtkStyle *style = gtk_widget_get_style (widget);
+	PangoFont *font;
+	PangoRectangle size;
 	GOColor color, font_color;
 	int shadow, ascent;
 
@@ -252,24 +253,24 @@ ib_draw_cell (ItemBar const * const ib, cairo_t *cr,
 	case COL_ROW_NO_SELECTION:
 		shadow = GTK_SHADOW_OUT;
 		font   = ib->normal_font;
-		color = GO_COLOR_FROM_GDK (widget->style->bg[GTK_STATE_ACTIVE]);
-		font_color = GO_COLOR_FROM_GDK (widget->style->fg[GTK_STATE_ACTIVE]);
+		color = GO_COLOR_FROM_GDK (style->bg[GTK_STATE_ACTIVE]);
+		font_color = GO_COLOR_FROM_GDK (style->fg[GTK_STATE_ACTIVE]);
 		ascent = ib->normal_font_ascent;
 		break;
 
 	case COL_ROW_PARTIAL_SELECTION:
 		shadow = GTK_SHADOW_OUT;
 		font   = ib->bold_font;
-		color = GO_COLOR_FROM_GDK (widget->style->dark[GTK_STATE_PRELIGHT]);
-		font_color = GO_COLOR_FROM_GDK (widget->style->fg[GTK_STATE_PRELIGHT]);
+		color = GO_COLOR_FROM_GDK (style->dark[GTK_STATE_PRELIGHT]);
+		font_color = GO_COLOR_FROM_GDK (style->fg[GTK_STATE_PRELIGHT]);
 		ascent = ib->bold_font_ascent;
 		break;
 
 	case COL_ROW_FULL_SELECTION:
 		shadow = GTK_SHADOW_IN;
 		font   = ib->bold_font;
-		color = GO_COLOR_FROM_GDK (widget->style->dark[GTK_STATE_NORMAL]);
-		font_color = GO_COLOR_FROM_GDK (widget->style->fg[GTK_STATE_NORMAL]);
+		color = GO_COLOR_FROM_GDK (style->dark[GTK_STATE_NORMAL]);
+		font_color = GO_COLOR_FROM_GDK (style->fg[GTK_STATE_NORMAL]);
 		ascent = ib->bold_font_ascent;
 		break;
 	}
@@ -289,7 +290,7 @@ ib_draw_cell (ItemBar const * const ib, cairo_t *cr,
 
 	/* The widget parameters could be NULL, but if so some themes would emit a warning.
 	 * (Murrine is known to do this: http://bugzilla.gnome.org/show_bug.cgi?id=564410). */
-	gtk_paint_shadow (widget->style,
+	gtk_paint_shadow (style,
 			  gtk_layout_get_bin_window (canvas),
 			  GTK_STATE_NORMAL, shadow,
 			  NULL, widget, "GnmItemBarCell",
@@ -449,7 +450,8 @@ item_bar_draw_region (GocItem const *item, cairo_t *cr, double x_0, double y_0,
 							else if (size < 6)
 								safety = 6 - size;
 
-							gtk_paint_shadow (canvas->style, gtk_layout_get_bin_window (GTK_LAYOUT (canvas)),
+							gtk_paint_shadow (gtk_widget_get_style (canvas),
+									  gtk_layout_get_bin_window (GTK_LAYOUT (canvas)),
 								 GTK_STATE_NORMAL,
 								 prev_visible ? GTK_SHADOW_OUT : GTK_SHADOW_IN,
 								 NULL, NULL, "GnmItemBarCell",
@@ -481,7 +483,8 @@ item_bar_draw_region (GocItem const *item, cairo_t *cr, double x_0, double y_0,
 								safety = 6 - size;
 
 							right = (rtl ? (total + pixels) : total) - size;
-							gtk_paint_shadow (canvas->style, gtk_layout_get_bin_window (GTK_LAYOUT (canvas)),
+							gtk_paint_shadow (gtk_widget_get_style (canvas),
+									  gtk_layout_get_bin_window (GTK_LAYOUT (canvas)),
 								 GTK_STATE_NORMAL,
 								 prev_visible ? GTK_SHADOW_OUT : GTK_SHADOW_IN,
 								 NULL, NULL, "GnmItemBarCell",
@@ -610,7 +613,8 @@ item_bar_draw_region (GocItem const *item, cairo_t *cr, double x_0, double y_0,
 							left = pos - dir * (.2 * inc - 2);
 							if (rtl)
 								left -= size;
-							gtk_paint_shadow (canvas->style, gtk_layout_get_bin_window (GTK_LAYOUT (canvas)),
+							gtk_paint_shadow (gtk_widget_get_style (canvas),
+									  gtk_layout_get_bin_window (GTK_LAYOUT (canvas)),
 								 GTK_STATE_NORMAL,
 								 prev_visible ? GTK_SHADOW_OUT : GTK_SHADOW_IN,
 								 NULL, NULL, "GnmItemBarCell",
@@ -644,7 +648,8 @@ item_bar_draw_region (GocItem const *item, cairo_t *cr, double x_0, double y_0,
 							if (rtl)
 								left -= size;
 							bottom = total - size;
-							gtk_paint_shadow (canvas->style, gtk_layout_get_bin_window (GTK_LAYOUT (canvas)),
+							gtk_paint_shadow (gtk_widget_get_style (canvas),
+									  gtk_layout_get_bin_window (GTK_LAYOUT (canvas)),
 								 GTK_STATE_NORMAL,
 								 next->visible ? GTK_SHADOW_OUT : GTK_SHADOW_IN,
 								 NULL, NULL, "GnmItemBarCell",
@@ -760,7 +765,7 @@ is_pointer_on_division (ItemBar const *ib, gint64 x, gint64 y,
 static void
 ib_set_cursor (ItemBar *ib, gint64 x, gint64 y)
 {
-	GdkWindow *window = GTK_WIDGET (ib->base.canvas)->window;
+	GdkWindow *window = gtk_widget_get_window (GTK_WIDGET (ib->base.canvas));
 	GdkCursor *cursor = ib->normal_cursor;
 
 	/* We might be invoked before we are realized */
diff --git a/src/item-cursor.c b/src/item-cursor.c
index 6d10a9a..b2601fd 100644
--- a/src/item-cursor.c
+++ b/src/item-cursor.c
@@ -129,7 +129,7 @@ static void
 item_cursor_realize (GocItem *item)
 {
 	ItemCursor *ic = ITEM_CURSOR (item);
-	GdkWindow  *window = GTK_WIDGET (item->canvas)->window;
+	GdkWindow  *window = gtk_widget_get_window (GTK_WIDGET (item->canvas));
 
 	ic->gc = gdk_gc_new (window);
 
diff --git a/src/item-edit.c b/src/item-edit.c
index 97a38fe..a336e24 100644
--- a/src/item-edit.c
+++ b/src/item-edit.c
@@ -16,6 +16,7 @@
 #include "gnumeric.h"
 #include "item-edit.h"
 #include "gnm-pane-impl.h"
+#include <dead-kittens.h>
 
 #include "item-cursor.h"
 #include "sheet-control-gui-priv.h"
@@ -425,6 +426,8 @@ item_edit_update_bounds (GocItem *item)
 
 		if ((dir == PANGO_DIRECTION_RTL && cdir == GOC_DIRECTION_RTL) ||
 		    (dir != PANGO_DIRECTION_RTL && cdir == GOC_DIRECTION_LTR)) {
+			GtkAllocation a;
+
 			while (col_size < width &&
 			       col <= pane->last_full.col &&
 			       col < gnm_sheet_get_last_col (sheet)) {
@@ -435,7 +438,8 @@ item_edit_update_bounds (GocItem *item)
 				if (ci->visible)
 					col_size += ci->size_pixels;
 			}
-			tmp = (pane->first_offset.x + canvas->allocation.width) / scale;
+			gtk_widget_get_allocation (GTK_WIDGET (canvas), &a);
+			tmp = (pane->first_offset.x + a.width) / scale;
 			item->x1 = item->x0 + (col_size + GNM_COL_MARGIN + GNM_COL_MARGIN + 1) / scale;
 
 			if (item->x1 >= tmp) {
diff --git a/src/sheet-control-gui.c b/src/sheet-control-gui.c
index 69dcd56..8524a6e 100644
--- a/src/sheet-control-gui.c
+++ b/src/sheet-control-gui.c
@@ -23,6 +23,7 @@
 #include <glib/gi18n-lib.h>
 #include "gnumeric.h"
 #include "sheet-control-gui-priv.h"
+#include <dead-kittens.h>
 
 #include "sheet.h"
 #include "sheet-private.h"
@@ -267,7 +268,7 @@ scg_setup_group_buttons (SheetControlGUI *scg, unsigned max_outline,
 		gtk_label_set_markup (GTK_LABEL (label), tmp);
 		g_free (tmp);
 
-		GTK_WIDGET_UNSET_FLAGS (btn, GTK_CAN_FOCUS);
+		gtk_widget_set_can_focus (btn, FALSE);
 		gtk_container_add (GTK_CONTAINER (in), label);
 		gtk_container_add (GTK_CONTAINER (btn), in);
 		gtk_container_add (GTK_CONTAINER (out), btn);
@@ -290,7 +291,7 @@ scg_setup_group_buttons (SheetControlGUI *scg, unsigned max_outline,
 	/* size all of the button so things work after a zoom */
 	for (i = 0 ; i < btns->len ; i++) {
 		GtkWidget *btn = g_ptr_array_index (btns, i);
-		GtkWidget *label = GTK_BIN (GTK_BIN (btn)->child)->child;
+		GtkWidget *label = gtk_bin_get_child (GTK_BIN (gtk_bin_get_child (GTK_BIN (btn))));
 		gtk_widget_set_size_request (GTK_WIDGET (btn), w, h);
 		gtk_widget_set_style (label, style);
 	}
@@ -558,17 +559,21 @@ static void
 cb_select_all_btn_expose (GtkWidget *widget, GdkEventExpose *event, SheetControlGUI *scg)
 {
 	int offset = scg_sheet (scg)->text_is_rtl ? -1 : 0;
+	GtkAllocation a;
 
 	/* This should be keep in sync with item_bar_cell code (item-bar.c) */
-	gdk_draw_rectangle (widget->window,
+	gdk_draw_rectangle (gtk_widget_get_window (widget),
 			    widget->style->bg_gc[GTK_STATE_ACTIVE],
 			    TRUE,
 			    offset + 1, 1, widget->allocation.width - 1, widget->allocation.height - 1);
 	/* The widget parameters could be NULL, but if so some themes would emit a warning.
 	 * (Murrine is known to do this: http://bugzilla.gnome.org/show_bug.cgi?id=564410). */
-	gtk_paint_shadow (widget->style, widget->window, GTK_STATE_NORMAL, GTK_SHADOW_OUT,
+	gtk_widget_get_allocation (widget, &a);
+	gtk_paint_shadow (gtk_widget_get_style (widget),
+			  gtk_widget_get_window (widget),
+			  GTK_STATE_NORMAL, GTK_SHADOW_OUT,
 			  NULL, widget, "GnmItemBarCell",
-			  offset, 0, widget->allocation.width + 1, widget->allocation.height + 1);
+			  offset, 0, a.width + 1, a.height + 1);
 }
 
 static gboolean
@@ -878,7 +883,7 @@ gnm_pane_make_cell_visible (GnmPane *pane, int col, int row,
 	 * visible area, and would unconditionally scroll the cell to the top
 	 * left of the viewport.
 	 */
-	if (!GTK_WIDGET_REALIZED (pane))
+	if (!gtk_widget_get_realized (pane))
 		return;
 
 	sheet = scg_sheet (pane->simple.scg);
@@ -1580,7 +1585,7 @@ sheet_control_gui_new (SheetView *sv, WBCGtk *wbcg)
 				GTK_EXPAND | GTK_FILL | GTK_SHRINK,
 				0, 0);
 		}
-		style = gtk_style_copy (scg->vs->style);
+		style = gtk_style_copy (gtk_widget_get_style (scg->vs));
 		style->bg[GTK_STATE_NORMAL] = style->white;
 		gtk_widget_set_style (scg->vs, style);
 		g_object_unref (style);
@@ -3226,7 +3231,7 @@ scg_set_display_cursor (SheetControlGUI *scg)
 
 	SCG_FOREACH_PANE (scg, pane, {
 		GtkWidget *w = GTK_WIDGET (pane);
-		if (w->window) {
+		if (gtk_widget_get_window (w)) {
 			if (cursor == GDK_CURSOR_IS_PIXMAP)
 				gnm_widget_set_cursor (w, pane->mouse_cursor);
 			else
diff --git a/src/sheet-object-widget.c b/src/sheet-object-widget.c
index 4dbc44a..55fd43f 100644
--- a/src/sheet-object-widget.c
+++ b/src/sheet-object-widget.c
@@ -49,6 +49,7 @@
 #include "commands.h"
 #include "gnm-format.h"
 #include "number-match.h"
+#include <dead-kittens.h>
 
 #include <goffice/goffice.h>
 
@@ -812,8 +813,8 @@ sheet_widget_button_create_widget (SheetObjectWidget *sow)
 {
 	SheetWidgetButton *swb = SHEET_WIDGET_BUTTON (sow);
 	GtkWidget *w = gtk_button_new_with_label (swb->label);
-	GTK_WIDGET_UNSET_FLAGS (w, GTK_CAN_FOCUS);
-	gtk_label_set_attributes (GTK_LABEL (GTK_BIN (w)->child),
+	gtk_widget_set_can_focus (w, FALSE);
+	gtk_label_set_attributes (GTK_LABEL (gtk_bin_get_child (GTK_BIN (w))),
 				  swb->markup);
 	g_signal_connect (G_OBJECT (w),
 			  "pressed",
@@ -852,7 +853,7 @@ typedef struct {
 
 static void
 cb_button_set_focus (GtkWidget *window, GtkWidget *focus_widget,
-		       ButtonConfigState *state)
+		     ButtonConfigState *state)
 {
 	/* Note:  half of the set-focus action is handle by the default
 	 *        callback installed by wbc_gtk_attach_guru */
@@ -860,12 +861,12 @@ cb_button_set_focus (GtkWidget *window, GtkWidget *focus_widget,
 	/* Force an update of the content in case it needs tweaking (eg make it
 	 * absolute) */
 	if (state->old_focus != NULL &&
-	    IS_GNM_EXPR_ENTRY (state->old_focus->parent)) {
+	    IS_GNM_EXPR_ENTRY (gtk_widget_get_parent (state->old_focus))) {
 		GnmParsePos  pp;
-		GnmExprTop const *texpr = gnm_expr_entry_parse (
-			GNM_EXPR_ENTRY (state->old_focus->parent),
-			parse_pos_init_sheet (&pp, state->sheet),
-			NULL, FALSE, GNM_EXPR_PARSE_DEFAULT);
+		GnmExprTop const *texpr = gnm_expr_entry_parse
+			(GNM_EXPR_ENTRY (gtk_widget_get_parent (state->old_focus)),
+			 parse_pos_init_sheet (&pp, state->sheet),
+			 NULL, FALSE, GNM_EXPR_PARSE_DEFAULT);
 		if (texpr != NULL)
 			gnm_expr_top_unref (texpr);
 	}
@@ -1764,7 +1765,7 @@ sheet_widget_scrollbar_create_widget (SheetObjectWidget *sow)
 	bar = swa->horizontal
 		? gtk_hscrollbar_new (swa->adjustment)
 		: gtk_vscrollbar_new (swa->adjustment);
-	GTK_WIDGET_UNSET_FLAGS (bar, GTK_CAN_FOCUS);
+	gtk_widget_set_can_focus (bar, FALSE);
 	g_signal_connect (G_OBJECT (bar),
 		"value_changed",
 		G_CALLBACK (cb_adjustment_widget_value_changed), swa);
@@ -1868,7 +1869,7 @@ sheet_widget_spinbutton_create_widget (SheetObjectWidget *sow)
 	swa->being_updated = TRUE;
 	spinbutton = gtk_spin_button_new (swa->adjustment,
 		swa->adjustment->step_increment, 0);
-	GTK_WIDGET_UNSET_FLAGS (spinbutton, GTK_CAN_FOCUS);
+	gtk_widget_set_can_focus (spinbutton, FALSE);
 	g_signal_connect (G_OBJECT (spinbutton),
 		"value_changed",
 		G_CALLBACK (cb_adjustment_widget_value_changed), swa);
@@ -1975,7 +1976,7 @@ sheet_widget_slider_create_widget (SheetObjectWidget *sow)
 		? gtk_hscale_new (swa->adjustment)
 		: gtk_vscale_new (swa->adjustment);
 	gtk_scale_set_draw_value (GTK_SCALE (slider), FALSE);
-	GTK_WIDGET_UNSET_FLAGS (slider, GTK_CAN_FOCUS);
+	gtk_widget_set_can_focus (slider, FALSE);
 	g_signal_connect (G_OBJECT (slider),
 		"value_changed",
 		G_CALLBACK (cb_adjustment_widget_value_changed), swa);
@@ -2251,7 +2252,7 @@ sheet_widget_checkbox_create_widget (SheetObjectWidget *sow)
 	g_return_val_if_fail (swc != NULL, NULL);
 
 	button = gtk_check_button_new_with_label (swc->label);
-	GTK_WIDGET_UNSET_FLAGS (button, GTK_CAN_FOCUS);
+	gtk_widget_set_can_focus (button, FALSE);
 	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), swc->value);
 	g_signal_connect (G_OBJECT (button),
 			  "toggled",
@@ -2597,7 +2598,7 @@ sheet_widget_toggle_button_create_widget (SheetObjectWidget *sow)
 {
 	SheetWidgetCheckbox *swc = SHEET_WIDGET_CHECKBOX (sow);
 	GtkWidget *button = gtk_toggle_button_new_with_label (swc->label);
-	GTK_WIDGET_UNSET_FLAGS (button, GTK_CAN_FOCUS);
+	gtk_widget_set_can_focus (button, FALSE);
 	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), swc->value);
 	g_signal_connect (G_OBJECT (button),
 		"toggled",
@@ -2828,7 +2829,7 @@ sheet_widget_radio_button_create_widget (SheetObjectWidget *sow)
 				     "label", swrb->label,
 				     NULL) ;
 
-	GTK_WIDGET_UNSET_FLAGS (w, GTK_CAN_FOCUS);
+	gtk_widget_set_can_focus (w, FALSE);
 
 	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (w), swrb->active);
 
@@ -3825,7 +3826,7 @@ cb_combo_selection_changed (SheetWidgetListBase *swl,
 {
 	int pos = swl->selection - 1;
 	if (pos < 0) {
-		gtk_entry_set_text (GTK_ENTRY (GTK_BIN (combo)->child), "");
+		gtk_entry_set_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (combo))), "");
 		pos = -1;
 	}
 	gtk_combo_box_set_active (combo, pos);
@@ -3860,7 +3861,8 @@ sheet_widget_combo_create_widget (SheetObjectWidget *sow)
 	GtkWidget *combo;
 
 	combo = g_object_new (gtk_combo_box_entry_get_type (), NULL);
-	GTK_WIDGET_UNSET_FLAGS ((GTK_BIN (combo)->child), GTK_CAN_FOCUS);
+	gtk_widget_set_can_focus (gtk_bin_get_child (GTK_BIN (combo)),
+				  FALSE);
 	if (swl->model != NULL)
 		g_object_set (G_OBJECT (combo),
                       "model",		swl->model,
diff --git a/src/wbc-gtk-actions.c b/src/wbc-gtk-actions.c
index f7674b6..ccf9d06 100644
--- a/src/wbc-gtk-actions.c
+++ b/src/wbc-gtk-actions.c
@@ -22,6 +22,7 @@
  */
 #include <gnumeric-config.h>
 #include "gnumeric.h"
+#include <dead-kittens.h>
 
 #include "libgnumeric.h"
 #include "application.h"
@@ -1158,7 +1159,8 @@ static GNM_ACTION_DEF (cb_autosum)
 		 * FIXME : This is crap!
 		 * When the function druid is more complete use that.
 		 */
-		gtk_editable_set_position (GTK_EDITABLE (entry), entry->text_length-1);
+		gtk_editable_set_position (GTK_EDITABLE (entry),
+					   gtk_entry_get_text_length (entry)-1);
 	}
 }
 
diff --git a/src/wbc-gtk-edit.c b/src/wbc-gtk-edit.c
index 0019398..7f76e08 100644
--- a/src/wbc-gtk-edit.c
+++ b/src/wbc-gtk-edit.c
@@ -22,6 +22,7 @@
  */
 #include <gnumeric-config.h>
 #include "gnumeric.h"
+#include <dead-kittens.h>
 
 #include "gnm-pane-impl.h"
 #include "wbc-gtk-impl.h"
@@ -548,7 +549,7 @@ cb_entry_insert_text (GtkEditable *editable,
 	if (wbcg->auto_completing &&
 	    len_bytes != 0 &&
 	    (!g_unichar_isalpha (g_utf8_get_char (text)) ||
-	     *pos_in_chars != GTK_ENTRY (editable)->text_length)) {
+	     *pos_in_chars != gtk_entry_get_text_length (GTK_ENTRY (editable)))) {
 		wbcg->auto_completing = FALSE;
 	}
 
@@ -620,7 +621,7 @@ cb_entry_cursor_pos (WBCGtk *wbcg)
 	if (str[0] == 0)
 		return;
 
-	if (edit_pos != GTK_ENTRY (entry)->text_length) {
+	if (edit_pos != gtk_entry_get_text_length (GTK_ENTRY (entry))) {
 		/* The cursor is no longer at the end.  */
 		wbcg->auto_completing = FALSE;
 	}
@@ -937,7 +938,7 @@ wbcg_edit_start (WBCGtk *wbcg,
 		align = gtk_alignment_new (0.5, 0.5, 0, 0);
 		gtk_container_add (GTK_CONTAINER (align), check);
 		gtk_widget_show_all (align);
-		gtk_box_pack_end (GTK_BOX (GTK_DIALOG (d)->vbox), align, TRUE, TRUE, 0);
+		gtk_box_pack_end (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (d))), align, TRUE, TRUE, 0);
 		res = go_gtk_dialog_run (GTK_DIALOG (d), wbcg_toplevel (wbcg));
 
 		switch (res) {
@@ -1305,8 +1306,9 @@ cb_guru_set_focus (G_GNUC_UNUSED GtkWidget *window,
 		   GtkWidget *focus_widget, WBCGtk *wbcg)
 {
 	GnmExprEntry *gee = NULL;
-	if (focus_widget != NULL && IS_GNM_EXPR_ENTRY (focus_widget->parent))
-		gee = GNM_EXPR_ENTRY (focus_widget->parent);
+	if (focus_widget != NULL &&
+	    IS_GNM_EXPR_ENTRY (gtk_widget_get_parent (focus_widget)))
+		gee = GNM_EXPR_ENTRY (gtk_widget_get_parent (focus_widget));
 	wbcg_set_entry (wbcg, gee);
 }
 
diff --git a/src/wbc-gtk.c b/src/wbc-gtk.c
index 2152f27..18e2031 100644
--- a/src/wbc-gtk.c
+++ b/src/wbc-gtk.c
@@ -990,7 +990,7 @@ cb_paned_size_allocate (GtkHPaned *hpaned,
 	 * used for auto-expr and other little things.  This helps with
 	 * wide windows.
 	 */
-	wp = GTK_WIDGET (hpaned)->parent->allocation.width;
+	wp = gtk_widget_get_parent (GTK_WIDGET (hpaned))->allocation.width;
 	p1 = MAX (p1, w - (wp - w) * 125 / 100);
 
 	/* However, never use more for tabs than we want.  */
@@ -2229,7 +2229,7 @@ cb_autofunction (WBCGtk *wbcg)
 		 * When the function druid is more complete use that.
 		 */
 		gtk_editable_set_position (GTK_EDITABLE (entry),
-			entry->text_length-1);
+					   gtk_entry_get_text_length (entry)-1);
 	}
 }
 
@@ -2305,7 +2305,7 @@ cb_scroll_wheel (GtkWidget *w, GdkEventScroll *event,
 	gboolean go_back = (event->direction == GDK_SCROLL_UP ||
 			    event->direction == GDK_SCROLL_LEFT);
 
-	if (!pane || !GTK_WIDGET_REALIZED (w))
+	if (!pane || !gtk_widget_get_realized (w))
 		return FALSE;
 
 	if ((event->state & GDK_MOD1_MASK))
@@ -2748,7 +2748,7 @@ wbc_gtk_create_edit_area (WBCGtk *wbcg)
 	/* Set a reasonable width for the selection box. */
 	len = go_pango_measure_string (
 		gtk_widget_get_pango_context (GTK_WIDGET (wbcg_toplevel (wbcg))),
-		GTK_WIDGET (entry)->style->font_desc,
+		gtk_widget_get_style (GTK_WIDGET (entry))->font_desc,
 		cell_coord_name (GNM_MAX_COLS - 1, GNM_MAX_ROWS - 1));
 	/*
 	 * Add a little extra since font might be proportional and since
@@ -3677,7 +3677,7 @@ cb_handlebox_dock_status (GtkHandleBox *hb,
 
 	/* BARF!  */
 	/* See http://bugzilla.gnome.org/show_bug.cgi?id=139184  */
-	GtkStyle *style = gtk_style_copy (box->style);
+	GtkStyle *style = gtk_style_copy (gtk_widget_get_style (box));
 	style->ythickness = attached ? 2 : 0;
 	gtk_widget_set_style (box, style);
 	g_object_unref (style);
@@ -3949,7 +3949,7 @@ cb_init_extra_ui (GnmAppExtraUI *extra_ui, WBCGtk *gtk)
 static void
 set_toolbar_style_for_position (GtkToolbar *tb, GtkPositionType pos)
 {
-	GtkWidget *box = GTK_WIDGET (tb)->parent;
+	GtkWidget *box = gtk_widget_get_parent (GTK_WIDGET (tb));
 
 	static const GtkOrientation orientations[] = {
 		GTK_ORIENTATION_VERTICAL, GTK_ORIENTATION_VERTICAL,
@@ -3977,8 +3977,8 @@ set_toolbar_style_for_position (GtkToolbar *tb, GtkPositionType pos)
 static void
 set_toolbar_position (GtkToolbar *tb, GtkPositionType pos, WBCGtk *gtk)
 {
-	GtkWidget *box = GTK_WIDGET (tb)->parent;
-	GtkContainer *zone = GTK_CONTAINER (GTK_WIDGET (box)->parent);
+	GtkWidget *box = gtk_widget_get_parent (GTK_WIDGET (tb));
+	GtkContainer *zone = GTK_CONTAINER (gtk_widget_get_parent (GTK_WIDGET (box)));
 	GtkContainer *new_zone = GTK_CONTAINER (gtk->toolbar_zones[pos]);
 	char const *name = g_object_get_data (G_OBJECT (box), "name");
 	const char *key = "toolbar-order";
@@ -4042,8 +4042,8 @@ cb_tcm_hide (GtkWidget *widget, GtkWidget *box)
 static void
 toolbar_context_menu (GtkToolbar *tb, WBCGtk *gtk, GdkEventButton *event_button)
 {
-	GtkWidget *box = GTK_WIDGET (tb)->parent;
-	GtkWidget *zone = GTK_WIDGET (box)->parent;
+	GtkWidget *box = gtk_widget_get_parent (GTK_WIDGET (tb));
+	GtkWidget *zone = gtk_widget_get_parent (GTK_WIDGET (box));
 	GtkWidget *menu = gtk_menu_new ();
 	GtkWidget *item;
 
@@ -4073,8 +4073,9 @@ toolbar_context_menu (GtkToolbar *tb, WBCGtk *gtk, GdkEventButton *event_button)
 			item = gtk_radio_menu_item_new_with_label (group, text);
 			group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (item));
 
-			GTK_CHECK_MENU_ITEM (item)->active =
-				(zone == gtk->toolbar_zones[pos]);
+			gtk_check_menu_item_set_active
+				(GTK_CHECK_MENU_ITEM (item),
+				 (zone == gtk->toolbar_zones[pos]));
 
 			gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
 			g_object_set_data (G_OBJECT (item), "toolbar", tb);
@@ -4846,11 +4847,12 @@ wbc_gtk_create_status_area (WBCGtk *wbcg)
 	wbcg->auto_expr_label = tmp = gtk_label_new ("");
 	g_object_ref (wbcg->auto_expr_label);
 	gtk_label_set_ellipsize (GTK_LABEL (tmp), PANGO_ELLIPSIZE_START);
-	GTK_WIDGET_UNSET_FLAGS (tmp, GTK_CAN_FOCUS);
+	gtk_widget_set_can_focus (tmp, FALSE);
 	gtk_widget_ensure_style (tmp);
 	gtk_widget_set_size_request (tmp, go_pango_measure_string (
 		gtk_widget_get_pango_context (GTK_WIDGET (wbcg->toplevel)),
-		tmp->style->font_desc, "Sumerage=-012345678901234"), -1);
+		gtk_widget_get_style (tmp)->font_desc,
+		"Sumerage=-012345678901234"), -1);
 	tmp = gtk_event_box_new ();
 	gtk_container_add (GTK_CONTAINER (tmp), wbcg->auto_expr_label);
 	g_signal_connect (G_OBJECT (tmp),
@@ -4864,7 +4866,7 @@ wbc_gtk_create_status_area (WBCGtk *wbcg)
 	gtk_widget_ensure_style (tmp);
 	gtk_widget_set_size_request (tmp, go_pango_measure_string (
 		gtk_widget_get_pango_context (GTK_WIDGET (wbcg->toplevel)),
-		tmp->style->font_desc, "W") * 5, -1);
+		gtk_widget_get_style (tmp)->font_desc, "W") * 5, -1);
 
 	wbcg->tabs_paned = GTK_PANED (gtk_hpaned_new ());
 	gtk_paned_pack2 (wbcg->tabs_paned, wbcg->progress_bar, FALSE, TRUE);
@@ -5321,7 +5323,8 @@ cb_graph_dim_editor_update (GnmExprEntry *gee,
 	/* Ignore changes while we are insensitive. useful for displaying
 	 * values, without storing them as Data.  Also ignore updates if the
 	 * dataset has been cleared via the weakref handler  */
-	if (!GTK_WIDGET_SENSITIVE (gee) || editor->dataset == NULL)
+	if (!gtk_widget_is_sensitive (GTK_WIDGET (gee)) ||
+	    editor->dataset == NULL)
 		return;
 
 	scg = gnm_expr_entry_get_scg (gee);
diff --git a/src/widgets/gnm-cell-combo-view.c b/src/widgets/gnm-cell-combo-view.c
index d00a407..1ceff6a 100644
--- a/src/widgets/gnm-cell-combo-view.c
+++ b/src/widgets/gnm-cell-combo-view.c
@@ -83,13 +83,10 @@ ccombo_focus_change (GtkWidget *widget, gboolean in)
 
 	g_object_ref (widget);
 
-	if (in)
-		GTK_WIDGET_SET_FLAGS (widget, GTK_HAS_FOCUS);
-	else
-		GTK_WIDGET_UNSET_FLAGS (widget, GTK_HAS_FOCUS);
+	gtk_widget_set_can_focus (widget, in);
 
 	fevent.type = GDK_FOCUS_CHANGE;
-	fevent.window = widget->window;
+	fevent.window = gtk_widget_get_window (widget);
 	fevent.in = in;
 
 	gtk_widget_event (widget, (GdkEvent *)&fevent);
@@ -182,7 +179,8 @@ cb_ccombo_popup_motion (GtkWidget *widget, GdkEventMotion *event,
 {
 	int base, dir = 0;
 
-	gdk_window_get_origin (GTK_WIDGET (list)->window, NULL, &base);
+	gdk_window_get_origin (gtk_widget_get_window (GTK_WIDGET (list)),
+			       NULL, &base);
 	if (event->y_root < base)
 		dir = -1;
 	else if (event->y_root >= (base + GTK_WIDGET(list)->allocation.height))
@@ -227,7 +225,8 @@ cb_ccombo_button_press (GtkWidget *popup, GdkEventButton *event,
 			GtkWidget *list)
 {
 	/* btn1 down outside the popup cancels */
-	if (event->button == 1 && event->window != popup->window) {
+	if (event->button == 1 &&
+	    event->window != gtk_widget_get_window (popup)) {
 		ccombo_popup_destroy (list);
 		return TRUE;
 	}
@@ -274,8 +273,11 @@ gnm_cell_combo_view_popdown (SheetObjectView *sov, guint32 activate_time)
 	GtkTreePath	  *clip = NULL, *select = NULL;
 	GtkRequisition	req;
 	GtkWindow *toplevel = wbcg_toplevel (scg_wbcg (scg));
+	GdkWindow *popup_window;
 
 	popup = gtk_window_new (GTK_WINDOW_POPUP);
+	popup_window = gtk_widget_get_window (popup);
+
 	gtk_window_set_type_hint (GTK_WINDOW (popup), GDK_WINDOW_TYPE_HINT_COMBO);
 	gtk_window_group_add_window (gtk_window_get_group (toplevel), GTK_WINDOW (popup));
 	go_gtk_window_set_transient (toplevel, GTK_WINDOW (popup));
@@ -337,8 +339,8 @@ gnm_cell_combo_view_popdown (SheetObjectView *sov, guint32 activate_time)
 	gtk_container_add (GTK_CONTAINER (frame), container);
 
 	/* do the popup */
-	gdk_window_get_origin (GTK_WIDGET (pane)->window,
-		&root_x, &root_y);
+	gdk_window_get_origin (gtk_widget_get_window (GTK_WIDGET (pane)),
+			       &root_x, &root_y);
 	if (sheet->text_is_rtl) {
 		root_x += GTK_WIDGET (pane)->allocation.width;
 		root_x -= scg_colrow_distance_get (scg, TRUE,
@@ -383,16 +385,17 @@ gnm_cell_combo_view_popdown (SheetObjectView *sov, guint32 activate_time)
 	gtk_widget_grab_focus (GTK_WIDGET (list));
 	ccombo_focus_change (GTK_WIDGET (list), TRUE);
 
-	if (0 == gdk_pointer_grab (popup->window, TRUE,
+	if (0 == gdk_pointer_grab (popup_window, TRUE,
 		GDK_BUTTON_PRESS_MASK |
 		GDK_BUTTON_RELEASE_MASK |
 		GDK_POINTER_MOTION_MASK,
 		NULL, NULL, activate_time)) {
-		if (0 ==  gdk_keyboard_grab (popup->window, TRUE, activate_time)) {
+		if (0 ==  gdk_keyboard_grab (popup_window, TRUE, activate_time)) {
 			gtk_grab_add (popup);
 		} else {
-			gdk_display_pointer_ungrab (
-				gdk_drawable_get_display (popup->window), activate_time);
+			gdk_display_pointer_ungrab
+				(gdk_drawable_get_display (popup_window),
+				 activate_time);
 		}
 	}
 }
@@ -415,7 +418,7 @@ gnm_cell_combo_view_new (SheetObject *so, GType type,
 	goc_item_new (GOC_GROUP (ccombo), GOC_TYPE_WIDGET,
 		"widget",	view_widget,
 		NULL);
-	GTK_WIDGET_UNSET_FLAGS (view_widget, GTK_CAN_FOCUS);
+	gtk_widget_set_can_focus (view_widget, FALSE);
 
 	gtk_container_add (GTK_CONTAINER (view_widget),
 		ccombo_create_arrow (GNM_CCOMBO_VIEW (ccombo), so));
diff --git a/src/widgets/gnm-dao.c b/src/widgets/gnm-dao.c
index 4075566..b2c1092 100644
--- a/src/widgets/gnm-dao.c
+++ b/src/widgets/gnm-dao.c
@@ -157,7 +157,7 @@ tool_set_focus_output_range (G_GNUC_UNUSED GtkWidget *widget,
 static void
 cb_focus_on_entry (GtkWidget *widget, GtkWidget *entry)
 {
-        if (GTK_TOGGLE_BUTTON (widget)->active)
+        if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)))
 		gtk_widget_grab_focus
 			(GTK_WIDGET (gnm_expr_entry_get_entry
 				     (GNM_EXPR_ENTRY (entry))));
diff --git a/src/widgets/gnm-filter-combo-view.c b/src/widgets/gnm-filter-combo-view.c
index dc75677..9157a51 100644
--- a/src/widgets/gnm-filter-combo-view.c
+++ b/src/widgets/gnm-filter-combo-view.c
@@ -288,12 +288,12 @@ fcombo_create_list (SheetObject *so,
 static void
 fcombo_arrow_format (GnmFilterCombo *fcombo, GtkWidget *arrow)
 {
-	if (NULL != arrow->parent) {
+	if (gtk_widget_get_parent (arrow)) {
 		char *desc = NULL;
 		if (NULL != fcombo->cond) {
 		}
 		if (desc) {
-			go_widget_set_tooltip_text (arrow->parent, desc);
+			go_widget_set_tooltip_text (gtk_widget_get_parent (arrow), desc);
 			g_free (desc);
 		}
 	}
diff --git a/src/widgets/gnm-notebook.c b/src/widgets/gnm-notebook.c
index 0f32529..546f065 100644
--- a/src/widgets/gnm-notebook.c
+++ b/src/widgets/gnm-notebook.c
@@ -22,6 +22,7 @@
 #include <gnumeric-config.h>
 #include "gnm-notebook.h"
 #include <gsf/gsf-impl-utils.h>
+#include <dead-kittens.h>
 
 #if !GTK_CHECK_VERSION(2,17,1)
 /* 582488 GtkNotebook behaves poorly when allocated less than reque... */
@@ -8278,7 +8279,8 @@ gnm_notebook_size_request (GtkWidget      *widget,
 {
 	((GtkWidgetClass *)gnm_notebook_parent_class)->size_request
 		(widget, requisition);
-	widget->requisition.height -= widget->style->ythickness;
+	widget->requisition.height -=
+		gtk_widget_get_style (widget)->ythickness;
 }
 
 static void
@@ -8291,13 +8293,15 @@ gnm_notebook_size_allocate (GtkWidget     *widget,
 
 	for (i = 0; TRUE; i++) {
 		GtkWidget *page = gtk_notebook_get_nth_page (GTK_NOTEBOOK (widget), i);
+		GtkAllocation a;
 		if (!page)
 			break;
-		if (!GTK_WIDGET_VISIBLE (page))
+		if (!gtk_widget_get_visible (page))
 			continue;
-		h = MAX (h, page->allocation.height);
+		gtk_widget_get_allocation (page, &a);
+		h = MAX (h, a.height);
 	}
-	h += widget->style->ythickness;
+	h += gtk_widget_get_style (widget)->ythickness;
 
 	gnb->dummy_height = h;
 
@@ -8313,9 +8317,11 @@ gnm_notebook_expose (GtkWidget      *widget,
 	GnmNotebook *gnb = (GnmNotebook *)widget;
 	GdkEvent *ev = gdk_event_copy ((GdkEvent *)event);
 	GdkEventExpose *eve = (GdkEventExpose *)ev;
-	GtkAllocation alc = widget->allocation;
+	GtkAllocation alc;
 	int res = FALSE;
 
+	gtk_widget_get_allocation (widget, &alc);
+
 	alc.y += gnb->dummy_height;
 	if (gdk_rectangle_intersect (&alc, &eve->area, &eve->area)) {
 		GdkRegion *reg = gdk_region_rectangle (&eve->area);
@@ -8366,7 +8372,7 @@ gnm_notebook_get_n_visible (GnmNotebook *nb)
 
 	for (l = children; l; l = l->next) {
 		GtkWidget *child = l->data;
-		if (GTK_WIDGET_VISIBLE (child))
+		if (gtk_widget_get_visible (child))
 			count++;
 	}
 
@@ -8401,7 +8407,7 @@ cb_label_visibility (GtkWidget *label,
 		     GtkWidget *dummy)
 {
 	g_object_set (GTK_OBJECT (dummy),
-		      "visible", GTK_WIDGET_VISIBLE (label),
+		      "visible", gtk_widget_get_visible (label),
 		      NULL);
 }
 
diff --git a/src/widgets/gnumeric-cell-renderer-text.c b/src/widgets/gnumeric-cell-renderer-text.c
index 19a40cb..c799e6c 100644
--- a/src/widgets/gnumeric-cell-renderer-text.c
+++ b/src/widgets/gnumeric-cell-renderer-text.c
@@ -67,7 +67,7 @@ gnumeric_cell_renderer_text_render (GtkCellRenderer     *cell,
 
 	if ((flags & GTK_CELL_RENDERER_SELECTED) == GTK_CELL_RENDERER_SELECTED)	{
 		frame_state = GTK_STATE_ACTIVE;
-		if (GTK_WIDGET_HAS_FOCUS (widget))
+		if (gtk_widget_has_focus (widget))
 			state = GTK_STATE_SELECTED;
 		else
 			state = GTK_STATE_ACTIVE;
diff --git a/src/widgets/gnumeric-expr-entry.c b/src/widgets/gnumeric-expr-entry.c
index 9990c13..7e52ebc 100644
--- a/src/widgets/gnumeric-expr-entry.c
+++ b/src/widgets/gnumeric-expr-entry.c
@@ -2644,7 +2644,8 @@ gnm_expr_entry_grab_focus (GnmExprEntry *gee, gboolean select_all)
 	gtk_widget_grab_focus (GTK_WIDGET (gee->entry));
 	if (select_all) {
 		gtk_editable_set_position (GTK_EDITABLE (gee->entry), 0);
-		gtk_editable_select_region (GTK_EDITABLE (gee->entry), 0, gee->entry->text_length);
+		gtk_editable_select_region (GTK_EDITABLE (gee->entry), 0,
+					    gtk_entry_get_text_length (gee->entry));
 	}
 }
 
diff --git a/src/widgets/widget-editable-label.c b/src/widgets/widget-editable-label.c
index a25df1c..13e7189 100644
--- a/src/widgets/widget-editable-label.c
+++ b/src/widgets/widget-editable-label.c
@@ -25,6 +25,7 @@
 #include "widget-editable-label.h"
 #include <style-color.h>
 #include <gnm-marshalers.h>
+#include <dead-kittens.h>
 
 #include <gtk/gtk.h>
 #include <gdk/gdkkeysyms.h>
@@ -91,12 +92,12 @@ el_set_style_label (EditableLabel *el)
 static void
 el_set_cursor (GtkEntry *entry, GdkCursorType cursor_type)
 {
-	if (entry->text_area) {
+	if (gtk_entry_get_text_area (entry)) {
 		GdkDisplay *display =
 			gtk_widget_get_display (GTK_WIDGET (entry));
 		GdkCursor *cursor =
 			gdk_cursor_new_for_display (display, cursor_type);
-		gdk_window_set_cursor (entry->text_area, cursor);
+		gdk_window_set_cursor (gtk_entry_get_text_area (entry), cursor);
 		gdk_cursor_unref (cursor);
 	}
 }
@@ -166,7 +167,7 @@ el_button_press_event (GtkWidget *widget, GdkEventButton *button)
 {
 	EditableLabel *el = EDITABLE_LABEL (widget);
 
-	if (button->window != widget->window &&
+	if (button->window != gtk_widget_get_window (widget) &&
 	    button->window != el->entry.text_area) {
 		/* Accept the name change */
 		el_entry_activate (GTK_ENTRY (el), NULL);
@@ -231,7 +232,7 @@ el_state_changed (GtkWidget *widget, GtkStateType previous_state)
 {
 	parent_class->state_changed (widget, previous_state);
 	/* GtkEntry::state_changed changes the cursor */
-	if (GTK_WIDGET_REALIZED (widget))
+	if (gtk_widget_get_realized (widget))
 		el_set_cursor (GTK_ENTRY (widget), GDK_HAND2);
 }
 
diff --git a/src/widgets/widget-font-selector.c b/src/widgets/widget-font-selector.c
index 80a135f..86e19ae 100644
--- a/src/widgets/widget-font-selector.c
+++ b/src/widgets/widget-font-selector.c
@@ -11,6 +11,7 @@
 #include <gnumeric-config.h>
 #include <gnumeric.h>
 #include "widget-font-selector.h"
+#include <dead-kittens.h>
 
 #include <value.h>
 #include <mstyle.h>
@@ -266,7 +267,7 @@ select_row (GtkTreeView *list, int row)
 		path = gtk_tree_path_new_from_indices (row, -1);
 
 		gtk_tree_selection_select_path (gtk_tree_view_get_selection (list), path);
-		if (GTK_WIDGET_REALIZED (list))
+		if (gtk_widget_get_realized (list))
 			cb_list_adjust (list);
 		gtk_tree_path_free (path);
 	}



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