[Debian-med-packaging] Bug#967252: amide: depends on deprecated GTK 2

Yavor Doganov yavor at gnu.org
Thu Feb 22 16:10:54 GMT 2024


Control: tags -1 + patch

Please find attached patches that port this package to GSettings,
GTK 3 and GooCanvas.  (Only the first two patches in the series are
relevant; the rest are unrelated improvements I consider worth doing,
but YMMV).

While gtk+2.0 removal from Debian is somewhere in the future, this
brings us one step closer to removing libgnomecanvas (only two
packages are left depending on it, not counting amide).

I tested it quite a lot with files downloaded from here:
https://www.rubomedical.com/dicom_files/.  However, as this is a
complex and feature-rich program, it's quite possible that I've missed
something.  (It also goes without saying that I'm not a user of this
package and my knowledge in this area is approximately zero.)

Some time ago Andreas Tille added me as member of Debian Med because
of adun.app, however I wouldn't want to abuse my push access.  I would
suggest that someone from the regular uploaders of this package
reviews the patches first, possibly contacting upstream as well.
Please test extensively, these are major and invasive changes.

P.S.  Someone on the upstream bug tracker suggested that this should
be an intermediate step towards GTK 4.  I could agree but porting to
GTK 4 has to wait for the release of GooCanvas 4.0.  The latest
release (3.0, not yet packaged for Debian) is still based on GTK 3.
-------------- next part --------------
>From b0346894c701572a8e3bb5bc6f18524f27c6e8c0 Mon Sep 17 00:00:00 2001
From: Yavor Doganov <yavor at gnu.org>
Date: Sat, 20 Jan 2024 11:49:10 +0200
Subject: [PATCH 1/5] Port to GSettings

---
 debian/NEWS                    |   13 +
 debian/changelog               |    9 +
 debian/patches/gsettings.patch | 1348 ++++++++++++++++++++++++++++++++
 debian/patches/series          |    1 +
 debian/rules                   |    1 -
 5 files changed, 1371 insertions(+), 1 deletion(-)
 create mode 100644 debian/NEWS
 create mode 100644 debian/patches/gsettings.patch

diff --git a/debian/NEWS b/debian/NEWS
new file mode 100644
index 0000000..dc3fe63
--- /dev/null
+++ b/debian/NEWS
@@ -0,0 +1,13 @@
+amide (1.0.6-4) unstable; urgency=medium
+
+  Due to migration to GSettings, the existing configuration is lost and
+  you have to recreate it afresh.  The old configuration file
+  $HOME/.amiderc is preserved and you can use it to set the new GSettings
+  keys either with dconf-editor or through AMIDE's Preferences dialog,
+  Study modification dialog, etc. (whatever method is more convenient to
+  you, it doesn't matter).
+
+  Note that due to stricter requirements of GSettings keys the names have
+  changed from CamelCase to lowercase only with dashes.
+
+ -- Yavor Doganov <yavor at gnu.org>  Thu, 22 Feb 2024 09:00:50 +0200
diff --git a/debian/changelog b/debian/changelog
index bef5eda..a37b9f8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+amide (1.0.6-4) UNRELEASED; urgency=medium
+
+  * Team upload.
+  * debian/patches/gsettings.patch: New; port to GSettings.
+  * debian/rules (override_dh_auto_configure): Remove --disable-gconf.
+  * debian/NEWS: New file; inform users that configuration is lost.
+
+ -- Yavor Doganov <yavor at gnu.org>  Thu, 22 Feb 2024 09:00:50 +0200
+
 amide (1.0.6-3) unstable; urgency=medium
 
   * Team upload.
diff --git a/debian/patches/gsettings.patch b/debian/patches/gsettings.patch
new file mode 100644
index 0000000..d7e8b9d
--- /dev/null
+++ b/debian/patches/gsettings.patch
@@ -0,0 +1,1348 @@
+Description: Port to GSettings.
+ There is no migration code; users will lose all their configuration.
+ .
+ I don't know why GConf was not used on Windows and macOS; I guess
+ it's because it is a different library.  Someone (upstream) with
+ access to these systems should verify if GSettings work there (it's
+ part of GLib so it should in theory) -- if that's the case it would
+ simplify the code a lot as much of amide_gconf.c will be removed
+ along with the *_with_default functions.
+Bug: https://github.com/ferdymercury/amide/issues/27
+Author: Yavor Doganov <yavor at gnu.org>
+Forwarded: no
+Last-Update: 2024-02-22
+---
+
+--- amide.orig/amide-current/configure.ac
++++ amide/amide-current/configure.ac
+@@ -366,37 +366,15 @@
+ ##############################
+ 
+ PKG_CHECK_MODULES(AMIDE_GTK,[
+-	glib-2.0	>= 2.16.0
+-	gobject-2.0	>= 2.16.0
++	glib-2.0	>= 2.44.0
++	gio-2.0         >= 2.44.0
++	gobject-2.0	>= 2.44.0
+ 	gtk+-2.0	>= 2.16.0
+ 	libxml-2.0	>= 2.4.12
+ 	libgnomecanvas-2.0 >= 2.0.0
+ ])
+ 
+-## add in gconf if not on win32 or macos x 
+-## gconf stuff is encapsulated in amide_gconf.c
+-
+-
+-
+-if (test $native_win32 = no) && (test $enable_native_gtk_osx = no); then
+-   AC_ARG_ENABLE(
+-	gconf, 
+-	[  --enable-gconf  Compile with gconf support [default=yes]], 
+-	enable_gconf="$enableval", 
+-	enable_gconf=yes)
+-
+-   if test "x$enable_gconf" = "xyes" ; then  
+-	PKG_CHECK_MODULES(AMIDE_GTK_EXTRA_GCONF,[
+-		gconf-2.0	>= 2.14.0
+-   	], [AC_DEFINE(AMIDE_USE_GCONF, 1, Use gconf for storing configutation)
+-            AMIDE_GTK_LIBS="$AMIDE_GTK_LIBS $AMIDE_GTK_EXTRA_GCONF_LIBS"
+-   	    AMIDE_GTK_CFLAGS="$AMIDE_GTK_CFLAGS $AMIDE_GTK_EXTRA_GCONF_CFLAGS"
+-   	])
+-   	
+-   else 
+-        echo "Don't use gconf"
+-   fi	
+-fi
++GLIB_GSETTINGS
+ 
+ ## add in gnome-vfs if not on win32 or gtk-osx
+ ## gnome-vfs is only used by amide_gnome.c and only on unix
+--- amide.orig/amide-current/Makefile.am
++++ amide/amide-current/Makefile.am
+@@ -19,8 +19,12 @@
+ 	etc \
+ 	$(HELPDIR)
+ 
++gsettings_SCHEMAS = com.github.ferdymercury.amide.gschema.xml
++
++ at GSETTINGS_RULES@
+ 
+ EXTRA_DIST = \
++	$(gsettings_SCHEMAS) \
+ 	intltool-extract.in \
+ 	intltool-merge.in    \
+ 	intltool-update.in \
+--- /dev/null
++++ amide/amide-current/com.github.ferdymercury.amide.gschema.xml
+@@ -0,0 +1,363 @@
++<?xml version="1.0" encoding="UTF-8"?>
++<schemalist>
++
++  <enum id="com.github.ferdymercury.amide.AmitkLayout">
++    <value nick="Linear" value="0"/>
++    <value nick="Orthogonal" value="1"/>
++  </enum>
++
++  <enum id="com.github.ferdymercury.amide.AmitkPanelLayout">
++    <value nick="Mixed" value="0"/>
++    <value nick="Linear X" value="1"/>
++    <value nick="Linear Y" value="2"/>
++  </enum>
++
++  <enum id="com.github.ferdymercury.amide.AmitkWhichDefaultDirectory">
++    <value nick="None" value="0"/>
++    <value nick="Specified" value="1"/>
++    <value nick="Working" value="2"/>
++  </enum>
++
++  <enum id="com.github.ferdymercury.amide.AmitkThresholdStyle">
++    <value nick="Min/Max" value="0"/>
++    <value nick="Center/Width" value="1"/>
++  </enum>
++
++  <enum id="com.github.ferdymercury.amide.AmitkModality">
++    <value nick="pet" value="0"/>
++    <value nick="spect" value="1"/>
++    <value nick="ct" value="2"/>
++    <value nick="mri" value="3"/>
++    <value nick="other" value="4"/>
++  </enum>
++
++  <enum id="com.github.ferdymercury.amide.AmitkFormat">
++    <value nick="Unsigned Byte (8 bit)" value="0"/>
++    <value nick="Signed Byte (8 bit)" value="1"/>
++    <value nick="Unsigned Short (16 bit)" value="2"/>
++    <value nick="Signed Short (16 bit)" value="3"/>
++    <value nick="Unsigned Integer (32 bit)" value="4"/>
++    <value nick="Signed Integer (32 bit)" value="5"/>
++    <value nick="Float (32 bit)" value="6"/>
++    <value nick="Double (64 bit)" value="7"/>
++  </enum>
++
++  <enum id="com.github.ferdymercury.amide.AmitkExportMethod">
++    <value nick="Raw Data" value="0"/>
++    <value nick="DICOM via dcmtk" value="1"/>
++    <value nick="libmdc" value="2"/>
++  </enum>
++
++  <enum id="com.github.ferdymercury.amide.AnalysisCalculationType">
++    <value nick="all voxels" value="0"/>
++    <value nick="highest fraction voxels" value="1"/>
++    <value nick="voxels near max" value="2"/>
++    <value nick="voxels greater than value" value="3"/>
++  </enum>
++
++  <enum id="com.github.ferdymercury.amide.SeriesType">
++    <value nick="over Space" value="0"/>
++    <value nick="over Time" value="1"/>
++    <value nick="over Gates" value="2"/>
++  </enum>
++
++  <enum id="com.github.ferdymercury.amide.AmitkView">
++    <value nick="Transverse" value="0"/>
++    <value nick="Coronal" value="1"/>
++    <value nick="Sagittal" value="2"/>
++  </enum>
++
++  <schema id="com.github.ferdymercury.amide"
++          path="/com/github/ferdymercury/amide/">
++    <child name="roi" schema="com.github.ferdymercury.amide.roi"/>
++    <child name="canvas"
++           schema="com.github.ferdymercury.amide.canvas"/>
++    <child name="misc" schema="com.github.ferdymercury.amide.misc"/>
++    <child name="datasets"
++           schema="com.github.ferdymercury.amide.datasets"/>
++    <child name="windows"
++           schema="com.github.ferdymercury.amide.windows"/>
++    <child name="rawdataimport"
++           schema="com.github.ferdymercury.amide.rawdataimport"/>
++    <child name="export"
++           schema="com.github.ferdymercury.amide.export"/>
++    <child name="analysis"
++           schema="com.github.ferdymercury.amide.analysis"/>
++    <child name="rendering"
++           schema="com.github.ferdymercury.amide.rendering"/>
++    <child name="series"
++           schema="com.github.ferdymercury.amide.series"/>
++    <child name="missing-functionality"
++           schema="com.github.ferdymercury.amide.missing-functionality"/>
++  </schema>
++
++  <schema id="com.github.ferdymercury.amide.roi"
++         path="/com/github/ferdymercury/amide/roi/">
++    <key name="width" type="i">
++      <range min="1" max="5"/>
++      <default>2</default>
++    </key>
++    <key name="transparency" type="d">
++      <default>0.5</default>
++    </key>
++  </schema>
++
++  <schema id="com.github.ferdymercury.amide.canvas"
++         path="/com/github/ferdymercury/amide/canvas/">
++    <key name="layout" enum="com.github.ferdymercury.amide.AmitkLayout">
++      <default>'Linear'</default>
++    </key>
++    <key name="maintain-size" type="b">
++      <default>true</default>
++    </key>
++    <key name="target-empty-area" type="i">
++      <range min="0" max="25"/>
++      <default>5</default>
++    </key>
++    <key name="panel-layout"
++         enum="com.github.ferdymercury.amide.AmitkPanelLayout">
++      <default>'Mixed'</default>
++    </key>
++  </schema>
++
++  <schema id="com.github.ferdymercury.amide.misc"
++         path="/com/github/ferdymercury/amide/misc/">
++    <key name="warnings-to-console" type="b">
++      <default>false</default>
++    </key>
++    <key name="prompt-for-save-on-exit" type="b">
++      <default>true</default>
++    </key>
++    <key name="which-default-directory"
++         enum="com.github.ferdymercury.amide.AmitkWhichDefaultDirectory">
++      <default>'None'</default>
++    </key>
++    <key name="default-directory" type="s">
++      <default>''</default>
++    </key>
++  </schema>
++
++  <schema id="com.github.ferdymercury.amide.datasets"
++          path="/com/github/ferdymercury/amide/datasets/">
++    <key name="threshold-style"
++         enum="com.github.ferdymercury.amide.AmitkThresholdStyle">
++      <default>'Min/Max'</default>
++    </key>
++    <key name="default-color-table-pet" type="i">
++    <default>22</default>
++    </key>
++    <key name="default-color-table-spect" type="i">
++      <default>10</default>
++    </key>
++    <key name="default-color-table-ct" type="i">
++      <default>0</default>
++    </key>
++    <key name="default-color-table-mri" type="i">
++      <default>0</default>
++    </key>
++    <key name="default-color-table-other" type="i">
++      <default>0</default>
++    </key>
++  </schema>
++
++  <schema id="com.github.ferdymercury.amide.windows"
++          path="/com/github/ferdymercury/amide/windows/">
++    <key name="abdomen-min" type="d">
++      <default>-85.0</default>
++    </key>
++    <key name="abdomen-max" type="d">
++      <default>165.0</default>
++    </key>
++    <key name="brain-min" type="d">
++      <default>-0.0</default>
++    </key>
++    <key name="brain-max" type="d">
++      <default>80.0</default>
++    </key>
++    <key name="extremities-min" type="d">
++      <default>-400.0</default>
++    </key>
++    <key name="extremities-max" type="d">
++      <default>1000.0</default>
++    </key>
++    <key name="liver-min" type="d">
++      <default>-40.0</default>
++    </key>
++    <key name="liver-max" type="d">
++      <default>160.0</default>
++    </key>
++    <key name="lung-min" type="d">
++      <default>-1350.0</default>
++    </key>
++    <key name="lung-max" type="d">
++      <default>150.0</default>
++    </key>
++    <key name="pelvis-soft-tissue-min" type="d">
++      <default>-140.0</default>
++    </key>
++    <key name="pelvis-soft-tissue-max" type="d">
++      <default>210.0</default>
++    </key>
++    <key name="skull-base-min" type="d">
++      <default>-60.0</default>
++    </key>
++    <key name="skull-base-max" type="d">
++      <default>140.0</default>
++    </key>
++    <key name="spine-a-min" type="d">
++      <default>-35.0</default>
++    </key>
++    <key name="spine-a-max" type="d">
++      <default>215.0</default>
++    </key>
++    <key name="spine-b-min" type="d">
++      <default>-300.0</default>
++    </key>
++    <key name="spine-b-max" type="d">
++      <default>1200.0</default>
++    </key>
++    <key name="thorax-soft-tissue-min" type="d">
++      <default>-125.0</default>
++    </key>
++    <key name="thorax-soft-tissue-max" type="d">
++      <default>225.0</default>
++    </key>
++  </schema>
++
++  <schema id="com.github.ferdymercury.amide.rawdataimport"
++          path="/com/github/ferdymercury/amide/rawdataimport/">
++    <key name="last-modality"
++         enum="com.github.ferdymercury.amide.AmitkModality">
++      <default>'ct'</default>
++    </key>
++    <key name="last-raw-format"
++         enum="com.github.ferdymercury.amide.AmitkFormat">
++      <default>'Unsigned Byte (8 bit)'</default>
++    </key>
++    <key name="last-data-dim-g" type="i">
++      <default>1</default>
++    </key>
++    <key name="last-data-dim-t" type="i">
++      <default>1</default>
++    </key>
++    <key name="last-data-dim-z" type="i">
++      <default>1</default>
++    </key>
++    <key name="last-data-dim-y" type="i">
++      <default>1</default>
++    </key>
++    <key name="last-data-dim-x" type="i">
++      <default>1</default>
++    </key>
++    <key name="last-voxel-size-z" type="d">
++      <default>1.0</default>
++    </key>
++    <key name="last-voxel-size-y" type="d">
++      <default>1.0</default>
++    </key>
++    <key name="last-voxel-size-x" type="d">
++      <default>1.0</default>
++    </key>
++    <key name="last-offset" type="i">
++      <default>0</default>
++    </key>
++    <key name="last-scale-factor" type="d">
++      <default>1.0</default>
++    </key>
++  </schema>
++
++  <schema id="com.github.ferdymercury.amide.export"
++          path="/com/github/ferdymercury/amide/export/">
++    <key name="reslice-data-set" type="b">
++      <default>false</default>
++    </key>
++    <key name="all-visible-data-sets" type="b">
++      <default>false</default>
++    </key>
++    <key name="inclusive-bounding-box" type="b">
++      <default>false</default>
++    </key>
++    <key name="method"
++         enum="com.github.ferdymercury.amide.AmitkExportMethod">
++      <default>'Raw Data'</default>
++    </key>
++    <key name="submethod" type="i">
++      <default>0</default>
++    </key>
++    <key name="voxel-size-z" type="d">
++      <default>1.0</default>
++    </key>
++    <key name="voxel-size-y" type="d">
++      <default>1.0</default>
++    </key>
++    <key name="voxel-size-x" type="d">
++      <default>1.0</default>
++    </key>
++  </schema>
++
++  <schema id="com.github.ferdymercury.amide.analysis"
++          path="/com/github/ferdymercury/amide/analysis/">
++    <key name="calculate-all-data-sets" type="b">
++      <default>false</default>
++    </key>
++    <key name="calculate-all-rois" type="b">
++      <default>false</default>
++    </key>
++    <key name="calculation-type"
++         enum="com.github.ferdymercury.amide.AnalysisCalculationType">
++      <default>'all voxels'</default>
++    </key>
++    <key name="accurate" type="b">
++      <default>false</default>
++    </key>
++    <key name="sub-fraction" type="d">
++      <default>0.0</default>
++    </key>
++    <key name="threshold-percentage" type="d">
++      <default>0.0</default>
++    </key>
++    <key name="threshold-value" type="d">
++      <default>0.0</default>
++    </key>
++  </schema>
++
++  <schema id="com.github.ferdymercury.amide.rendering"
++          path="/com/github/ferdymercury/amide/rendering/">
++    <key name="strip-highs" type="b">
++      <default>false</default>
++    </key>
++    <key name="optimize-rendering" type="b">
++      <default>false</default>
++    </key>
++    <key name="initially-no-gradient-opacity" type="b">
++      <default>false</default>
++    </key>
++    <key name="update-without-release" type="b">
++      <default>false</default>
++    </key>
++    <key name="eye-width" type="i">
++      <default>0</default>
++    </key>
++    <key name="eye-angle" type="d">
++      <default>5.0</default>
++    </key>
++  </schema>
++
++  <schema id="com.github.ferdymercury.amide.series"
++          path="/com/github/ferdymercury/amide/series/">
++    <key name="type" enum="com.github.ferdymercury.amide.SeriesType">
++      <default>'over Space'</default>
++    </key>
++    <key name="view" enum="com.github.ferdymercury.amide.AmitkView">
++      <default>'Transverse'</default>
++    </key>
++  </schema>
++
++  <schema id="com.github.ferdymercury.amide.missing-functionality"
++          path="/com/github/ferdymercury/amide/missing-functionality/">
++    <key name="already-warned" type="s">
++      <default>'0.0.0'</default>
++    </key>
++  </schema>
++
++</schemalist>
+--- amide.orig/amide-current/src/amide_gconf.c
++++ amide/amide-current/src/amide_gconf.c
+@@ -449,7 +449,7 @@
+   return return_val;
+ }
+ 
+-#elif defined(AMIDE_NATIVE_GTK_OSX) || !defined(AMIDE_USE_GCONF)
++#elif defined(AMIDE_NATIVE_GTK_OSX)
+ 
+ /* --------------------- flatfile version ----------------- */
+ 
+@@ -628,147 +628,137 @@
+ 
+ /* ------------------- gconf version ---------------------- */
+ 
+-#include <gconf/gconf-client.h>
+-#include <errno.h>
++#include <gio/gio.h>
+ 
+ /* internal variables */
+-static GConfClient * client=NULL;
++static GSettings * settings=NULL;
+ 
++const gchar * enum_keys[] = {
++  "layout",
++  "panel-layout",
++  "which-default-directory",
++  "threshold-style",
++  "last-modality",
++  "last-raw-format",
++  "method",
++  "calculation-type",
++  "type",
++  "view",
++  NULL
++};
+ 
+ void amide_gconf_init(void) {
+-  client = gconf_client_get_default();
++  settings = g_settings_new("com.github.ferdymercury.amide");
+   return;
+ }
+ 
+ void amide_gconf_shutdown(void) {
+-  g_object_unref(client); 
++  g_object_unref(settings);
+   return;
+ }
+ 
+ gint amide_gconf_get_int(const gchar * group, const gchar * key) {
+-  gchar * real_key;
++  GSettings * child;
+   gint return_val;
+ 
+-  real_key = g_strdup_printf("/apps/%s/%s/%s",PACKAGE,group,key);
+-  return_val = gconf_client_get_int(client,real_key,NULL);
+-  g_free(real_key);
++  child = g_settings_get_child(settings,group);
++  if (g_strv_contains(enum_keys,key))
++    return_val = g_settings_get_enum(child,key);
++  else
++    return_val = g_settings_get_int(child,key);
++  g_object_unref(child);
+   return return_val;
+ }
+ 
+ gdouble amide_gconf_get_float(const gchar * group, const gchar * key) {
+-  gchar * real_key;
++  GSettings * child;
+   gdouble return_val;
+ 
+-  real_key = g_strdup_printf("/apps/%s/%s/%s",PACKAGE,group,key);
+-  return_val = gconf_client_get_float(client,real_key,NULL);
+-  g_free(real_key);
++  child = g_settings_get_child(settings,group);
++  return_val = g_settings_get_double(child,key);
++  g_object_unref(child);
+   return return_val;
+ }
+ 
+ gboolean amide_gconf_get_bool(const gchar * group, const gchar * key) {
+-  gchar * real_key;
++  GSettings * child;
+   gboolean return_val;
+ 
+-  real_key = g_strdup_printf("/apps/%s/%s/%s",PACKAGE,group,key);
+-  return_val = gconf_client_get_bool(client,real_key,NULL);
+-  g_free(real_key);
++  child = g_settings_get_child(settings,group);
++  return_val = g_settings_get_boolean(child,key);
++  g_object_unref(child);
+   return return_val;
+ }
+ 
+ gchar * amide_gconf_get_string(const gchar * group, const gchar * key) {
+-  gchar * real_key;
++  GSettings * child;
+   gchar * return_val;
+ 
+-  real_key = g_strdup_printf("/apps/%s/%s/%s",PACKAGE,group,key);
+-  return_val = gconf_client_get_string(client,real_key,NULL);
+-  g_free(real_key);
++  child = g_settings_get_child(settings,group);
++  return_val = g_settings_get_string(child,key);
++  g_object_unref(child);
+   return return_val;
+ }
+ 
+ gboolean amide_gconf_set_int(const gchar * group, const gchar * key, gint val) {
+-  gchar * real_key;
++  GSettings * child;
+   gboolean return_val;
+ 
+-  real_key = g_strdup_printf("/apps/%s/%s/%s",PACKAGE,group,key);
+-  return_val = gconf_client_set_int(client,real_key,val,NULL);
+-  g_free(real_key);
++  child = g_settings_get_child(settings,group);
++  if (g_strv_contains(enum_keys,key))
++    return_val = g_settings_set_enum(child,key,val);
++  else
++    return_val = g_settings_set_int(child,key,val);
++  g_object_unref(child);
+   return return_val;
+ }
+ 
+ gboolean amide_gconf_set_float(const gchar * group, const gchar * key, gdouble val) {
+-  gchar * real_key;
++  GSettings * child;
+   gboolean return_val;
+ 
+-  real_key = g_strdup_printf("/apps/%s/%s/%s",PACKAGE,group,key);
+-  return_val = gconf_client_set_float(client,real_key,val,NULL);
+-  g_free(real_key);
++  child = g_settings_get_child(settings,group);
++  return_val = g_settings_set_double(child,key,val);
++  g_object_unref(child);
+   return return_val;
+ }
+ 
+ gboolean amide_gconf_set_bool(const gchar * group, const gchar * key, gboolean val) {
+-  gchar * real_key;
++  GSettings * child;
+   gboolean return_val;
+ 
+-  real_key = g_strdup_printf("/apps/%s/%s/%s",PACKAGE,group,key);
+-  return_val = gconf_client_set_bool(client,real_key,val,NULL);
+-  g_free(real_key);
++  child = g_settings_get_child(settings,group);
++  return_val = g_settings_set_boolean(child,key,val);
++  g_object_unref(child);
+   return return_val;
+ }
+ 
+ gboolean amide_gconf_set_string(const gchar * group, const gchar * key, const gchar * val) {
+-  gchar * real_key;
++  GSettings * child;
+   gboolean return_val;
+ 
+-  real_key = g_strdup_printf("/apps/%s/%s/%s",PACKAGE,group, key);
+-  return_val = gconf_client_set_string(client,real_key,val,NULL);
+-  g_free(real_key);
++  child = g_settings_get_child(settings,group);
++  return_val = g_settings_set_string(child,key,val);
++  g_object_unref(child);
+   return return_val;
+ }
+ 
+-/* it's pretty retarded that gconf doesn't have a function that can do this more easily */
+-static gboolean amide_gconf_has_value(const gchar * group, const gchar *key) {
+-  GConfValue * temp_val;
+-  gchar * real_key;
+-
+-  real_key = g_strdup_printf("/apps/%s/%s/%s",PACKAGE,group,key);
+-  temp_val = gconf_client_get(client, real_key, NULL);
+-  g_free(real_key);
+-
+-  if (temp_val == NULL) return FALSE;
+-  gconf_value_free(temp_val);
+-  return TRUE;
+-}
+-
+-
+ /* some helper functions */
+ gint amide_gconf_get_int_with_default(const gchar * group, const gchar * key, const gint default_int) {
+-
+-  if (amide_gconf_has_value(group, key)) 
+-    return amide_gconf_get_int(group, key);
+-  else
+-    return default_int;
++  return amide_gconf_get_int(group, key);
+ }
+ 
+ gdouble amide_gconf_get_float_with_default(const gchar * group, const gchar * key, const gdouble default_float) {
+-  if (amide_gconf_has_value(group, key)) 
+-    return amide_gconf_get_float(group, key);
+-  else
+-    return default_float;
++  return amide_gconf_get_float(group, key);
+ }
+ 
+ gboolean amide_gconf_get_bool_with_default(const gchar * group, const gchar * key, const gboolean default_bool) {
+-  if (amide_gconf_has_value(group, key)) 
+-    return amide_gconf_get_bool(group, key);
+-  else
+-    return default_bool;
++  return amide_gconf_get_bool(group, key);
+ }
+ 
+ /* returns an allocated string that'll need to be free'd */
+ gchar * amide_gconf_get_string_with_default(const gchar * group, const gchar * key, const gchar * default_str) {
+-  if (amide_gconf_has_value(group, key)) 
+-    return amide_gconf_get_string(group, key);
+-  else
+-    return g_strdup(default_str);
++  return amide_gconf_get_string(group, key);
+ }
+ 
+ #endif
+--- amide.orig/amide-current/src/amitk_preferences.c
++++ amide/amide-current/src/amitk_preferences.c
+@@ -33,11 +33,11 @@
+ #include "amitk_type_builtins.h"
+ #include "amitk_data_set.h"
+ 
+-#define GCONF_AMIDE_ROI "ROI"
+-#define GCONF_AMIDE_CANVAS "CANVAS"
+-#define GCONF_AMIDE_MISC "MISC"
+-#define GCONF_AMIDE_DATASETS "DATASETS"
+-#define GCONF_AMIDE_WINDOWS "WINDOWS"
++#define GCONF_AMIDE_ROI "roi"
++#define GCONF_AMIDE_CANVAS "canvas"
++#define GCONF_AMIDE_MISC "misc"
++#define GCONF_AMIDE_DATASETS "datasets"
++#define GCONF_AMIDE_WINDOWS "windows"
+ 
+ enum {
+   DATA_SET_PREFERENCES_CHANGED,
+@@ -48,6 +48,7 @@
+ 
+ static void preferences_class_init          (AmitkPreferencesClass *klass);
+ static void preferences_init                (AmitkPreferences      *object);
++static void preferences_dispose             (GObject           *object);
+ static void preferences_finalize            (GObject           *object);
+ static GObjectClass * parent_class;
+ static guint     preferences_signals[LAST_SIGNAL];
+@@ -93,6 +94,7 @@
+ 
+   parent_class = g_type_class_peek_parent(class);
+   
++  gobject_class->dispose = preferences_dispose;
+   gobject_class->finalize = preferences_finalize;
+ 
+   preferences_signals[DATA_SET_PREFERENCES_CHANGED] =
+@@ -128,11 +130,11 @@
+ 
+   /* load in saved preferences */
+   preferences->canvas_roi_width = 
+-    amide_gconf_get_int_with_default(GCONF_AMIDE_ROI,"Width", AMITK_PREFERENCES_DEFAULT_CANVAS_ROI_WIDTH);
++    amide_gconf_get_int_with_default(GCONF_AMIDE_ROI,"width", AMITK_PREFERENCES_DEFAULT_CANVAS_ROI_WIDTH);
+ 
+ #ifdef AMIDE_LIBGNOMECANVAS_AA
+   preferences->canvas_roi_transparency = 
+-    amide_gconf_get_float_with_default(GCONF_AMIDE_ROI,"Transparency", AMITK_PREFERENCES_DEFAULT_CANVAS_ROI_TRANSPARENCY);
++    amide_gconf_get_float_with_default(GCONF_AMIDE_ROI,"transparency", AMITK_PREFERENCES_DEFAULT_CANVAS_ROI_TRANSPARENCY);
+ 
+ #else
+   preferences->canvas_line_style = 
+@@ -143,31 +145,31 @@
+ #endif
+ 
+   preferences->canvas_layout = 
+-    amide_gconf_get_int_with_default(GCONF_AMIDE_CANVAS,"Layout", AMITK_PREFERENCES_DEFAULT_CANVAS_LAYOUT);
++    amide_gconf_get_int_with_default(GCONF_AMIDE_CANVAS,"layout", AMITK_PREFERENCES_DEFAULT_CANVAS_LAYOUT);
+ 
+   preferences->canvas_maintain_size = 
+-    amide_gconf_get_bool_with_default(GCONF_AMIDE_CANVAS,"MaintainSize", AMITK_PREFERENCES_DEFAULT_CANVAS_MAINTAIN_SIZE);
++    amide_gconf_get_bool_with_default(GCONF_AMIDE_CANVAS,"maintain-size", AMITK_PREFERENCES_DEFAULT_CANVAS_MAINTAIN_SIZE);
+ 
+   preferences->canvas_target_empty_area = 
+-    amide_gconf_get_int_with_default(GCONF_AMIDE_CANVAS,"TargetEmptyArea", AMITK_PREFERENCES_DEFAULT_CANVAS_TARGET_EMPTY_AREA);
++    amide_gconf_get_int_with_default(GCONF_AMIDE_CANVAS,"target-empty-area", AMITK_PREFERENCES_DEFAULT_CANVAS_TARGET_EMPTY_AREA);
+ 
+   preferences->panel_layout = 
+-    amide_gconf_get_int_with_default(GCONF_AMIDE_CANVAS,"PanelLayout", AMITK_PREFERENCES_DEFAULT_PANEL_LAYOUT);
++    amide_gconf_get_int_with_default(GCONF_AMIDE_CANVAS,"panel-layout", AMITK_PREFERENCES_DEFAULT_PANEL_LAYOUT);
+ 
+   preferences->warnings_to_console = 
+-    amide_gconf_get_bool_with_default(GCONF_AMIDE_MISC,"WarningsToConsole", AMITK_PREFERENCES_DEFAULT_WARNINGS_TO_CONSOLE);
++    amide_gconf_get_bool_with_default(GCONF_AMIDE_MISC,"warnings-to-console", AMITK_PREFERENCES_DEFAULT_WARNINGS_TO_CONSOLE);
+ 
+   preferences->prompt_for_save_on_exit = 
+-    amide_gconf_get_bool_with_default(GCONF_AMIDE_MISC,"PromptForSaveOnExit", AMITK_PREFERENCES_DEFAULT_PROMPT_FOR_SAVE_ON_EXIT);
++    amide_gconf_get_bool_with_default(GCONF_AMIDE_MISC,"prompt-for-save-on-exit", AMITK_PREFERENCES_DEFAULT_PROMPT_FOR_SAVE_ON_EXIT);
+ 
+   preferences->which_default_directory = 
+-    amide_gconf_get_int_with_default(GCONF_AMIDE_MISC,"WhichDefaultDirectory", AMITK_PREFERENCES_DEFAULT_WHICH_DEFAULT_DIRECTORY);
++    amide_gconf_get_int_with_default(GCONF_AMIDE_MISC,"which-default-directory", AMITK_PREFERENCES_DEFAULT_WHICH_DEFAULT_DIRECTORY);
+ 
+   preferences->default_directory = 
+-    amide_gconf_get_string_with_default(GCONF_AMIDE_MISC,"DefaultDirectory", AMITK_PREFERENCES_DEFAULT_DEFAULT_DIRECTORY);
++    amide_gconf_get_string_with_default(GCONF_AMIDE_MISC,"default-directory", AMITK_PREFERENCES_DEFAULT_DEFAULT_DIRECTORY);
+ 
+   for (i_modality=0; i_modality<AMITK_MODALITY_NUM; i_modality++) {
+-    temp_str = g_strdup_printf("DefaultColorTable%s", amitk_modality_get_name(i_modality));
++    temp_str = g_strdup_printf("default-color-table-%s", amitk_modality_get_name(i_modality));
+     preferences->color_table[i_modality] = 
+       amide_gconf_get_int_with_default(GCONF_AMIDE_DATASETS,temp_str, amitk_modality_default_color_table[i_modality]);
+     g_free(temp_str);
+@@ -178,16 +180,26 @@
+       temp_str = g_strdup_printf("%s-%s", amitk_window_get_name(i_window), amitk_limit_get_name(i_limit));
+       preferences->window[i_window][i_limit] =
+ 	amide_gconf_get_float_with_default(GCONF_AMIDE_WINDOWS,temp_str, amitk_window_default[i_window][i_limit]);
++      g_free(temp_str);
+     }
+ 
+   preferences->threshold_style = 
+-    amide_gconf_get_int_with_default(GCONF_AMIDE_DATASETS,"ThresholdStyle", AMITK_PREFERENCES_DEFAULT_THRESHOLD_STYLE);
++    amide_gconf_get_int_with_default(GCONF_AMIDE_DATASETS,"threshold-style", AMITK_PREFERENCES_DEFAULT_THRESHOLD_STYLE);
+ 
+   preferences->dialog = NULL;
+ 
+   return;
+ }
+ 
++static void preferences_dispose (GObject *object) {
++
++    AmitkPreferences * preferences = AMITK_PREFERENCES(object);
++
++    if (preferences->default_directory)
++      g_free(preferences->default_directory);
++
++    G_OBJECT_CLASS (parent_class)->dispose (object);
++}
+ 
+ static void preferences_finalize (GObject *object) {
+ 
+@@ -217,7 +229,7 @@
+ 
+   if (AMITK_PREFERENCES_CANVAS_ROI_WIDTH(preferences) != roi_width) {
+     preferences->canvas_roi_width = roi_width;
+-    amide_gconf_set_int(GCONF_AMIDE_ROI,"Width", roi_width);
++    amide_gconf_set_int(GCONF_AMIDE_ROI,"width", roi_width);
+     g_signal_emit(G_OBJECT(preferences), preferences_signals[STUDY_PREFERENCES_CHANGED], 0);
+   }
+ 
+@@ -235,7 +247,7 @@
+ 
+   if (AMITK_PREFERENCES_CANVAS_ROI_TRANSPARENCY(preferences) != roi_transparency) {
+     preferences->canvas_roi_transparency = roi_transparency;
+-    amide_gconf_set_float(GCONF_AMIDE_ROI,"Transparency", roi_transparency);
++    amide_gconf_set_float(GCONF_AMIDE_ROI,"transparency", roi_transparency);
+     g_signal_emit(G_OBJECT(preferences), preferences_signals[STUDY_PREFERENCES_CHANGED], 0);
+   }
+ 
+@@ -278,7 +290,7 @@
+ 
+   if (AMITK_PREFERENCES_CANVAS_LAYOUT(preferences) != layout) {
+     preferences->canvas_layout = layout;
+-    amide_gconf_set_int(GCONF_AMIDE_CANVAS,"Layout", layout);
++    amide_gconf_set_int(GCONF_AMIDE_CANVAS,"layout", layout);
+     g_signal_emit(G_OBJECT(preferences), preferences_signals[STUDY_PREFERENCES_CHANGED], 0);
+   }
+ 
+@@ -292,7 +304,7 @@
+ 
+   if (AMITK_PREFERENCES_CANVAS_MAINTAIN_SIZE(preferences) != maintain_size) {
+     preferences->canvas_maintain_size = maintain_size;
+-    amide_gconf_set_bool(GCONF_AMIDE_CANVAS,"MaintainSize",maintain_size);
++    amide_gconf_set_bool(GCONF_AMIDE_CANVAS,"maintain-size",maintain_size);
+     g_signal_emit(G_OBJECT(preferences), preferences_signals[STUDY_PREFERENCES_CHANGED], 0);
+   }
+ 
+@@ -313,7 +325,7 @@
+ 
+ if (AMITK_PREFERENCES_CANVAS_TARGET_EMPTY_AREA(preferences) != target_empty_area) {
+     preferences->canvas_target_empty_area = target_empty_area;
+-    amide_gconf_set_int(GCONF_AMIDE_CANVAS,"TargetEmptyArea", target_empty_area);
++    amide_gconf_set_int(GCONF_AMIDE_CANVAS,"target-empty-area", target_empty_area);
+     g_signal_emit(G_OBJECT(preferences), preferences_signals[STUDY_PREFERENCES_CHANGED], 0);
+   }
+ 
+@@ -328,7 +340,7 @@
+ 
+   if (AMITK_PREFERENCES_PANEL_LAYOUT(preferences) != panel_layout) {
+     preferences->panel_layout = panel_layout;
+-    amide_gconf_set_int(GCONF_AMIDE_CANVAS,"PanelLayout", panel_layout);
++    amide_gconf_set_int(GCONF_AMIDE_CANVAS,"panel-layout", panel_layout);
+     g_signal_emit(G_OBJECT(preferences), preferences_signals[STUDY_PREFERENCES_CHANGED], 0);
+   }
+ 
+@@ -343,7 +355,7 @@
+ 
+   if (AMITK_PREFERENCES_WARNINGS_TO_CONSOLE(preferences) != new_value) {
+     preferences->warnings_to_console = new_value;
+-    amide_gconf_set_bool(GCONF_AMIDE_MISC,"WarningsToConsole",new_value);
++    amide_gconf_set_bool(GCONF_AMIDE_MISC,"warnings-to-console",new_value);
+     g_signal_emit(G_OBJECT(preferences), preferences_signals[MISC_PREFERENCES_CHANGED], 0);
+   }
+   return;
+@@ -355,7 +367,7 @@
+ 
+   if (AMITK_PREFERENCES_PROMPT_FOR_SAVE_ON_EXIT(preferences) != new_value) {
+     preferences->prompt_for_save_on_exit = new_value;
+-    amide_gconf_set_bool(GCONF_AMIDE_MISC,"PromptForSaveOnExit",new_value);
++    amide_gconf_set_bool(GCONF_AMIDE_MISC,"prompt-for-save-on-exit",new_value);
+     g_signal_emit(G_OBJECT(preferences), preferences_signals[MISC_PREFERENCES_CHANGED], 0);
+   }
+   return;
+@@ -367,7 +379,7 @@
+ 
+   if (AMITK_PREFERENCES_WHICH_DEFAULT_DIRECTORY(preferences) != new_value) {
+     preferences->which_default_directory = new_value;
+-    amide_gconf_set_int(GCONF_AMIDE_MISC,"WhichDefaultDirectory",new_value);
++    amide_gconf_set_int(GCONF_AMIDE_MISC,"which-default-directory",new_value);
+     g_signal_emit(G_OBJECT(preferences), preferences_signals[MISC_PREFERENCES_CHANGED], 0);
+   }
+   return;
+@@ -380,10 +392,7 @@
+   gboolean different=FALSE;
+   g_return_if_fail(AMITK_IS_PREFERENCES(preferences));
+ 
+-  if (((AMITK_PREFERENCES_DEFAULT_DIRECTORY(preferences) == NULL) && (new_directory != NULL)) ||
+-      ((AMITK_PREFERENCES_DEFAULT_DIRECTORY(preferences) != NULL) && (new_directory == NULL)))
+-    different=TRUE;
+-  else if ((AMITK_PREFERENCES_DEFAULT_DIRECTORY(preferences) != NULL) && (new_directory != NULL))
++  if ((AMITK_PREFERENCES_DEFAULT_DIRECTORY(preferences) != NULL) && (new_directory != NULL))
+     if (strcmp(AMITK_PREFERENCES_DEFAULT_DIRECTORY(preferences), new_directory) != 0)
+       different=TRUE;
+ 
+@@ -392,7 +401,7 @@
+       g_free(preferences->default_directory);
+     if (new_directory != NULL)
+       preferences->default_directory = g_strdup(new_directory);
+-    amide_gconf_set_string(GCONF_AMIDE_MISC,"DefaultDirectory", new_directory);
++    amide_gconf_set_string(GCONF_AMIDE_MISC,"default-directory", new_directory);
+     g_signal_emit(G_OBJECT(preferences), preferences_signals[MISC_PREFERENCES_CHANGED], 0);
+   }
+   return;
+@@ -410,7 +419,7 @@
+   if (AMITK_PREFERENCES_COLOR_TABLE(preferences,modality) != color_table) {
+     preferences->color_table[modality] = color_table;
+ 
+-    temp_string = g_strdup_printf("DefaultColorTable%s", 
++    temp_string = g_strdup_printf("default-color-table-%s",
+ 				  amitk_modality_get_name(modality));
+     amide_gconf_set_int(GCONF_AMIDE_DATASETS,temp_string, color_table);
+     g_free(temp_string);
+@@ -451,7 +460,7 @@
+ 
+   if (AMITK_PREFERENCES_THRESHOLD_STYLE(preferences) != threshold_style) {
+     preferences->threshold_style = threshold_style;
+-    amide_gconf_set_int(GCONF_AMIDE_DATASETS,"ThresholdStyle", threshold_style);
++    amide_gconf_set_int(GCONF_AMIDE_DATASETS,"threshold-style", threshold_style);
+     g_signal_emit(G_OBJECT(preferences), preferences_signals[DATA_SET_PREFERENCES_CHANGED], 0);
+   }
+ }
+--- amide.orig/amide-current/src/raw_data_import.c
++++ amide/amide-current/src/raw_data_import.c
+@@ -33,7 +33,7 @@
+ #include "raw_data_import.h"
+ #include "amitk_progress_dialog.h"
+ 
+-#define GCONF_AMIDE_RAWDATAIMPORT "RAWDATAIMPORT"
++#define GCONF_AMIDE_RAWDATAIMPORT "rawdataimport"
+ 
+ /* raw_data information structure */
+ typedef struct raw_data_info_t {
+@@ -109,7 +109,7 @@
+   /* and save the value */
+   raw_data_info->scale_factor = temp_real;
+ 
+-  amide_gconf_set_float(GCONF_AMIDE_RAWDATAIMPORT,"LastScaleFactor", raw_data_info->scale_factor);
++  amide_gconf_set_float(GCONF_AMIDE_RAWDATAIMPORT,"last-scale-factor", raw_data_info->scale_factor);
+ 
+   return;
+ }
+@@ -185,15 +185,15 @@
+   /* recalculate the total number of bytes to be read and have it displayed */
+   update_num_bytes(raw_data_info);
+ 
+-  amide_gconf_set_int(GCONF_AMIDE_RAWDATAIMPORT,"LastDataDimG", raw_data_info->data_dim.g);
+-  amide_gconf_set_int(GCONF_AMIDE_RAWDATAIMPORT,"LastDataDimT", raw_data_info->data_dim.t);
+-  amide_gconf_set_int(GCONF_AMIDE_RAWDATAIMPORT,"LastDataDimZ", raw_data_info->data_dim.z);
+-  amide_gconf_set_int(GCONF_AMIDE_RAWDATAIMPORT,"LastDataDimY", raw_data_info->data_dim.y);
+-  amide_gconf_set_int(GCONF_AMIDE_RAWDATAIMPORT,"LastDataDimX", raw_data_info->data_dim.x);
+-  amide_gconf_set_float(GCONF_AMIDE_RAWDATAIMPORT,"LastVoxelSizeZ", raw_data_info->voxel_size.z);
+-  amide_gconf_set_float(GCONF_AMIDE_RAWDATAIMPORT,"LastVoxelSizeY", raw_data_info->voxel_size.y);
+-  amide_gconf_set_float(GCONF_AMIDE_RAWDATAIMPORT,"LastVoxelSizeX", raw_data_info->voxel_size.x);
+-  amide_gconf_set_int(GCONF_AMIDE_RAWDATAIMPORT,"LastOffset", raw_data_info->offset);
++  amide_gconf_set_int(GCONF_AMIDE_RAWDATAIMPORT,"last-data-dim-g", raw_data_info->data_dim.g);
++  amide_gconf_set_int(GCONF_AMIDE_RAWDATAIMPORT,"last-data-dim-t", raw_data_info->data_dim.t);
++  amide_gconf_set_int(GCONF_AMIDE_RAWDATAIMPORT,"last-data-dim-z", raw_data_info->data_dim.z);
++  amide_gconf_set_int(GCONF_AMIDE_RAWDATAIMPORT,"last-data-dim-y", raw_data_info->data_dim.y);
++  amide_gconf_set_int(GCONF_AMIDE_RAWDATAIMPORT,"last-data-dim-x", raw_data_info->data_dim.x);
++  amide_gconf_set_float(GCONF_AMIDE_RAWDATAIMPORT,"last-voxel-size-z", raw_data_info->voxel_size.z);
++  amide_gconf_set_float(GCONF_AMIDE_RAWDATAIMPORT,"last-voxel-size-y", raw_data_info->voxel_size.y);
++  amide_gconf_set_float(GCONF_AMIDE_RAWDATAIMPORT,"last-voxel-size-x", raw_data_info->voxel_size.x);
++  amide_gconf_set_int(GCONF_AMIDE_RAWDATAIMPORT,"last-offset", raw_data_info->offset);
+ 
+   return;
+ }
+@@ -206,7 +206,7 @@
+ 
+   raw_data_info->modality = gtk_combo_box_get_active(GTK_COMBO_BOX(widget));
+ 
+-  amide_gconf_set_int(GCONF_AMIDE_RAWDATAIMPORT,"LastModality", raw_data_info->modality);
++  amide_gconf_set_int(GCONF_AMIDE_RAWDATAIMPORT,"last-modality", raw_data_info->modality);
+ 
+   return;
+ }
+@@ -223,7 +223,7 @@
+   /* update the offset label so it makes sense */
+   update_offset_label(raw_data_info);
+ 
+-  amide_gconf_set_int(GCONF_AMIDE_RAWDATAIMPORT,"LastRawFormat", raw_data_info->raw_format);
++  amide_gconf_set_int(GCONF_AMIDE_RAWDATAIMPORT,"last-raw-format", raw_data_info->raw_format);
+   return;
+ }
+ 
+@@ -295,31 +295,31 @@
+   gint temp_int;
+   gfloat temp_float;
+ 
+-  *plast_modality = amide_gconf_get_int(GCONF_AMIDE_RAWDATAIMPORT,"LastModality");
+-  *plast_raw_format = amide_gconf_get_int(GCONF_AMIDE_RAWDATAIMPORT,"LastRawFormat");
++  *plast_modality = amide_gconf_get_int(GCONF_AMIDE_RAWDATAIMPORT,"last-modality");
++  *plast_raw_format = amide_gconf_get_int(GCONF_AMIDE_RAWDATAIMPORT,"last-raw-format");
+ 
+-  temp_int = amide_gconf_get_int(GCONF_AMIDE_RAWDATAIMPORT,"LastDataDimG");
++  temp_int = amide_gconf_get_int(GCONF_AMIDE_RAWDATAIMPORT,"last-data-dim-g");
+   (*plast_data_dim).g = (temp_int == 0) ? 1 : temp_int;
+-  temp_int = amide_gconf_get_int(GCONF_AMIDE_RAWDATAIMPORT,"LastDataDimT");
++  temp_int = amide_gconf_get_int(GCONF_AMIDE_RAWDATAIMPORT,"last-data-dim-t");
+   (*plast_data_dim).t = (temp_int == 0) ? 1 : temp_int;
+-  temp_int = amide_gconf_get_int(GCONF_AMIDE_RAWDATAIMPORT,"LastDataDimZ");
++  temp_int = amide_gconf_get_int(GCONF_AMIDE_RAWDATAIMPORT,"last-data-dim-z");
+   (*plast_data_dim).z = (temp_int == 0) ? 1 : temp_int;
+-  temp_int = amide_gconf_get_int(GCONF_AMIDE_RAWDATAIMPORT,"LastDataDimY");
++  temp_int = amide_gconf_get_int(GCONF_AMIDE_RAWDATAIMPORT,"last-data-dim-y");
+   (*plast_data_dim).y = (temp_int == 0) ? 1 : temp_int; 
+-  temp_int = amide_gconf_get_int(GCONF_AMIDE_RAWDATAIMPORT,"LastDataDimX");
++  temp_int = amide_gconf_get_int(GCONF_AMIDE_RAWDATAIMPORT,"last-data-dim-x");
+   (*plast_data_dim).x = (temp_int == 0) ? 1 : temp_int; 
+ 
+ 
+-  temp_float = amide_gconf_get_float(GCONF_AMIDE_RAWDATAIMPORT,"LastVoxelSizeZ");
++  temp_float = amide_gconf_get_float(GCONF_AMIDE_RAWDATAIMPORT,"last-voxel-size-z");
+   (*plast_voxel_size).z =  EQUAL_ZERO(temp_float) ? 1.0 : temp_float;
+-  temp_float = amide_gconf_get_float(GCONF_AMIDE_RAWDATAIMPORT,"LastVoxelSizeY");
++  temp_float = amide_gconf_get_float(GCONF_AMIDE_RAWDATAIMPORT,"last-voxel-size-y");
+   (*plast_voxel_size).y =  EQUAL_ZERO(temp_float) ? 1.0 : temp_float;
+-  temp_float = amide_gconf_get_float(GCONF_AMIDE_RAWDATAIMPORT,"LastVoxelSizeX");
++  temp_float = amide_gconf_get_float(GCONF_AMIDE_RAWDATAIMPORT,"last-voxel-size-x");
+   (*plast_voxel_size).x =  EQUAL_ZERO(temp_float) ? 1.0 : temp_float;
+ 
+-  *plast_offset = amide_gconf_get_int(GCONF_AMIDE_RAWDATAIMPORT,"LastOffset");
++  *plast_offset = amide_gconf_get_int(GCONF_AMIDE_RAWDATAIMPORT,"last-offset");
+ 
+-  temp_float = amide_gconf_get_float(GCONF_AMIDE_RAWDATAIMPORT,"LastScaleFactor");
++  temp_float = amide_gconf_get_float(GCONF_AMIDE_RAWDATAIMPORT,"last-scale-factor");
+   *plast_scale_factor =  EQUAL_ZERO(temp_float) ? 1.0 : temp_float;
+ 
+   return;
+--- amide.orig/amide-current/src/tb_export_data_set.c
++++ amide/amide-current/src/tb_export_data_set.c
+@@ -37,7 +37,7 @@
+ #include "dcmtk_interface.h"
+ #endif
+ 
+-#define GCONF_AMIDE_EXPORT "EXPORT"
++#define GCONF_AMIDE_EXPORT "export"
+ 
+ typedef struct tb_export_t {
+   AmitkStudy * study;
+@@ -142,26 +142,26 @@
+ 			     AmitkPoint * voxel_size) {
+ 
+   if (resliced != NULL)
+-    *resliced = amide_gconf_get_bool(GCONF_AMIDE_EXPORT,"ResliceDataSet");
++    *resliced = amide_gconf_get_bool(GCONF_AMIDE_EXPORT,"reslice-data-set");
+   if (all_visible != NULL)
+-    *all_visible = amide_gconf_get_bool(GCONF_AMIDE_EXPORT,"AllVisibleDataSets");
++    *all_visible = amide_gconf_get_bool(GCONF_AMIDE_EXPORT,"all-visible-data-sets");
+   if (inclusive_bounding_box != NULL)
+-    *inclusive_bounding_box = amide_gconf_get_bool(GCONF_AMIDE_EXPORT,"InclusiveBoundingBox");
++    *inclusive_bounding_box = amide_gconf_get_bool(GCONF_AMIDE_EXPORT,"inclusive-bounding-box");
+   if (method != NULL)
+-    *method = amide_gconf_get_int(GCONF_AMIDE_EXPORT,"Method");
++    *method = amide_gconf_get_int(GCONF_AMIDE_EXPORT,"method");
+   if (submethod != NULL)
+-    *submethod = amide_gconf_get_int(GCONF_AMIDE_EXPORT,"Submethod");
++    *submethod = amide_gconf_get_int(GCONF_AMIDE_EXPORT,"submethod");
+ 
+   if (voxel_size != NULL) {
+-    (*voxel_size).z = amide_gconf_get_float(GCONF_AMIDE_EXPORT,"VoxelSizeZ");
++    (*voxel_size).z = amide_gconf_get_float(GCONF_AMIDE_EXPORT,"voxel-size-z");
+     if (EQUAL_ZERO((*voxel_size).z))
+       (*voxel_size).z =  1.0;
+     
+-    (*voxel_size).y = amide_gconf_get_float(GCONF_AMIDE_EXPORT,"VoxelSizeY");
++    (*voxel_size).y = amide_gconf_get_float(GCONF_AMIDE_EXPORT,"voxel-size-y");
+     if (EQUAL_ZERO((*voxel_size).y)) 
+       (*voxel_size).y =  1.0;
+     
+-    (*voxel_size).x = amide_gconf_get_float(GCONF_AMIDE_EXPORT,"VoxelSizeX");
++    (*voxel_size).x = amide_gconf_get_float(GCONF_AMIDE_EXPORT,"voxel-size-x");
+     if (EQUAL_ZERO((*voxel_size).x)) 
+       (*voxel_size).x =  1.0;
+   }
+@@ -303,14 +303,14 @@
+ 
+ 
+ static void write_voxel_size(AmitkPoint voxel_size) {
+-  amide_gconf_set_float(GCONF_AMIDE_EXPORT,"VoxelSizeZ", voxel_size.z);
+-  amide_gconf_set_float(GCONF_AMIDE_EXPORT,"VoxelSizeY", voxel_size.y);
+-  amide_gconf_set_float(GCONF_AMIDE_EXPORT,"VoxelSizeX", voxel_size.x);
++  amide_gconf_set_float(GCONF_AMIDE_EXPORT,"voxel-size-z", voxel_size.z);
++  amide_gconf_set_float(GCONF_AMIDE_EXPORT,"voxel-size-y", voxel_size.y);
++  amide_gconf_set_float(GCONF_AMIDE_EXPORT,"voxel-size-x", voxel_size.x);
+   return;
+ }
+ 
+ static void write_inclusive_bounding_box(gboolean inclusive) {
+-  amide_gconf_set_bool(GCONF_AMIDE_EXPORT,"InclusiveBoundingBox", inclusive);
++  amide_gconf_set_bool(GCONF_AMIDE_EXPORT,"inclusive-bounding-box", inclusive);
+   return;
+ }
+ 
+@@ -410,8 +410,8 @@
+   resliced = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(widget), "resliced"));
+   all_visible = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(widget), "all_visible"));
+ 
+-  amide_gconf_set_bool(GCONF_AMIDE_EXPORT,"ResliceDataSet", resliced);
+-  amide_gconf_set_bool(GCONF_AMIDE_EXPORT,"AllVisibleDataSets", all_visible);
++  amide_gconf_set_bool(GCONF_AMIDE_EXPORT,"reslice-data-set", resliced);
++  amide_gconf_set_bool(GCONF_AMIDE_EXPORT,"all-visible-data-sets", all_visible);
+ 
+   /* recalculate voxel sizes */
+   recommend_voxel_size(tb_export);
+@@ -451,7 +451,7 @@
+   gint submethod=0;
+   gint counter;
+   gint combo_method;
+-  AmitkImportMethod i_export_method;
++  AmitkExportMethod i_export_method;
+ #ifdef AMIDE_LIBMDC_SUPPORT
+   libmdc_export_t i_libmdc_export;
+ #endif
+@@ -482,8 +482,8 @@
+       }  
+   }
+ 
+-  amide_gconf_set_int(GCONF_AMIDE_EXPORT,"Method", method);
+-  amide_gconf_set_int(GCONF_AMIDE_EXPORT,"Submethod", submethod);
++  amide_gconf_set_int(GCONF_AMIDE_EXPORT,"method", method);
++  amide_gconf_set_int(GCONF_AMIDE_EXPORT,"submethod", submethod);
+ 
+   return;
+ }
+--- amide.orig/amide-current/src/tb_roi_analysis.c
++++ amide/amide-current/src/tb_roi_analysis.c
+@@ -35,7 +35,7 @@
+ #include "ui_common.h"
+ 
+ 
+-#define GCONF_AMIDE_ANALYSIS "ANALYSIS"
++#define GCONF_AMIDE_ANALYSIS "analysis"
+ 
+ #define ROI_STATISTICS_WIDTH 950
+ 
+@@ -706,13 +706,13 @@
+ 			     gdouble * threshold_percentage,
+ 			     gdouble * threshold_value) {
+ 
+-  *all_data_sets = amide_gconf_get_bool(GCONF_AMIDE_ANALYSIS,"CalculateAllDataSets");
+-  *all_rois = amide_gconf_get_bool(GCONF_AMIDE_ANALYSIS,"CalculateAllRois");
+-  *calculation_type = amide_gconf_get_int(GCONF_AMIDE_ANALYSIS,"CalculationType");
+-  *accurate = amide_gconf_get_bool(GCONF_AMIDE_ANALYSIS,"Accurate");
+-  *subfraction = amide_gconf_get_float(GCONF_AMIDE_ANALYSIS,"SubFraction");
+-  *threshold_percentage = amide_gconf_get_float(GCONF_AMIDE_ANALYSIS,"ThresholdPercentage");
+-  *threshold_value = amide_gconf_get_float(GCONF_AMIDE_ANALYSIS,"ThresholdValue");
++  *all_data_sets = amide_gconf_get_bool(GCONF_AMIDE_ANALYSIS,"calculate-all-data-sets");
++  *all_rois = amide_gconf_get_bool(GCONF_AMIDE_ANALYSIS,"calculate-all-rois");
++  *calculation_type = amide_gconf_get_int(GCONF_AMIDE_ANALYSIS,"calculation-type");
++  *accurate = amide_gconf_get_bool(GCONF_AMIDE_ANALYSIS,"accurate");
++  *subfraction = amide_gconf_get_float(GCONF_AMIDE_ANALYSIS,"sub-fraction");
++  *threshold_percentage = amide_gconf_get_float(GCONF_AMIDE_ANALYSIS,"threshold-percentage");
++  *threshold_value = amide_gconf_get_float(GCONF_AMIDE_ANALYSIS,"threshold-value");
+ 
+   return;
+ }
+@@ -877,8 +877,8 @@
+   all_data_sets = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(widget), "all_data_sets"));
+   all_rois = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(widget), "all_rois"));
+ 
+-  amide_gconf_set_bool(GCONF_AMIDE_ANALYSIS,"CalculateAllDataSets",all_data_sets);
+-  amide_gconf_set_bool(GCONF_AMIDE_ANALYSIS,"CalculateAllRois",all_rois);
++  amide_gconf_set_bool(GCONF_AMIDE_ANALYSIS,"calculate-all-data-sets",all_data_sets);
++  amide_gconf_set_bool(GCONF_AMIDE_ANALYSIS,"calculate-all-rois",all_rois);
+ 
+   return;
+ }
+@@ -896,11 +896,11 @@
+   gtk_widget_set_sensitive(spin_buttons[1], calculation_type == VOXELS_NEAR_MAX);
+   gtk_widget_set_sensitive(spin_buttons[2], calculation_type == VOXELS_GREATER_THAN_VALUE);
+ 
+-  amide_gconf_set_int(GCONF_AMIDE_ANALYSIS,"CalculationType", calculation_type);
++  amide_gconf_set_int(GCONF_AMIDE_ANALYSIS,"calculation-type", calculation_type);
+ }
+ 
+ static void accurate_cb(GtkWidget * widget, gpointer data) {
+-  amide_gconf_set_bool(GCONF_AMIDE_ANALYSIS,"Accurate", 
++  amide_gconf_set_bool(GCONF_AMIDE_ANALYSIS,"accurate",
+ 		       gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)));
+   return;
+ }
+@@ -911,7 +911,7 @@
+ 
+   subfraction = gtk_spin_button_get_value(GTK_SPIN_BUTTON(widget))/100.0;
+ 
+-  amide_gconf_set_float(GCONF_AMIDE_ANALYSIS,"SubFraction", subfraction);
++  amide_gconf_set_float(GCONF_AMIDE_ANALYSIS,"sub-fraction", subfraction);
+ 
+   return;
+ }
+@@ -922,7 +922,7 @@
+ 
+   threshold_percentage = gtk_spin_button_get_value(GTK_SPIN_BUTTON(widget));
+ 
+-  amide_gconf_set_float(GCONF_AMIDE_ANALYSIS,"ThresholdPercentage", threshold_percentage);
++  amide_gconf_set_float(GCONF_AMIDE_ANALYSIS,"threshold-percentage", threshold_percentage);
+ 
+   return;
+ }
+@@ -934,7 +934,7 @@
+ 
+   threshold_value = gtk_spin_button_get_value(GTK_SPIN_BUTTON(widget));
+ 
+-  amide_gconf_set_float(GCONF_AMIDE_ANALYSIS,"ThresholdValue", threshold_value);
++  amide_gconf_set_float(GCONF_AMIDE_ANALYSIS,"threshold-value", threshold_value);
+ 
+   return;
+ }
+--- amide.orig/amide-current/src/ui_render.c
++++ amide/amide-current/src/ui_render.c
+@@ -647,11 +647,11 @@
+ 				    gboolean * initially_no_gradient_opacity) {
+ 
+   *strip_highs = 
+-    amide_gconf_get_bool(GCONF_AMIDE_RENDERING,"StripHighs");
++    amide_gconf_get_bool(GCONF_AMIDE_RENDERING,"strip-highs");
+   *optimize_renderings = 
+-    amide_gconf_get_bool(GCONF_AMIDE_RENDERING,"OptimizeRendering");
++    amide_gconf_get_bool(GCONF_AMIDE_RENDERING,"optimize-rendering");
+   *initially_no_gradient_opacity = 
+-    amide_gconf_get_bool(GCONF_AMIDE_RENDERING,"InitiallyNoGradientOpacity");
++    amide_gconf_get_bool(GCONF_AMIDE_RENDERING,"initially-no-gradient-opacity");
+ 
+   return;
+ }
+@@ -713,15 +713,15 @@
+ 
+   /* load in saved render preferences */
+   ui_render->update_without_release = 
+-    amide_gconf_get_bool(GCONF_AMIDE_RENDERING,"UpdateWithoutRelease");
++    amide_gconf_get_bool(GCONF_AMIDE_RENDERING,"update-without-release");
+ 
+   ui_render->stereo_eye_width = 
+-    amide_gconf_get_int(GCONF_AMIDE_RENDERING,"EyeWidth");
++    amide_gconf_get_int(GCONF_AMIDE_RENDERING,"eye-width");
+   if (ui_render->stereo_eye_width == 0)  /* if no config file, put in sane value */
+     ui_render->stereo_eye_width = 50*gdk_screen_width()/gdk_screen_width_mm(); /* in pixels */
+ 
+   ui_render->stereo_eye_angle = 
+-    amide_gconf_get_float(GCONF_AMIDE_RENDERING,"EyeAngle");
++    amide_gconf_get_float(GCONF_AMIDE_RENDERING,"eye-angle");
+   if ((ui_render->stereo_eye_angle <= 0.1) || (ui_render->stereo_eye_angle > 45.0))
+     ui_render->stereo_eye_angle = 5.0; /* degrees */
+ 
+@@ -1005,19 +1005,19 @@
+ 
+ 
+ static void init_strip_highs_cb(GtkWidget * widget, gpointer data) {
+-  amide_gconf_set_bool(GCONF_AMIDE_RENDERING,"StripHighs", 
++  amide_gconf_set_bool(GCONF_AMIDE_RENDERING,"strip-highs",
+ 		       gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)));
+   return;
+ }
+ 
+ static void init_optimize_rendering_cb(GtkWidget * widget, gpointer data) {
+-  amide_gconf_set_bool(GCONF_AMIDE_RENDERING,"OptimizeRendering", 
++  amide_gconf_set_bool(GCONF_AMIDE_RENDERING,"optimize-rendering",
+ 		       gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)));
+   return;
+ }
+ 
+ static void init_no_gradient_opacity_cb(GtkWidget * widget, gpointer data) {
+-  amide_gconf_set_bool(GCONF_AMIDE_RENDERING,"InitiallyNoGradientOpacity", 
++  amide_gconf_set_bool(GCONF_AMIDE_RENDERING,"initially-no-gradient-opacity",
+ 		       gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)));
+   return;
+ }
+--- amide.orig/amide-current/src/ui_render.h
++++ amide/amide-current/src/ui_render.h
+@@ -33,7 +33,7 @@
+ #include "render.h"
+ #include "amitk_study.h"
+ 
+-#define GCONF_AMIDE_RENDERING "RENDERING"
++#define GCONF_AMIDE_RENDERING "rendering"
+ 
+ /* defines */
+ #define UI_RENDER_BLANK_WIDTH 200
+--- amide.orig/amide-current/src/ui_render_dialog.c
++++ amide/amide-current/src/ui_render_dialog.c
+@@ -117,7 +117,7 @@
+     ui_render->update_without_release = update_without_release;
+ 
+     /* save user preferences */
+-    amide_gconf_set_bool(GCONF_AMIDE_RENDERING,"UpdateWithoutRelease", 
++    amide_gconf_set_bool(GCONF_AMIDE_RENDERING,"update-without-release",
+ 			 ui_render->update_without_release);
+   }
+ 
+@@ -141,7 +141,7 @@
+     ui_render->stereo_eye_angle = temp_val;
+     
+     /* save user preferences */
+-    amide_gconf_set_float(GCONF_AMIDE_RENDERING,"EyeAngle", 
++    amide_gconf_set_float(GCONF_AMIDE_RENDERING,"eye-angle",
+ 			  ui_render->stereo_eye_angle);
+     
+     /* do updating */
+@@ -170,7 +170,7 @@
+     ui_render->stereo_eye_width = temp_val;
+     
+     /* save user preferences */
+-    amide_gconf_set_int(GCONF_AMIDE_RENDERING,"EyeWidth", 
++    amide_gconf_set_int(GCONF_AMIDE_RENDERING,"eye-width",
+ 			ui_render->stereo_eye_width);
+     
+     /* do updating */
+--- amide.orig/amide-current/src/ui_series.c
++++ amide/amide-current/src/ui_series.c
+@@ -57,7 +57,7 @@
+ 
+ #define UPDATE_NONE 0
+ #define UPDATE_SERIES 0x1
+-#define GCONF_AMIDE_SERIES "SERIES"
++#define GCONF_AMIDE_SERIES "series"
+ 
+ 
+ 
+@@ -943,8 +943,8 @@
+ 
+ static void read_series_preferences(series_type_t * series_type, AmitkView * view) {
+ 
+-  *series_type = amide_gconf_get_int(GCONF_AMIDE_SERIES,"Type");
+-  *view = amide_gconf_get_int(GCONF_AMIDE_SERIES,"View");
++  *series_type = amide_gconf_get_int(GCONF_AMIDE_SERIES,"type");
++  *view = amide_gconf_get_int(GCONF_AMIDE_SERIES,"view");
+ 
+   return;
+ }
+@@ -1311,13 +1311,13 @@
+ 
+ 
+ static void init_series_type_cb(GtkWidget * widget, gpointer data) {
+-  amide_gconf_set_int(GCONF_AMIDE_SERIES,"Type", 
++  amide_gconf_set_int(GCONF_AMIDE_SERIES,"type",
+ 		      GPOINTER_TO_INT(g_object_get_data(G_OBJECT(widget), "series_type")));
+   return;
+ }
+ 
+ static void init_view_cb(GtkWidget * widget, gpointer data) {
+-  amide_gconf_set_int(GCONF_AMIDE_SERIES,"View",
++  amide_gconf_set_int(GCONF_AMIDE_SERIES,"view",
+ 		      GPOINTER_TO_INT(g_object_get_data(G_OBJECT(widget), "view")));
+   return;
+ }
+--- amide.orig/amide-current/src/amide.c
++++ amide/amide-current/src/amide.c
+@@ -125,11 +125,12 @@
+   return; /* nothing to complain about */
+ #endif
+ 
+-  already_warned = amide_gconf_get_string_with_default("MISSING_FUNCTIONALITY", "AlreadyWarned", "0.0.0");
++  already_warned = amide_gconf_get_string_with_default("missing-functionality", "already-warned", "0.0.0");
+ 
+-  if (g_strcmp0(already_warned, VERSION) == 0)
++  if (g_strcmp0(already_warned, VERSION) == 0) {
++    g_free(already_warned);
+     return;
+-  else {
++  } else {
+     comments = g_strconcat(_("This version of AMIDE has been compiled without the following functionality:"), 
+ 			   "\n\n",
+ #ifndef AMIDE_LIBGSL_SUPPORT
+@@ -152,7 +153,8 @@
+     g_warning("%s", comments);
+     
+     g_free(comments);
+-    amide_gconf_set_string("MISSING_FUNCTIONALITY", "AlreadyWarned", VERSION);
++    g_free(already_warned);
++    amide_gconf_set_string("missing-functionality", "already-warned", VERSION);
+     return;
+   }
+ }
diff --git a/debian/patches/series b/debian/patches/series
index f89670f..6dd1437 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -6,3 +6,4 @@ remove-autdated-gnome-macros.patch
 debian-djdecode.patch
 ffmpeg-5.patch
 typos.patch
+gsettings.patch
diff --git a/debian/rules b/debian/rules
index ceed165..fc4b597 100755
--- a/debian/rules
+++ b/debian/rules
@@ -17,7 +17,6 @@ override_dh_auto_configure:
 		--mandir=\$${prefix}/share/man \
 		--infodir=\$${prefix}/share/info \
 		--localstatedir=/var/lib/amide \
-                --disable-gconf \
                 --disable-gnome-vfs \
 		LDFLAGS="-Wl,-z,defs $(LDFLAGS)"
 
-- 
2.43.0

-------------- next part --------------
>From 7531affa66cec6cac8e9fadbbb84f652d343ece7 Mon Sep 17 00:00:00 2001
From: Yavor Doganov <yavor at gnu.org>
Date: Thu, 22 Feb 2024 14:35:51 +0200
Subject: [PATCH 2/5] Port to GTK 3 and GooCanvas (#967252)

---
 debian/changelog                    |     4 +
 debian/control                      |     4 +-
 debian/patches/gtk3+goocanvas.patch | 16634 ++++++++++++++++++++++++++
 debian/patches/series               |     1 +
 4 files changed, 16641 insertions(+), 2 deletions(-)
 create mode 100644 debian/patches/gtk3+goocanvas.patch

diff --git a/debian/changelog b/debian/changelog
index a37b9f8..ee29993 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,7 +2,11 @@ amide (1.0.6-4) UNRELEASED; urgency=medium
 
   * Team upload.
   * debian/patches/gsettings.patch: New; port to GSettings.
+  * debian/patches/gtk3+goocanvas.patch: New; port to GTK 3 and GooCanvas
+    2.0 (Closes: #967252).
   * debian/rules (override_dh_auto_configure): Remove --disable-gconf.
+  * debian/control (Build-Depends): Replace libgtk2.0-dev and
+    libgnomecanvas2-dev with libgtk-3-dev and libgoocanvas-2.0-dev.
   * debian/NEWS: New file; inform users that configuration is lost.
 
  -- Yavor Doganov <yavor at gnu.org>  Thu, 22 Feb 2024 09:00:50 +0200
diff --git a/debian/control b/debian/control
index 4b51967..2c009a5 100644
--- a/debian/control
+++ b/debian/control
@@ -9,9 +9,9 @@ Build-Depends: libtool,
                debhelper-compat (= 13),
                appstream-util,
                intltool,
-               libgtk2.0-dev,
+               libgtk-3-dev,
                libxml2-dev,
-               libgnomecanvas2-dev,
+               libgoocanvas-2.0-dev,
                libgsl-dev,
                libmdc-dev,
                libdcmtk-dev,
diff --git a/debian/patches/gtk3+goocanvas.patch b/debian/patches/gtk3+goocanvas.patch
new file mode 100644
index 0000000..cd4ec23
--- /dev/null
+++ b/debian/patches/gtk3+goocanvas.patch
@@ -0,0 +1,16634 @@
+Description: Port to GTK 3 and GooCanvas.
+ Upstream does not use a uniform coding style so I tried to stick to
+ the predominant style of the file or region of the modification.
+ .
+ Unfortunately the move to GTK 3 makes the main (study) window wider
+ even without an image loaded (#901677).  This is because some of the
+ widgets are larger, like GtkSpinButton with big "+" and "-" in it.
+ Additionally, GTK computes the width of the widget based on the
+ min/max values of the adjustment -- so the "thickness" button gets
+ wider than usual because the maximum allowed value is G_MAXDOUBLE.
+ I'll look into this issue separately and will eventually follow-up
+ with a patch at the bug where this issue is reported (#901677).
+ .
+ A major hurdle was frequent aborts when using the custom log handler
+ due to a GLib bug (see src/amide.h).  The only solution I came up
+ with was to redefine the macros and avoid setting a custom handler.
+ .
+ The GtkCurve and GtkGammaCurve widgets were ported to GTK 3 but
+ stripped from some functionality that AMIDE doesn't need (functions
+ like gtk_curve_set_vector are not available, also the additional
+ buttons of the GtkGammaCurve widget).  As is required by GTK 3,
+ drawing is done to an off-screen buffer (a cairo surface) which is
+ then effectively drawn on the widget during the ::draw signal.
+ .
+ The GtkHandleBox widget was not ported so parts of the UI are no
+ longer detachable.  I didn't consider this functionality important
+ enough to bother (unlike GtkCurve/GtkGammaCurve).
+ .
+ The AmitkDial widget was modified to behave as with policy
+ GTK_UPDATE_DISCONTINUOUS, which is the only use within AMIDE.  Since
+ GTK 3 removed policy support in GtkRange-based widgets, all of the
+ widgets where GTK_UPDATE_DISCONTINUOUS is set (for a good reason)
+ were modified to connect to a "button-release-event" handler, as a
+ workaround.  The "value-changed" callback is invoked from there.
+Bug-Debian: https://bugs.debian.org/967252
+Bug: https://github.com/ferdymercury/amide/issues/27
+Author: Yavor Doganov <yavor at gnu.org>
+Forwarded: no
+Last-Update: 2024-02-22
+---
+
+--- amide.orig/amide-current/configure.ac
++++ amide/amide-current/configure.ac
+@@ -369,9 +369,9 @@
+ 	glib-2.0	>= 2.44.0
+ 	gio-2.0         >= 2.44.0
+ 	gobject-2.0	>= 2.44.0
+-	gtk+-2.0	>= 2.16.0
++	gtk+-3.0	>= 3.21.5
+ 	libxml-2.0	>= 2.4.12
+-	libgnomecanvas-2.0 >= 2.0.0
++	goocanvas-2.0   >= 2.0.2
+ ])
+ 
+ GLIB_GSETTINGS
+@@ -401,35 +401,18 @@
+ dnl glib-genmarshal
+ AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
+ 
+-dnl This is installed from GTK+ 2.0's gdk-pixbuf
+-AC_PATH_PROG(GDK_PIXBUF_CSOURCE, gdk-pixbuf-csource)
+-test -z "$GDK_PIXBUF_CSOURCE" && AC_MSG_ERROR([
+-*** You need the gdk-pixbuf-csource tool which is installed
+-*** from GTK+ 2's gdk-pixbuf.
++dnl This is installed from GLib
++AC_PATH_PROG(GLIB_COMPILE_RESOURCES, glib-compile-resources)
++test -z "$GLIB_COMPILE_RESOURCES" && AC_MSG_ERROR([
++*** You need the glib-compile-resources tool which is installed
++*** from GLib.
+ ***
+-*** Either the location where you installed your GTK+ 2 is
++*** Either the location where you installed your GLib is
+ *** not in your PATH or something is screwed up with your
+-*** GTK+ 2 installation
++*** GLib installation
+ ])
+ 
+ 
+-dnl libgnomecanvas anti-aliasing has been buggy in the past. I originally thought
+-dnl this never would be fixed. Was unclear if the issues were in libgnomecanvas
+-dnl or libart. In any case, as of libgnomecanvas 2.30.3 things seem stable, 
+-dnl so I'm re-enabling support for now
+-dnl
+-dnl record if our version of libgnomecanvas can handle anti-aliasing
+-PKG_CHECK_MODULES(libgnomecanvas_greater_than_230, 
+-		[libgnomecanvas-2.0 >= 2.3.0], 
+-		enable_antialiasing=yes, enable_antialiasing=no)
+-if test $enable_antialiasing = yes; then
+-   echo "compiling with libgnomecanvas antialiasing support"
+-   AC_DEFINE(AMIDE_LIBGNOMECANVAS_AA, 1, Define to compile AMIDE with an antialiased canvas)
+-else
+-   echo "compiling without libgnomecanvas antialiasing support"
+-   AC_DEFINE(AMIDE_LIBGNOMECANVAS_AA, 0, Define to compile AMIDE with an antialiased canvas)
+-fi
+-
+ 
+ ################################################################
+ # Checks for gtk-doc and docbook-tools, from gtk's configure.in
+@@ -472,6 +455,7 @@
+ 
+ AC_CONFIG_FILES([
+ Makefile
++pixmaps/icons.xml
+ pixmaps/Makefile
+ src/Makefile
+ win32/Makefile
+--- amide.orig/amide-current/src/amitk_common.h
++++ amide/amide-current/src/amitk_common.h
+@@ -28,7 +28,7 @@
+ 
+ /* header files that are always needed with this file */
+ #include <gtk/gtk.h>
+-#include <libgnomecanvas/libgnomecanvas.h>
++#include <goocanvas.h>
+ #include "amide_intl.h"
+ 
+ G_BEGIN_DECLS
+@@ -148,7 +148,7 @@
+ 			       GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data);
+ gint amitk_spin_button_scientific_output (GtkSpinButton *spin_button, gpointer data);
+ gint amitk_spin_button_discard_double_or_triple_click(GtkWidget *widget, GdkEventButton *event, gpointer func_data);
+-GdkPixbuf * amitk_get_pixbuf_from_canvas(GnomeCanvas * canvas, gint xoffset, gint yoffset,
++GdkPixbuf * amitk_get_pixbuf_from_canvas(GooCanvas * canvas, gint xoffset, gint yoffset,
+ 					 gint width, gint height);
+ 
+ gboolean amitk_is_xif_directory(const gchar * filename, gboolean * plegacy, gchar ** pxml_filename);
+--- amide.orig/amide-current/src/amitk_canvas.h
++++ amide/amide-current/src/amitk_canvas.h
+@@ -61,14 +61,14 @@
+ 
+ struct _AmitkCanvas
+ {
+-  GtkVBox vbox;
++  GtkBox vbox;
+ 
+   GtkWidget * canvas;
+   GtkWidget * label;
+   GtkWidget * scrollbar;
+-  GtkObject * scrollbar_adjustment;
+-  GnomeCanvasItem * arrows[4];
+-  GnomeCanvasItem * orientation_label[4];
++  GtkAdjustment * scrollbar_adjustment;
++  GooCanvasItem * arrows[4];
++  GooCanvasItem * orientation_label[4];
+   AmitkCanvasType type;
+ 
+   AmitkVolume * volume; /* the volume that this canvas slice displays */
+@@ -84,11 +84,11 @@
+   gint max_slice_cache_size;
+   gint pixbuf_width, pixbuf_height;
+   gdouble border_width;
+-  GnomeCanvasItem * image;
++  GooCanvasItem * image;
+   GdkPixbuf * pixbuf;
+ 
+   gboolean time_on_image;
+-  GnomeCanvasItem * time_label;
++  GooCanvasItem * time_label;
+ 
+   AmitkStudy * study;
+   GList * undrawn_rois;
+@@ -99,10 +99,10 @@
+   GList * next_update_objects;
+ 
+   /* profile stuff */
+-  GnomeCanvasItem * line_profile_item;
++  GooCanvasItem * line_profile_item;
+ 
+   /* target stuff */
+-  GnomeCanvasItem * target[8];
++  GooCanvasItem * target[8];
+   AmitkCanvasTargetAction next_target_action;
+   AmitkPoint next_target_center;
+   amide_real_t next_target_thickness;
+@@ -111,7 +111,7 @@
+ 
+ struct _AmitkCanvasClass
+ {
+-  GtkVBoxClass parent_class;
++  GtkBoxClass parent_class;
+   
+   void (* help_event)                (AmitkCanvas *Canvas,
+ 				      AmitkHelpInfo which_help,
+--- amide.orig/amide-current/src/amitk_preferences.h
++++ amide/amide-current/src/amitk_preferences.h
+@@ -47,12 +47,7 @@
+ #define AMITK_PREFERENCES_DEFAULT_DIRECTORY(object)       (AMITK_PREFERENCES(object)->default_directory)
+ 
+ #define AMITK_PREFERENCES_CANVAS_ROI_WIDTH(pref)                (AMITK_PREFERENCES(pref)->canvas_roi_width)
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+ #define AMITK_PREFERENCES_CANVAS_ROI_TRANSPARENCY(pref)         (AMITK_PREFERENCES(pref)->canvas_roi_transparency)
+-#else
+-#define AMITK_PREFERENCES_CANVAS_LINE_STYLE(pref)               (AMITK_PREFERENCES(pref)->canvas_line_style)
+-#define AMITK_PREFERENCES_CANVAS_FILL_ROI(pref)                 (AMITK_PREFERENCES(pref)->canvas_fill_roi)
+-#endif
+ #define AMITK_PREFERENCES_CANVAS_LAYOUT(pref)                   (AMITK_PREFERENCES(pref)->canvas_layout)
+ #define AMITK_PREFERENCES_CANVAS_MAINTAIN_SIZE(pref)            (AMITK_PREFERENCES(pref)->canvas_maintain_size)
+ #define AMITK_PREFERENCES_CANVAS_TARGET_EMPTY_AREA(pref)        (AMITK_PREFERENCES(pref)->canvas_target_empty_area)
+@@ -70,12 +65,7 @@
+ } AmitkWhichDefaultDirectory;
+ 
+ #define AMITK_PREFERENCES_DEFAULT_CANVAS_ROI_WIDTH 2
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+ #define AMITK_PREFERENCES_DEFAULT_CANVAS_ROI_TRANSPARENCY 0.5
+-#else
+-#define AMITK_PREFERENCES_DEFAULT_CANVAS_LINE_STYLE GDK_LINE_SOLID
+-#define AMITK_PREFERENCES_DEFAULT_CANVAS_FILL_ROI TRUE
+-#endif
+ #define AMITK_PREFERENCES_DEFAULT_CANVAS_LAYOUT AMITK_LAYOUT_LINEAR
+ #define AMITK_PREFERENCES_DEFAULT_CANVAS_MAINTAIN_SIZE TRUE
+ #define AMITK_PREFERENCES_DEFAULT_CANVAS_TARGET_EMPTY_AREA 5
+@@ -113,10 +103,6 @@
+   /* canvas preferences -> study preferences */
+   gint canvas_roi_width;
+   gdouble canvas_roi_transparency;
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+-  GdkLineStyle canvas_line_style;
+-  gboolean canvas_fill_roi;
+-#endif
+   AmitkLayout canvas_layout;
+   gboolean canvas_maintain_size;
+   gint canvas_target_empty_area; /* in pixels */
+@@ -149,15 +135,8 @@
+ AmitkPreferences*   amitk_preferences_new                        (void);
+ void                amitk_preferences_set_canvas_roi_width       (AmitkPreferences * preferences, 
+ 							          gint roi_width);
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+ void                amitk_preferences_set_canvas_roi_transparency(AmitkPreferences * preferences, 
+ 							          gdouble roi_transparency);
+-#else
+-void                amitk_preferences_set_canvas_line_style      (AmitkPreferences * preferences, 
+-							          GdkLineStyle line_style);
+-void                amitk_preferences_set_canvas_fill_roi        (AmitkPreferences * preferences, 
+-							          gboolean fill_roi);
+-#endif
+ void                amitk_preferences_set_canvas_layout          (AmitkPreferences * preferences, 
+ 							          AmitkLayout layout);
+ void                amitk_preferences_set_canvas_maintain_size   (AmitkPreferences * preferences, 
+--- amide.orig/amide-current/src/amitk_threshold.h
++++ amide/amide-current/src/amitk_threshold.h
+@@ -30,7 +30,7 @@
+ 
+ /* includes we always need with this widget */
+ #include <gtk/gtk.h>
+-#include <libgnomecanvas/libgnomecanvas.h>
++#include <goocanvas.h>
+ #include "amitk_data_set.h"
+ #include "amitk_study.h"
+ 
+@@ -86,17 +86,17 @@
+ 
+ struct _AmitkThreshold
+ {
+-  GtkVBox vbox;
++  GtkBox vbox;
+ 
+   gboolean minimal; /* true if we just want the color table menu and the color scale */
+   AmitkViewMode view_mode;
+   GtkWidget * color_scales[2];
+   GtkWidget * histogram;
+   GtkWidget * histogram_label;
+-  GnomeCanvasItem * color_scale_image[2][AMITK_THRESHOLD_SCALE_NUM_SCALES];
+-  GnomeCanvasItem * histogram_image;
+-  GnomeCanvasItem * arrow[2][AMITK_THRESHOLD_ARROW_NUM_ARROWS];
+-  GnomeCanvasItem * connector_line[2][AMITK_THRESHOLD_LINE_NUM_LINES];
++  GooCanvasItem * color_scale_image[2][AMITK_THRESHOLD_SCALE_NUM_SCALES];
++  GooCanvasItem * histogram_image;
++  GooCanvasItem * arrow[2][AMITK_THRESHOLD_ARROW_NUM_ARROWS];
++  GooCanvasItem * connector_line[2][AMITK_THRESHOLD_LINE_NUM_LINES];
+   GtkWidget * spin_button[2][AMITK_THRESHOLD_ENTRY_NUM_ENTRIES];
+   GtkWidget * color_table_label[AMITK_VIEW_MODE_NUM];
+   GtkWidget * color_table_hbox[AMITK_VIEW_MODE_NUM];
+@@ -129,7 +129,7 @@
+ 
+ struct _AmitkThresholdClass
+ {
+-  GtkVBoxClass parent_class;
++  GtkBoxClass parent_class;
+ };  
+ 
+ 
+--- amide.orig/amide-current/src/ui_study.h
++++ amide/amide-current/src/ui_study.h
+@@ -29,7 +29,7 @@
+ /* header files that are always needed with this file */
+ #include <gdk-pixbuf/gdk-pixbuf.h>
+ #include "amitk_study.h"
+-#include <libgnomecanvas/libgnomecanvas.h>
++#include <goocanvas.h>
+ 
+ #define AMIDE_LIMIT_ZOOM_UPPER 10.0
+ #define AMIDE_LIMIT_ZOOM_LOWER 0.2
+@@ -65,12 +65,12 @@
+   GtkWidget * thickness_spin;
+   GtkWidget * zoom_spin;
+   GtkWidget * fov_spin;
+-  GtkAction * interpolation_action[AMITK_INTERPOLATION_NUM];
++  GAction * interpolation_action;
+   GtkWidget * rendering_menu;
+-  GtkAction * canvas_target_action;
+-  GtkAction * canvas_visible_action[AMITK_VIEW_NUM];
+-  GtkAction * view_mode_action[AMITK_VIEW_MODE_NUM];
+-  GtkAction * fuse_type_action[AMITK_FUSE_TYPE_NUM];
++  GAction * canvas_target_action;
++  GAction * canvas_visible_action[AMITK_VIEW_NUM];
++  GAction * view_mode_action;
++  GAction * fuse_type_action;
+   GtkWidget * tree_view; /* the tree showing the study data structure info */
+   GtkWidget * gate_dialog;
+   GtkWidget * gate_button;
+@@ -84,15 +84,14 @@
+   /* canvas specific info */
+   GtkWidget * center_table;
+   GtkWidget * canvas_table[AMITK_VIEW_MODE_NUM];
+-  GtkWidget * canvas_handle[AMITK_VIEW_MODE_NUM];
+   GtkWidget * canvas[AMITK_VIEW_MODE_NUM][AMITK_VIEW_NUM];
+   AmitkPanelLayout panel_layout;
+   AmitkLayout  canvas_layout;
+ 
+   /* help canvas info */
+-  GnomeCanvas * help_info;
+-  GnomeCanvasItem * help_legend[NUM_HELP_INFO_LINES];
+-  GnomeCanvasItem * help_line[NUM_HELP_INFO_LINES];
++  GooCanvas * help_info;
++  GooCanvasItem * help_legend[NUM_HELP_INFO_LINES];
++  GooCanvasItem * help_line[NUM_HELP_INFO_LINES];
+ 
+   /* preferences */
+   AmitkPreferences * preferences;
+--- amide.orig/amide-current/src/ui_common.h
++++ amide/amide-current/src/ui_common.h
+@@ -25,11 +25,9 @@
+ 
+ /* header files that are always needed with this file */
+ #include <gtk/gtk.h>
+-#include <libgnomecanvas/libgnomecanvas.h>
++#include <goocanvas.h>
+ #include "amitk_point.h"
+ 
+-#define HELP_MENU_UI_DESCRIPTION  "<menu action='HelpMenu'> <menuitem action='HelpContents'/> <separator/> <menuitem action='HelpAbout'/> </menu>"
+-
+ typedef enum {
+   UI_CURSOR_DEFAULT,
+   UI_CURSOR_ROI_MODE,
+@@ -57,31 +55,21 @@
+ gboolean ui_common_check_filename(const gchar * filename);
+ void ui_common_set_last_path_used(const gchar * last_path_used);
+ gchar * ui_common_suggest_path(void);
+-void ui_common_entry_name_cb(gchar * entry_string, gpointer data);
+ void ui_common_about_cb(GtkWidget * button, gpointer data);
+-void ui_common_draw_view_axis(GnomeCanvas * canvas, gint row, gint column, 
++void ui_common_draw_view_axis(GooCanvas * canvas, gint row, gint column,
+ 			      AmitkView view, AmitkLayout layout, 
+ 			      gint axis_width, gint axis_height);
+ 
+-void ui_common_update_sample_roi_item(GnomeCanvasItem * roi_item,
++void ui_common_update_sample_roi_item(GooCanvasItem * roi_item,
+ 				      gint roi_width,
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+ 				      gdouble transparency
+-#else
+-				      GdkLineStyle line_style
+-#endif
+ 				      );
+ 
+ void ui_common_study_preferences_widgets(GtkWidget * packing_table,
+ 					 gint table_row,
+ 					 GtkWidget ** proi_width_spin,
+-					 GnomeCanvasItem ** proi_item,
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
++					 GooCanvasItem ** proi_item,
+ 					 GtkWidget ** proi_transparency_spin,
+-#else
+-					 GtkWidget ** pline_style_menu,
+-					 GtkWidget ** fill_roi_button,
+-#endif
+ 					 GtkWidget ** playout_button1,
+ 					 GtkWidget ** playout_button2,
+ 					 GtkWidget ** ppanel_layout_button1,
+@@ -107,6 +95,6 @@
+ 
+ 
+ /* external variables */
+-extern GtkActionEntry ui_common_help_menu_items[UI_COMMON_HELP_MENU_NUM];
++extern GActionEntry ui_common_help_menu_items[UI_COMMON_HELP_MENU_NUM];
+ extern GdkCursor * ui_common_cursor[NUM_CURSORS];
+ 
+--- amide.orig/amide-current/src/amide.c
++++ amide/amide-current/src/amide.c
+@@ -39,8 +39,27 @@
+ #include "pixmaps.h"
+ #include "ui_study.h"
+ #include "ui_common.h"
++#include "gresource.c"
+ 
++typedef struct
++{
++  GtkApplication parent;
+ 
++  AmitkPreferences * preferences;
++  AmitkStudy * imported_study;
++  gint studies_launched;
++} Amide;
++
++typedef GtkApplicationClass AmideClass;
++
++G_DEFINE_TYPE (Amide, amide, GTK_TYPE_APPLICATION)
++
++static void amide_startup(GApplication * app);
++static void amide_activate(GApplication * app);
++static void amide_open(GApplication * app, GFile ** files, gint n_files, const gchar * hint);
++static void amide_shutdown(GApplication * app);
++static int amide_handle_options(GApplication * app, GVariantDict * options);
++static void amide_finalize(GObject * obj);
+ 
+ /* external variables */
+ gchar * object_menu_names[] = {
+@@ -69,11 +88,15 @@
+ 		       const gchar *message,
+ 		       gpointer user_data) {
+ 
+-  AmitkPreferences * preferences = user_data;
++  Amide * app = user_data;
++  AmitkPreferences * preferences = app->preferences;
++  GtkApplication * gtkapp = GTK_APPLICATION(app);
+   GtkWidget * dialog;
+   GtkWidget * message_area;
+   GtkWidget * scrolled;
+   GtkWidget * label;
++  GtkWidget * hbox;
++  GtkWidget * icon;
+ 
+   if (AMITK_PREFERENCES_WARNINGS_TO_CONSOLE(preferences)) {
+     if (log_level & G_LOG_LEVEL_MESSAGE) 
+@@ -86,7 +109,8 @@
+       g_print("AMIDE DEBUG: %s\n", message);
+   } else {
+ 
+-    dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_DESTROY_WITH_PARENT,
++    dialog = gtk_message_dialog_new(gtk_application_get_active_window(gtkapp),
++				    GTK_DIALOG_DESTROY_WITH_PARENT,
+ 				    (log_level == G_LOG_LEVEL_MESSAGE) ? GTK_MESSAGE_INFO : GTK_MESSAGE_WARNING,
+ 				    GTK_BUTTONS_OK,
+ 				    "AMIDE %s", 
+@@ -94,16 +118,25 @@
+ 
+     message_area = gtk_message_dialog_get_message_area(GTK_MESSAGE_DIALOG(dialog));
+ 
++    /* Add icon like the GTK 2 version; looks ugly otherwise.  */
++    hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
++    icon = gtk_image_new_from_icon_name((log_level == G_LOG_LEVEL_MESSAGE)
++                                        ? "dialog-information"
++                                        : "dialog-warning",
++                                        GTK_ICON_SIZE_DIALOG);
++    gtk_box_pack_start(GTK_BOX(hbox), icon, FALSE, FALSE, X_PADDING);
++    gtk_box_pack_start(GTK_BOX(message_area), hbox, FALSE, FALSE, Y_PADDING);
++
+     scrolled = gtk_scrolled_window_new(NULL, NULL);
+-    gtk_widget_set_size_request(scrolled, -1, 75);
++    gtk_widget_set_size_request(scrolled, 250, 75);
+ 
+     gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled), 
+ 				   GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
+-    gtk_box_pack_start(GTK_BOX(message_area), scrolled, TRUE, TRUE, Y_PADDING);
++    gtk_box_pack_start(GTK_BOX(hbox), scrolled, TRUE, TRUE, X_PADDING);
+ 
+     label = gtk_label_new(message);
+     gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
+-    gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrolled), label);
++    gtk_container_add(GTK_CONTAINER(scrolled), label);
+ 
+     gtk_widget_show_all(message_area);
+ 
+@@ -114,6 +147,23 @@
+   return;
+ }
+ 
++void amide_log(const gchar *log_domain,
++               GLogLevelFlags log_level,
++               const gchar *format,
++               ...) {
++
++  GApplication * app;
++  gchar * message;
++  va_list args;
++
++  va_start(args, format);
++  message = g_strdup_vprintf(format, args);
++  va_end(args);
++
++  app = g_application_get_default();
++  amide_log_handler(log_domain, log_level, message, app);
++  g_free(message);
++}
+ 
+ 
+ void missing_functionality_warning(AmitkPreferences * preferences) {
+@@ -159,58 +209,170 @@
+   }
+ }
+ 
++static  gchar **remaining_args = NULL;
+ 
++static void amide_init(Amide * app) {
+ 
+-static  gchar **remaining_args = NULL;
++  app->preferences = NULL;
++  app->imported_study = NULL;
++  app->studies_launched = 0;
++}
+ 
+-static GOptionEntry command_line_entries[] = {
+-  //  { "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose, "Be verbose", NULL },
+-  { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &remaining_args, "Special option that collects any remaining arguments for us" },
+-  { NULL }
+-};
++static void amide_class_init(AmideClass * class) {
+ 
++  GApplicationClass * application_class = G_APPLICATION_CLASS(class);
++  GObjectClass * object_class = G_OBJECT_CLASS(class);
+ 
+-/********************************************* */
+-int main (int argc, char *argv []) {
++  application_class->startup = amide_startup;
++  application_class->activate = amide_activate;
++  application_class->open = amide_open;
++  application_class->shutdown = amide_shutdown;
++  application_class->handle_local_options = amide_handle_options;
+ 
+-  gint studies_launched=0;
+-  AmitkPreferences * preferences;
+-  struct stat file_info;
+-  AmitkStudy * imported_study = NULL;
++  object_class->finalize = amide_finalize;
++}
++
++static Amide * amide_new(void) {
++
++  Amide * app;
++
++  g_set_application_name(_("AMIDE"));
++
++  app = g_object_new(amide_get_type(),
++                     "application-id", "com.github.ferdymercury.amide",
++                     "flags", G_APPLICATION_HANDLES_OPEN,
++                     NULL);
++
++  return app;
++}
++
++static void amide_finalize(GObject * obj) {
++
++  G_OBJECT_CLASS(amide_parent_class)->finalize(obj);
++}
++
++static void amide_shutdown(GApplication * gapp) {
++
++  /* clean-up */
++  amide_gconf_shutdown();
++
++  G_APPLICATION_CLASS(amide_parent_class)->shutdown(gapp);
++}
++
++static void amide_activate(GApplication * gapp) {
++
++  Amide * app = (Amide *) gapp;
++
++  if (app->imported_study != NULL) {
++    /* all imported data sets go into one study */
++    ui_study_create(app->imported_study, app->preferences);
++    app->studies_launched++;
++    app->imported_study = amitk_object_unref(app->imported_study);
++  }
++
++  /* start up an empty study if we haven't loaded in anything */
++  if (app->studies_launched < 1)
++    ui_study_create(NULL, app->preferences);
++
++  /* remove left over references */
++  g_object_unref(app->preferences);
++}
++
++static int amide_handle_options(GApplication * gapp, GVariantDict * opts) {
++
++  GPtrArray * files;
++  guint num_files, i;
++
++  if (remaining_args) {
++    num_files = g_strv_length(remaining_args);
++    files = g_ptr_array_new_full(num_files, g_object_unref);
++    for (i = 0; i < num_files; i++) {
++      GFile * file = NULL;
++
++      file = g_file_new_for_path(remaining_args[i]);
++      g_ptr_array_add(files, file);
++    }
++    g_application_open(gapp, (GFile **) files->pdata, num_files, "");
++    g_ptr_array_unref(files);
++  }
++
++  return -1;
++}
++
++static void amide_open(GApplication * gapp, GFile ** files, int n_files, const gchar * hint) {
++
++  Amide * app = (Amide *) gapp;
+   AmitkStudy * study = NULL;
+-  const gchar * input_filename;
++  gchar * input_filename;
+   GList * new_data_sets;
+   AmitkDataSet * new_ds;
+   amide_real_t min_voxel_size;
+   gint i;
+-  gint num_args;
+   gchar * studyname=NULL;
+-  // GOptionContext *context;
+ 
++  for (i = 0; i < n_files; ++i) {
++    /*  input_filename is just pointers into the amide_ctx structure, and shouldn't be freed */
++    input_filename = remaining_args[i];
++
++    /* check to see that the filename exists and it's a directory */
++    if (!g_file_test(input_filename, G_FILE_TEST_EXISTS)) {
++      g_warning(_("%s does not exist"),input_filename);
++    } else if (amitk_is_xif_flat_file(input_filename, NULL, NULL) ||
++               amitk_is_xif_directory(input_filename, NULL, NULL)) {
++      if ((study=amitk_study_load_xml(input_filename)) == NULL)
++        g_warning(_("Failed to load in as XIF file: %s"), input_filename);
++    } else if (!g_file_test(input_filename, G_FILE_TEST_IS_DIR)) {
++      /* not a directory... maybe an import file? */
++      if ((new_data_sets = amitk_data_set_import_file(AMITK_IMPORT_METHOD_GUESS, 0, input_filename,
++                                                      &studyname, app->preferences, NULL, NULL)) != NULL) {
++
++        while (new_data_sets != NULL) {
++          new_ds = new_data_sets->data;
++          if (app->imported_study == NULL) {
++            app->imported_study = amitk_study_new(app->preferences);
++
++            if (studyname != NULL) {
++              amitk_study_suggest_name(app->imported_study, studyname);
++              g_free(studyname);
++              studyname = NULL;
++            } else if (AMITK_DATA_SET_SUBJECT_NAME(new_ds) != NULL)
++              amitk_study_suggest_name(app->imported_study, AMITK_DATA_SET_SUBJECT_NAME(new_ds));
++            else
++              amitk_study_suggest_name(app->imported_study, AMITK_OBJECT_NAME(new_ds));
++
++          }
++
++
++          amitk_object_add_child(AMITK_OBJECT(app->imported_study), AMITK_OBJECT(new_ds));
++          min_voxel_size = amitk_data_sets_get_min_voxel_size(AMITK_OBJECT_CHILDREN(app->imported_study));
++          amitk_study_set_view_thickness(app->imported_study, min_voxel_size);
++          new_data_sets = g_list_remove(new_data_sets, new_ds);
++          new_ds = amitk_object_unref(new_ds);
++        }
++      } else
++        g_warning(_("%s is not an AMIDE study or importable file type"), input_filename);
++    } else {
++      g_warning(_("%s is not an AMIDE XIF Directory"), input_filename);
++    }
+ 
+-  /* setup i18n */
+-  //  setlocale(LC_ALL, "");
+-  //  // setlocale(LC_NUMERIC, "POSIX"); /* don't switch radix sign (it's a period not a comma dammit */
+-  //  bindtextdomain(GETTEXT_PACKAGE, GNOMELOCALEDIR);
+-  //  textdomain(GETTEXT_PACKAGE);
++    if (study != NULL) {
++      /* each whole study gets it's own window */
++      ui_study_create(study, app->preferences);
++      app->studies_launched++;
++      study = amitk_object_unref(study);
++    }
++  }
+ 
++  g_strfreev (remaining_args);
++  remaining_args = NULL;
++}
+ 
+-#if defined (G_PLATFORM_WIN32)
+-  /* if setlocale is called on win32, we can't seem to reset the locale back to "C"
+-     to allow correct reading in of text data */
+-  gtk_disable_setlocale(); /* prevent gtk_init from calling setlocale, etc. */
+-#endif
+-  if (!gtk_init_with_args(&argc, &argv, _("[FILE1] [FILE2] ..."),
+-			  command_line_entries,
+-			  NULL, NULL)) {
+-    return 1;
+-  }
+-	
+-  //  context = g_option_context_new ("- analyize medical images");
+-  //  g_option_context_add_main_entries (context, command_line_entries, GETTEXT_PACKAGE);
+-  //  g_option_context_add_group (context, gtk_get_option_group (TRUE));
++static void amide_startup(GApplication * gapp) {
++
++  Amide * app = (Amide *) gapp;
++
++  G_APPLICATION_CLASS(amide_parent_class)->startup(gapp);
+ 
+-  //  g_option_context_parse (context, &argc, &argv, NULL);
+   amide_gconf_init();
+   
+   /* translations */
+@@ -223,118 +385,70 @@
+ #endif
+ 
+   /* load in the default preferences */
+-  preferences = amitk_preferences_new();
+-
+-  /* specify my own error handler */
+-  //g_log_set_handler (NULL, G_LOG_LEVEL_WARNING, amide_log_handler, preferences);
++  app->preferences = amitk_preferences_new();
+ 
+   /* specify my message handler */
+-  g_log_set_handler (NULL, G_LOG_LEVEL_MESSAGE | G_LOG_LEVEL_WARNING | G_LOG_LEVEL_INFO | G_LOG_LEVEL_DEBUG, amide_log_handler, preferences);
++  /* See https://gitlab.gnome.org/GNOME/glib/-/issues/299.  */
++  //g_log_set_handler (NULL, G_LOG_LEVEL_MESSAGE | G_LOG_LEVEL_WARNING | G_LOG_LEVEL_INFO | G_LOG_LEVEL_DEBUG, amide_log_handler, app);
+ 
+   /* specify the default directory */
+-  ui_common_set_last_path_used(AMITK_PREFERENCES_DEFAULT_DIRECTORY(preferences));
++  ui_common_set_last_path_used(AMITK_PREFERENCES_DEFAULT_DIRECTORY(app->preferences));
+ 
+ #ifdef OLD_WIN32_HACKS
+   /* ignore gdk warnings on win32 */
+   /* as of gtk 2.2.4, get "General case not implemented" warnings from gdkproperty-win32.c
+      that appear to be unwarrented */
+-  g_log_set_handler ("Gdk", G_LOG_LEVEL_WARNING, amide_log_handler_nopopup, preferences);
++  g_log_set_handler ("Gdk", G_LOG_LEVEL_WARNING, amide_log_handler_nopopup, app->preferences);
+ 
+   /* have those annoying UTF-8 error warnings go to a console, instead of distracting the user */
+-  g_log_set_handler ("Pango", G_LOG_LEVEL_WARNING, amide_log_handler_nopopup, preferences);
++  g_log_set_handler ("Pango", G_LOG_LEVEL_WARNING, amide_log_handler_nopopup, app->preferences);
+ #endif
+   
+   /* startup initializations */
+   amitk_common_font_init();
+-  pixmaps_initialize_icons();
+ 
+   /* complain about important missing functionality if appropriate */
+-  missing_functionality_warning(preferences);
++  missing_functionality_warning(app->preferences);
++}
+ 
+-  /* if we specified files on the command line, load them in */
+-  if (remaining_args != NULL) {
+-    num_args = g_strv_length (remaining_args);
+-
+-    for (i = 0; i < num_args; ++i) {
+-      /*  input_filename is just pointers into the amide_ctx structure, and shouldn't be freed */
+-      input_filename = remaining_args[i];
+-    
+-      /* check to see that the filename exists and it's a directory */
+-      if (stat(input_filename, &file_info) != 0) {
+-	g_warning(_("%s does not exist"),input_filename);
+-      } else if (amitk_is_xif_flat_file(input_filename, NULL, NULL) ||
+-		 amitk_is_xif_directory(input_filename, NULL, NULL)) {
+-	if ((study=amitk_study_load_xml(input_filename)) == NULL)
+-	  g_warning(_("Failed to load in as XIF file: %s"), input_filename);
+-      } else if (!S_ISDIR(file_info.st_mode)) {
+-	/* not a directory... maybe an import file? */
+-	if ((new_data_sets = amitk_data_set_import_file(AMITK_IMPORT_METHOD_GUESS, 0, input_filename, 
+-							&studyname, preferences, NULL, NULL)) != NULL) {
+-
+-	  while (new_data_sets != NULL) {
+-	    new_ds = new_data_sets->data;
+-	    if (imported_study == NULL) {
+-	      imported_study = amitk_study_new(preferences);
+-
+-	      if (studyname != NULL) { 
+-		amitk_study_suggest_name(imported_study, studyname);
+-		g_free(studyname);
+-		studyname = NULL;
+-	      } else if (AMITK_DATA_SET_SUBJECT_NAME(new_ds) != NULL)
+-		amitk_study_suggest_name(imported_study, AMITK_DATA_SET_SUBJECT_NAME(new_ds));
+-	      else
+-		amitk_study_suggest_name(imported_study, AMITK_OBJECT_NAME(new_ds)); 
+-
+-	    }
+-
+-
+-	    amitk_object_add_child(AMITK_OBJECT(imported_study), AMITK_OBJECT(new_ds));
+-	    min_voxel_size = amitk_data_sets_get_min_voxel_size(AMITK_OBJECT_CHILDREN(imported_study));
+-	    amitk_study_set_view_thickness(imported_study, min_voxel_size);
+-	    new_data_sets = g_list_remove(new_data_sets, new_ds);
+-	    new_ds = amitk_object_unref(new_ds);
+-	  }
+-	} else 
+-	  g_warning(_("%s is not an AMIDE study or importable file type"), input_filename);
+-      } else {
+-	g_warning(_("%s is not an AMIDE XIF Directory"), input_filename);
+-      }
+-      
+-      if (study != NULL) {
+-	/* each whole study gets it's own window */
+-	ui_study_create(study, preferences);
+-	studies_launched++;
+-	study = amitk_object_unref(study);
+-      } 
+-    }
++static GOptionEntry command_line_entries[] = {
++  //  { "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose, "Be verbose", NULL },
++  { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &remaining_args, NULL, N_("[FILE1] [FILE2] ...") },
++  { NULL }
++};
+ 
+-    g_strfreev (remaining_args);
+-    remaining_args = NULL;
+-  }
+-  
+ 
+-  if (imported_study != NULL) {
+-    /* all imported data sets go into one study */
+-    ui_study_create(imported_study, preferences);
+-    studies_launched++;
+-    imported_study = amitk_object_unref(imported_study);
+-  }
++/********************************************* */
++int main (int argc, char *argv []) {
+ 
+-  /* start up an empty study if we haven't loaded in anything */
+-  if (studies_launched < 1) 
+-    ui_study_create(NULL, preferences);
++  Amide * app;
++  int status;
+ 
+-  /* remove left over references */
+-  g_object_unref(preferences); 
++  /* setup i18n */
++  //  setlocale(LC_ALL, "");
++  //  // setlocale(LC_NUMERIC, "POSIX"); /* don't switch radix sign (it's a period not a comma dammit */
++  //  bindtextdomain(GETTEXT_PACKAGE, GNOMELOCALEDIR);
++  //  textdomain(GETTEXT_PACKAGE);
+ 
+-  /* the main event loop */
+-  gtk_main(); 
+-  
+-  /* clean-up */
+-  amide_gconf_shutdown();
+ 
+-  return 0;
+-}
++#if defined (G_PLATFORM_WIN32)
++  /* if setlocale is called on win32, we can't seem to reset the locale back to "C"
++     to allow correct reading in of text data */
++  gtk_disable_setlocale(); /* prevent gtk_init from calling setlocale, etc. */
++#endif
+ 
++  //  context = g_option_context_new ("- analyize medical images");
++  //  g_option_context_add_main_entries (context, command_line_entries, GETTEXT_PACKAGE);
++  //  g_option_context_add_group (context, gtk_get_option_group (TRUE));
+ 
++  //  g_option_context_parse (context, &argc, &argv, NULL);
++
++  app = amide_new();
++  g_application_add_main_option_entries(G_APPLICATION(app),
++                                        command_line_entries);
++  g_application_register(G_APPLICATION(app), NULL, NULL);
++  status = g_application_run(G_APPLICATION(app), argc, argv);
++  g_object_unref(app);
+ 
++  return status;
++}
+--- amide.orig/amide-current/src/amitk_common.c
++++ amide/amide-current/src/amitk_common.c
+@@ -160,7 +160,7 @@
+ 
+ gint amitk_spin_button_scientific_output (GtkSpinButton *spin_button, gpointer data) {
+ 
+-  gchar *buf = g_strdup_printf ("%g", spin_button->adjustment->value);
++  gchar *buf = g_strdup_printf ("%g", gtk_spin_button_get_value(spin_button));
+ 
+   if (strcmp (buf, gtk_entry_get_text (GTK_ENTRY (spin_button))))
+     gtk_entry_set_text (GTK_ENTRY (spin_button), buf);
+@@ -178,65 +178,44 @@
+     return FALSE;
+ }
+ 
+-/* The following function should return a pixbuf representing the currently shown data 
+-   on the canvas (within the specified height/width at the given offset).  
+-   -The code is based on gnome_canvas_paint_rect in gnome-canvas.c */
+-GdkPixbuf * amitk_get_pixbuf_from_canvas(GnomeCanvas * canvas, gint xoffset, gint yoffset,
++/* The following function should return a pixbuf representing the
++   currently shown data on the canvas (within the specified
++   height/width at the given offset).  */
++GdkPixbuf * amitk_get_pixbuf_from_canvas(GooCanvas * canvas, gint xoffset, gint yoffset,
+ 					 gint width, gint height) {
+ 
+   GdkPixbuf * pixbuf;
+-
+-  if (canvas->aa) {
+-    GnomeCanvasBuf buf;
+-    GdkColor *color;
+-    guchar * px;
+-
+-    px = g_new (guchar, width*height * 3);
+-
+-    buf.buf = px;
+-    buf.buf_rowstride = width * 3;
+-    buf.rect.x0 = xoffset;
+-    buf.rect.y0 = yoffset;
+-    buf.rect.x1 = xoffset+width;
+-    buf.rect.y1 = yoffset+height;
+-    color = &GTK_WIDGET(canvas)->style->bg[GTK_STATE_NORMAL];
+-    buf.bg_color = (((color->red & 0xff00) << 8) | (color->green & 0xff00) | (color->blue >> 8));
+-    buf.is_bg = 1;
+-    buf.is_buf = 0;
+-    
+-    /* render the background */
+-    if ((* GNOME_CANVAS_GET_CLASS(canvas)->render_background) != NULL)
+-      (* GNOME_CANVAS_GET_CLASS(canvas)->render_background) (canvas, &buf);
+-    
+-    /* render the rest */
+-    if (canvas->root->object.flags & GNOME_CANVAS_ITEM_VISIBLE)
+-      (* GNOME_CANVAS_ITEM_GET_CLASS (canvas->root)->render) (canvas->root, &buf);
+-    
+-    if (buf.is_bg) {
+-      g_warning("No code written to implement case buf.is_bg: %s at %d\n", __FILE__, __LINE__);
+-      pixbuf = NULL;
+-    } else {
+-      pixbuf = gdk_pixbuf_new_from_data(buf.buf, GDK_COLORSPACE_RGB, FALSE, 8, 
+-					width, height,width*3, NULL, NULL);
+-    }
+-  } else {
+-    GdkPixmap * pixmap;
+-
+-    pixmap = gdk_pixmap_new (canvas->layout.bin_window, width, height,
+-			     gtk_widget_get_visual (GTK_WIDGET(canvas))->depth);
+-
+-    /* draw the background */
+-    (* GNOME_CANVAS_GET_CLASS(canvas)->draw_background)
+-      (canvas, pixmap, xoffset, yoffset, width, height);
+-
+-    /* force a draw onto the pixmap */
+-    (* GNOME_CANVAS_ITEM_GET_CLASS (canvas->root)->draw) 
+-      (canvas->root, pixmap,xoffset, yoffset, width, height);
+-
+-    /* transfer to a pixbuf */
+-    pixbuf = gdk_pixbuf_get_from_drawable (NULL,GDK_DRAWABLE(pixmap),NULL,0,0,0,0,-1,-1);
+-    g_object_unref(pixmap); 
+-  }
++  GdkRGBA * bg;
++  GtkWidget * toplevel;
++  GtkStyleContext * ctxt;
++  cairo_t * cr;
++  cairo_surface_t * surf;
++  GooCanvasBounds bounds;
++
++  bounds.x1 = (gdouble) xoffset;
++  bounds.y1 = (gdouble) yoffset;
++  bounds.x2 = (gdouble) (xoffset+width);
++  bounds.y2 = (gdouble) (yoffset+height);
++
++  surf = cairo_image_surface_create(CAIRO_FORMAT_RGB24, width, height);
++  cr = cairo_create(surf);
++
++  /* Obtain the style context of the toplevel widget because canvas'
++     background is transparent black (that is, not set).  */
++  toplevel = gtk_widget_get_toplevel(GTK_WIDGET(canvas));
++  ctxt = gtk_widget_get_style_context(toplevel);
++  gtk_style_context_get(ctxt, GTK_STATE_FLAG_NORMAL,
++                        GTK_STYLE_PROPERTY_BACKGROUND_COLOR, &bg, NULL);
++  gdk_cairo_set_source_rgba(cr, bg);
++  cairo_rectangle(cr, 0, 0, width, height);
++  cairo_fill(cr);
++  goo_canvas_render(canvas, cr, &bounds, 0.0);
++  cairo_surface_flush(surf);
++  pixbuf = gdk_pixbuf_get_from_surface(surf, 0, 0, width, height);
++
++  gdk_rgba_free(bg);
++  cairo_destroy(cr);
++  cairo_surface_destroy(surf);
+ 
+   return pixbuf;
+ }
+--- amide.orig/amide-current/src/amitk_canvas_object.h
++++ amide/amide-current/src/amitk_canvas_object.h
+@@ -30,17 +30,17 @@
+ /* includes we always need with this widget */
+ #include <gdk-pixbuf/gdk-pixbuf.h>
+ #include <gtk/gtk.h>
+-#include <libgnomecanvas/gnome-canvas.h>
++#include <goocanvas.h>
+ #include "amitk_volume.h"
+ #include "amitk_color_table.h"
+ 
+ G_BEGIN_DECLS
+ 
+-GnomeCanvasItem * amitk_canvas_object_draw(GnomeCanvas * canvas, 
++GooCanvasItem * amitk_canvas_object_draw(GooCanvas * canvas,
+ 					   AmitkVolume * canvas_volume,
+ 					   AmitkObject * object,
+ 					   AmitkViewMode view_mode,
+-					   GnomeCanvasItem * item,
++					   GooCanvasItem * item,
+ 					   amide_real_t pixel_dim,
+ 					   gint width, 
+ 					   gint height,
+@@ -48,12 +48,7 @@
+ 					   gdouble y_offset,
+ 					   rgba_t roi_color,
+ 					   gint roi_width,
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+ 					   gdouble transparency
+-#else
+-					   GdkLineStyle line_style,
+-					   gboolean fill_roi
+-#endif
+ 					   );
+ 
+ 
+--- amide.orig/amide-current/src/amitk_canvas.c
++++ amide/amide-current/src/amitk_canvas.c
+@@ -154,9 +154,9 @@
+ 
+ static void canvas_class_init (AmitkCanvasClass *klass);
+ static void canvas_init (AmitkCanvas *canvas);
+-static void canvas_destroy(GtkObject * object);
++static void canvas_destroy(GtkWidget * object);
+ 
+-static GnomeCanvasItem * canvas_find_item(AmitkCanvas * canvas, AmitkObject * object);
++static GooCanvasItem * canvas_find_item(AmitkCanvas * canvas, AmitkObject * object);
+ static GList * canvas_add_current_objects(AmitkCanvas * canvas, GList * objects);
+ static void canvas_space_changed_cb(AmitkSpace * space, gpointer canvas);
+ static void canvas_object_selection_changed_cb(AmitkObject * object, gpointer canvas);
+@@ -184,8 +184,9 @@
+ 					 AmitkPoint position, AmitkDataSet * active_slice);
+ static gboolean canvas_create_freehand_roi(AmitkCanvas * canvas, AmitkRoi * roi, 
+ 					   AmitkPoint position, AmitkDataSet * active_slice);
+-static gboolean canvas_event_cb(GtkWidget* widget,  GdkEvent * event, gpointer data);
+-static void canvas_scrollbar_adjustment_cb(GtkObject * adjustment, gpointer data);
++static gboolean canvas_event_cb(GooCanvasItem * item, GooCanvasItem * target, GdkEvent * event, gpointer data);
++static void canvas_setup_handlers(AmitkCanvas * canvas, GooCanvasItem * item);
++static void canvas_scrollbar_adjustment_cb(GtkAdjustment * adjustment, gpointer data);
+ 
+ static gboolean canvas_recalc_corners(AmitkCanvas * canvas);
+ static void canvas_update_scrollbar(AmitkCanvas * canvas, AmitkPoint center, amide_real_t thickness);
+@@ -206,7 +207,7 @@
+ static void canvas_remove_object(AmitkCanvas * canvas, AmitkObject * object);
+ 
+ 
+-static GtkVBoxClass *canvas_parent_class;
++static GtkBoxClass *canvas_parent_class;
+ static guint canvas_signals[LAST_SIGNAL];
+ 
+ 
+@@ -230,7 +231,7 @@
+ 	NULL   /* value table */
+       };
+ 
+-      canvas_type = g_type_register_static (GTK_TYPE_VBOX, "AmitkCanvas", &canvas_info, 0);
++      canvas_type = g_type_register_static (GTK_TYPE_BOX, "AmitkCanvas", &canvas_info, 0);
+     }
+ 
+   return canvas_type;
+@@ -238,11 +239,11 @@
+ 
+ static void canvas_class_init (AmitkCanvasClass *klass)
+ {
+-  GtkObjectClass *gtkobject_class;
++  GtkWidgetClass *gtkobject_class;
+   /*  GtkWidgetClass *widget_class;
+   GObjectClass   *gobject_class; */
+ 
+-  gtkobject_class = (GtkObjectClass*) klass;
++  gtkobject_class = (GtkWidgetClass*) klass;
+   /*  widget_class =    (GtkWidgetClass*) klass;
+       gobject_class =   (GObjectClass *) klass; */
+ 
+@@ -309,6 +310,8 @@
+ {
+   gint i;
+ 
++  gtk_orientable_set_orientation(GTK_ORIENTABLE(canvas),
++                                 GTK_ORIENTATION_VERTICAL);
+   gtk_box_set_homogeneous(GTK_BOX(canvas), FALSE);
+ 
+   /* initialize some critical stuff */
+@@ -348,7 +351,7 @@
+ 
+ }
+ 
+-static void canvas_destroy (GtkObject * object) {
++static void canvas_destroy (GtkWidget * object) {
+ 
+   AmitkCanvas * canvas;
+ 
+@@ -392,12 +395,12 @@
+   }
+ 
+ 
+-  if (GTK_OBJECT_CLASS (canvas_parent_class)->destroy)
+-    (* GTK_OBJECT_CLASS (canvas_parent_class)->destroy) (object);
++  if (GTK_WIDGET_CLASS (canvas_parent_class)->destroy)
++    (* GTK_WIDGET_CLASS (canvas_parent_class)->destroy) (object);
+ }
+ 
+ 
+-static GnomeCanvasItem * canvas_find_item(AmitkCanvas * canvas, AmitkObject * object) {
++static GooCanvasItem * canvas_find_item(AmitkCanvas * canvas, AmitkObject * object) {
+ 
+   GList * items=canvas->object_items;
+ 
+@@ -463,7 +466,7 @@
+ static void canvas_object_selection_changed_cb(AmitkObject * object, gpointer data) {
+ 
+   AmitkCanvas * canvas = data;
+-  GnomeCanvasItem * item;
++  GooCanvasItem * item;
+   gboolean undrawn_roi=FALSE;
+ 
+   g_return_if_fail(AMITK_IS_CANVAS(canvas));
+@@ -494,7 +497,7 @@
+ 	}
+       } else if ((item = canvas_find_item(canvas, object)) != NULL) { /* an unselect */
+ 	canvas->object_items = g_list_remove(canvas->object_items, item);
+-	gtk_object_destroy(GTK_OBJECT(item));
++	goo_canvas_item_remove(item);
+ 	canvas_add_update(canvas, UPDATE_VIEW); /* needed to check if we need to reset the view slice */
+       }
+     }
+@@ -741,19 +744,22 @@
+   dialog = gtk_dialog_new_with_buttons (_("ROI Depth Selection"),
+ 					window,
+ 					GTK_DIALOG_DESTROY_WITH_PARENT,
+-					GTK_STOCK_OK, GTK_RESPONSE_OK, NULL);
++					_("_OK"), GTK_RESPONSE_OK, NULL);
+   gtk_container_set_border_width(GTK_CONTAINER(dialog), 10);
+   gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_OK);
+ 
+-  table = gtk_table_new(1,3,FALSE);
+-  gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), table);
++  table = gtk_grid_new();
++  gtk_grid_set_row_spacing(GTK_GRID(table), Y_PADDING);
++  gtk_grid_set_column_spacing(GTK_GRID(table), X_PADDING);
++  gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area
++                                  (GTK_DIALOG(dialog))), table);
+ 
+   /* pick depth of roi */
+-  image = gtk_image_new_from_stock(GTK_STOCK_DIALOG_QUESTION,GTK_ICON_SIZE_DIALOG);
+-  gtk_table_attach(GTK_TABLE(table), image, 0,1, 0,1, X_PACKING_OPTIONS, 0, X_PADDING, Y_PADDING);
++  image = gtk_image_new_from_icon_name("dialog-question", GTK_ICON_SIZE_DIALOG);
++  gtk_grid_attach(GTK_GRID(table), image, 0, 0, 1, 1);
+ 
+   label = gtk_label_new(_("Please pick depth of ROI (mm):"));
+-  gtk_table_attach(GTK_TABLE(table), label, 1,2, 0,1, 0, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), label, 1, 0, 1, 1);
+ 
+   spin_button = gtk_spin_button_new_with_range(0.0, G_MAXDOUBLE, MAX(z,EPSILON));
+   gtk_spin_button_set_value(GTK_SPIN_BUTTON(spin_button), z);
+@@ -764,7 +770,7 @@
+   gtk_entry_set_activates_default(GTK_ENTRY(spin_button), TRUE);
+   g_signal_connect(G_OBJECT(spin_button), "value_changed",  G_CALLBACK(value_spin_cb), &z);
+   g_signal_connect(G_OBJECT(spin_button), "output", G_CALLBACK(amitk_spin_button_scientific_output), NULL);
+-  gtk_table_attach(GTK_TABLE(table), spin_button, 2,3, 0,1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), spin_button, 2, 0, 1, 1);
+ 
+   gtk_widget_show_all(dialog);
+   gtk_dialog_run(GTK_DIALOG(dialog)); /* let the user input */
+@@ -905,15 +911,18 @@
+   dialog = gtk_dialog_new_with_buttons (_("Isocontour Value Selection"),
+ 					window,
+ 					GTK_DIALOG_DESTROY_WITH_PARENT,
+-					GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, 
+-					GTK_STOCK_OK, GTK_RESPONSE_OK, 
++					_("_Cancel"), GTK_RESPONSE_CANCEL,
++					_("_OK"), GTK_RESPONSE_OK,
+ 					NULL);
+   gtk_container_set_border_width(GTK_CONTAINER(dialog), 10);
+   gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_OK);
+ 
+-  table = gtk_table_new(4,3,FALSE);
++  table = gtk_grid_new();
++  gtk_grid_set_row_spacing(GTK_GRID(table), Y_PADDING);
++  gtk_grid_set_column_spacing(GTK_GRID(table), X_PADDING);
+   table_row=0;
+-  gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), table);
++  gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area
++                                  (GTK_DIALOG(dialog))), table);
+ 
+   /* complain if more then one frame or gate is currently showing for ISOCONTOUR_3D */
+   if (AMITK_ROI_TYPE(roi) == AMITK_ROI_TYPE_ISOCONTOUR_3D) {
+@@ -921,43 +930,42 @@
+ 
+     /* warning for multiple frames */
+     if (temp_voxel.t != amitk_data_set_get_frame(AMITK_DATA_SET(draw_on_ds), end_time)) {
+-      image = gtk_image_new_from_stock(GTK_STOCK_DIALOG_WARNING,GTK_ICON_SIZE_DIALOG);
+-      gtk_table_attach(GTK_TABLE(table), image, 0,1, table_row,table_row+1, X_PACKING_OPTIONS, 0, X_PADDING, Y_PADDING);
++      image = gtk_image_new_from_icon_name("dialog-warning", GTK_ICON_SIZE_DIALOG);
++      gtk_grid_attach(GTK_GRID(table), image, 0, table_row, 1, 1);
+ 
+       temp_str = g_strdup_printf(_("Multiple data frames are currently being shown from: %s\nThe isocontour will only be drawn over frame %d"),AMITK_OBJECT_NAME(draw_on_ds), temp_voxel.t);
+       label = gtk_label_new(temp_str);
+       g_free(temp_str);
+-      gtk_table_attach(GTK_TABLE(table), label, 1,3,table_row,table_row+1, 0, 0, X_PADDING, Y_PADDING);
++      gtk_grid_attach(GTK_GRID(table), label, 1, table_row, 2, 1);
+       table_row++;
+     }
+ 
+     /* warning for multiple gates */
+     if (AMITK_DATA_SET_VIEW_START_GATE(draw_on_ds) != AMITK_DATA_SET_VIEW_END_GATE(draw_on_ds)) {
+-      image = gtk_image_new_from_stock(GTK_STOCK_DIALOG_WARNING,GTK_ICON_SIZE_DIALOG);
+-      gtk_table_attach(GTK_TABLE(table), image, 0,1, table_row,table_row+1, X_PACKING_OPTIONS, 0, X_PADDING, Y_PADDING);
++      image = gtk_image_new_from_icon_name("dialog-warning", GTK_ICON_SIZE_DIALOG);
++      gtk_grid_attach(GTK_GRID(table), image, 0, table_row, 1, 1);
+ 
+       temp_str = g_strdup_printf(_("Multiple gates are currently being shown from: %s\nThe isocontour will only be drawn over gate %d"),AMITK_OBJECT_NAME(draw_on_ds), temp_voxel.g);
+       label = gtk_label_new(temp_str);
+       g_free(temp_str);
+-      gtk_table_attach(GTK_TABLE(table), label, 1,3, table_row,table_row+1, 0, 0, X_PADDING, Y_PADDING);
++      gtk_grid_attach(GTK_GRID(table), label, 1, table_row, 2, 1);
+       table_row++;
+     }
+   }
+ 
+-  image = gtk_image_new_from_stock(GTK_STOCK_DIALOG_QUESTION,GTK_ICON_SIZE_DIALOG);
+-  gtk_table_attach(GTK_TABLE(table), image, 0,1, table_row,table_row+2, X_PACKING_OPTIONS, 0, X_PADDING, Y_PADDING);
++  image = gtk_image_new_from_icon_name("dialog-question", GTK_ICON_SIZE_DIALOG);
++  gtk_grid_attach(GTK_GRID(table), image, 0, table_row, 1, 2);
+ 
+   /* box where the radio buttons will go */
+-  hbox = gtk_hbox_new(FALSE, 0);
+-  gtk_table_attach(GTK_TABLE(table), hbox,1,3,
+-		   table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++  hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
++  gtk_grid_attach(GTK_GRID(table), hbox, 1, table_row, 3, 1);
+   gtk_widget_show(hbox);
+   table_row++;
+ 
+ 
+   /* the spin buttons */
+   label = gtk_label_new(_("Min:"));
+-  gtk_table_attach(GTK_TABLE(table), label, 1,2, table_row,table_row+1, 0, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), label, 1, table_row, 1, 1);
+ 
+   min_spin_button = gtk_spin_button_new_with_range(-G_MAXDOUBLE, isocontour_min_value, MAX(EPSILON,fabs(isocontour_min_value)/10));
+   gtk_spin_button_set_value(GTK_SPIN_BUTTON(min_spin_button), isocontour_min_value);
+@@ -968,12 +976,12 @@
+   gtk_entry_set_activates_default(GTK_ENTRY(min_spin_button), TRUE);
+   g_signal_connect(G_OBJECT(min_spin_button), "value_changed",  G_CALLBACK(value_spin_cb), &isocontour_min_value);
+   g_signal_connect(G_OBJECT(min_spin_button), "output", G_CALLBACK(amitk_spin_button_scientific_output), NULL);
+-  gtk_table_attach(GTK_TABLE(table), min_spin_button, 2,3, table_row,table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), min_spin_button, 2, table_row, 2, 1);
+   table_row++;
+ 
+ 
+   label = gtk_label_new(_("Max:"));
+-  gtk_table_attach(GTK_TABLE(table), label, 1,2, table_row,table_row+1, 0, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), label, 1, table_row, 1, 1);
+ 
+   max_spin_button = gtk_spin_button_new_with_range(isocontour_max_value, G_MAXDOUBLE, MAX(EPSILON,fabs(isocontour_max_value)/10));
+   gtk_spin_button_set_value(GTK_SPIN_BUTTON(max_spin_button), isocontour_max_value);
+@@ -984,7 +992,7 @@
+   gtk_entry_set_activates_default(GTK_ENTRY(max_spin_button), TRUE);
+   g_signal_connect(G_OBJECT(max_spin_button), "value_changed",  G_CALLBACK(value_spin_cb), &isocontour_max_value);
+   g_signal_connect(G_OBJECT(max_spin_button), "output", G_CALLBACK(amitk_spin_button_scientific_output), NULL);
+-  gtk_table_attach(GTK_TABLE(table), max_spin_button, 2,3, table_row,table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), max_spin_button, 2, table_row, 2, 1);
+   table_row++;
+ 
+   /* appropriately gray them out */
+@@ -998,7 +1006,7 @@
+   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio_button[isocontour_range]), TRUE);
+ 
+   for (i_range=0; i_range < AMITK_ROI_ISOCONTOUR_RANGE_NUM; i_range++) {
+-    gtk_box_pack_start(GTK_BOX(hbox), radio_button[i_range], FALSE, FALSE, 3);
++    gtk_box_pack_start(GTK_BOX(hbox), radio_button[i_range], TRUE, TRUE, 3);
+     g_object_set_data(G_OBJECT(radio_button[i_range]), "isocontour_range", 
+ 		      GINT_TO_POINTER(i_range));
+     g_object_set_data(G_OBJECT(radio_button[i_range]), "min_spin_button", min_spin_button);
+@@ -1091,18 +1099,21 @@
+   dialog = gtk_dialog_new_with_buttons (_("Freehand ROI Parameters"),
+ 					window,
+ 					GTK_DIALOG_DESTROY_WITH_PARENT,
+-					GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, 
+-					GTK_STOCK_OK, GTK_RESPONSE_OK, 
++					_("_Cancel"), GTK_RESPONSE_CANCEL,
++					_("_OK"), GTK_RESPONSE_OK,
+ 					NULL);
+   gtk_container_set_border_width(GTK_CONTAINER(dialog), 10);
+   gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_OK);
+ 
+-  table = gtk_table_new(4,3,FALSE);
++  table = gtk_grid_new();
++  gtk_grid_set_row_spacing(GTK_GRID(table), Y_PADDING);
++  gtk_grid_set_column_spacing(GTK_GRID(table), X_PADDING);
+   table_row=0;
+-  gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), table);
++  gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area
++                                  (GTK_DIALOG(dialog))), table);
+ 
+-  image = gtk_image_new_from_stock(GTK_STOCK_DIALOG_QUESTION,GTK_ICON_SIZE_DIALOG);
+-  gtk_table_attach(GTK_TABLE(table), image, 0,1, table_row,table_row+2, X_PACKING_OPTIONS, 0, X_PADDING, Y_PADDING);
++  image = gtk_image_new_from_icon_name("dialog-question", GTK_ICON_SIZE_DIALOG);
++  gtk_grid_attach(GTK_GRID(table), image, 0, table_row, 1, 2);
+ 
+   /* the spin buttons */
+   for (i_axis=0; i_axis<AMITK_AXIS_NUM; i_axis++) {
+@@ -1110,7 +1121,7 @@
+     temp_str = g_strdup_printf(_("Voxel Size %s"), amitk_axis_get_name(i_axis));
+     label = gtk_label_new(temp_str);
+     g_free(temp_str);
+-    gtk_table_attach(GTK_TABLE(table), label, 1,2, table_row,table_row+1, 0, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(table), label, 1, table_row, 1, 1);
+ 
+     spin_button[i_axis] = gtk_spin_button_new_with_range(point_get_component(voxel_size, i_axis)/2,
+ 							 point_get_component(voxel_size, i_axis)*3,
+@@ -1121,7 +1132,7 @@
+     gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(spin_button[i_axis]), FALSE);
+     gtk_spin_button_set_update_policy(GTK_SPIN_BUTTON(spin_button[i_axis]), GTK_UPDATE_ALWAYS);
+     gtk_entry_set_activates_default(GTK_ENTRY(spin_button[i_axis]), TRUE);
+-    gtk_table_attach(GTK_TABLE(table), spin_button[i_axis], 2,3, table_row,table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(table), spin_button[i_axis], 2, table_row, 1, 1);
+     table_row++;
+   }
+ 
+@@ -1158,11 +1169,11 @@
+ 
+ 
+ /* function called when an event occurs on the canvas */
+-static gboolean canvas_event_cb(GtkWidget* widget,  GdkEvent * event, gpointer data) {
++static gboolean canvas_event_cb(GooCanvasItem * item, GooCanvasItem * target, GdkEvent * event, gpointer data) {
+ 
+   AmitkCanvas * canvas = data;
+   AmitkPoint base_point, canvas_point, diff_point;
+-  AmitkCanvasPoint canvas_cpoint, diff_cpoint, event_cpoint;
++  AmitkCanvasPoint canvas_cpoint, diff_cpoint;
+   rgba_t outline_color;
+   //  GnomeCanvasPoints * points;
+   canvas_event_t canvas_event_type;
+@@ -1177,7 +1188,8 @@
+   amide_data_t voxel_value;
+   AmitkHelpInfo help_info;
+   ui_common_cursor_t cursor_type;
+-  static GnomeCanvasItem * canvas_item = NULL;
++  GooCanvasItem * root;
++  static GooCanvasItem * canvas_item = NULL;
+   static gboolean grab_on = FALSE;
+   static canvas_event_t extended_event_type = CANVAS_EVENT_NONE;
+   static AmitkObject * extended_object= NULL;
+@@ -1233,7 +1245,7 @@
+     object = canvas->undrawn_rois->data;
+   
+   if (object == NULL) /* no undrawn roi's, see if we're on an object */
+-    object = g_object_get_data(G_OBJECT(widget), "object");
++    object = g_object_get_data(G_OBJECT(item), "object");
+   
+   if (object == NULL) 
+     object = canvas->active_object; /* try the active object */
+@@ -1244,8 +1256,8 @@
+   switch(event->type) {
+ 
+   case GDK_ENTER_NOTIFY:
+-    event_cpoint.x = event->crossing.x;
+-    event_cpoint.y = event->crossing.y;
++    canvas_cpoint.x = event->crossing.x_root;
++    canvas_cpoint.y = event->crossing.y_root;
+ 
+     if (event->crossing.mode != GDK_CROSSING_NORMAL) 
+       canvas_event_type = CANVAS_EVENT_NONE; /* ignore grabs */
+@@ -1262,8 +1274,8 @@
+     break;
+     
+   case GDK_LEAVE_NOTIFY:
+-    event_cpoint.x = event->crossing.x;
+-    event_cpoint.y = event->crossing.y;
++    canvas_cpoint.x = event->crossing.x_root;
++    canvas_cpoint.y = event->crossing.y_root;
+     if (event->crossing.mode != GDK_CROSSING_NORMAL)
+       canvas_event_type = CANVAS_EVENT_NONE; /* ignore grabs */
+     else if (extended_event_type != CANVAS_EVENT_NONE)
+@@ -1273,8 +1285,8 @@
+     break;
+ 
+   case GDK_BUTTON_PRESS:
+-    event_cpoint.x = event->button.x;
+-    event_cpoint.y = event->button.y;
++    canvas_cpoint.x = event->button.x_root;
++    canvas_cpoint.y = event->button.y_root;
+ 
+     if (enter_drawing_mode) {
+       canvas_event_type = CANVAS_EVENT_PRESS_ENTER_DRAWING_MODE;
+@@ -1350,8 +1362,8 @@
+     break;
+     
+   case GDK_MOTION_NOTIFY:
+-    event_cpoint.x = event->motion.x;
+-    event_cpoint.y = event->motion.y;
++    canvas_cpoint.x = event->motion.x_root;
++    canvas_cpoint.y = event->motion.y_root;
+ 
+     if (grab_on && (canvas->undrawn_rois != NULL))  {
+       canvas_event_type = CANVAS_EVENT_MOTION_NEW_ROI;
+@@ -1424,8 +1436,8 @@
+     break;
+     
+   case GDK_BUTTON_RELEASE:
+-    event_cpoint.x = event->button.x;
+-    event_cpoint.y = event->button.y;
++    canvas_cpoint.x = event->button.x_root;
++    canvas_cpoint.y = event->button.y_root;
+ 
+     if (canvas->undrawn_rois != NULL) {
+       canvas_event_type = CANVAS_EVENT_RELEASE_NEW_ROI;
+@@ -1522,7 +1534,7 @@
+     break;
+ 
+   case GDK_SCROLL: /* scroll wheel event */
+-    event_cpoint.x = event_cpoint.y = 0;
++    canvas_cpoint.x = canvas_cpoint.y = 0;
+     if (event->scroll.direction == GDK_SCROLL_UP)
+       canvas_event_type = CANVAS_EVENT_SCROLL_UP;
+     else if (event->scroll.direction == GDK_SCROLL_DOWN)
+@@ -1532,7 +1544,7 @@
+     break;
+     
+   default: 
+-    event_cpoint.x = event_cpoint.y = 0;
++    canvas_cpoint.x = canvas_cpoint.y = 0;
+     /* an event we don't handle */
+     canvas_event_type = CANVAS_EVENT_NONE;
+     break;
+@@ -1545,9 +1557,7 @@
+   //    g_print("%s event %d grab %d gdk %d in_object %d\n", AMITK_IS_OBJECT(object) ? AMITK_OBJECT_NAME(object) : "line_profile", 
+   //	    canvas_event_type, grab_on, event->type, in_object);
+ 
+-  /* get the location of the event, and convert it to the canvas coordinates */
+-  gnome_canvas_window_to_world(GNOME_CANVAS(canvas->canvas), event_cpoint.x, event_cpoint.y, &canvas_cpoint.x, &canvas_cpoint.y);
+-  gnome_canvas_w2c_d(GNOME_CANVAS(canvas->canvas), canvas_cpoint.x, canvas_cpoint.y, &canvas_cpoint.x, &canvas_cpoint.y);
++  root = goo_canvas_get_root_item(GOO_CANVAS(canvas->canvas));
+ 
+   /* Convert the event location info to real units */
+   canvas_point = cp_2_p(canvas, canvas_cpoint);
+@@ -1666,8 +1676,11 @@
+     initial_base_point = base_point;
+     canvas_update_target(canvas, AMITK_CANVAS_TARGET_ACTION_SHOW, base_point, corner);
+     /* grabbing the target doesn't quite work, double click events aren't handled correctly */
+-    gnome_canvas_item_grab(canvas->image, GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK |GDK_BUTTON_PRESS_MASK ,
+-    			   ui_common_cursor[UI_CURSOR_DATA_SET_MODE], event->button.time);
++    goo_canvas_pointer_grab(GOO_CANVAS(canvas->canvas), canvas->image,
++                            GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK
++                            | GDK_BUTTON_PRESS_MASK,
++                            ui_common_cursor[UI_CURSOR_DATA_SET_MODE],
++                            event->button.time);
+     g_signal_emit(G_OBJECT (canvas), canvas_signals[VIEW_CHANGING], 0, &base_point, corner);
+     break;
+ 
+@@ -1696,13 +1709,11 @@
+       initial_canvas_point = canvas_point;
+       previous_cpoint = canvas_cpoint;
+ 
+-      canvas_item = gnome_canvas_item_new(gnome_canvas_root(GNOME_CANVAS(canvas->canvas)),
+-					  gnome_canvas_pixbuf_get_type(),
+-					  "pixbuf",pixbuf,
+-					  "x", (double) canvas->border_width,
+-					  "y", (double) canvas->border_width,
+-					  NULL);
+-      g_signal_connect(G_OBJECT(canvas_item), "event", G_CALLBACK(canvas_event_cb), canvas);
++      canvas_item = goo_canvas_image_new(root, pixbuf,
++                                         (gdouble) canvas->border_width,
++                                         (gdouble) canvas->border_width,
++                                         NULL);
++      canvas_setup_handlers(canvas, canvas_item);
+       g_object_unref(pixbuf);
+     }
+ 
+@@ -1728,19 +1739,25 @@
+     case AMITK_ROI_TYPE_CYLINDER:
+       g_signal_emit(G_OBJECT (canvas), canvas_signals[HELP_EVENT], 0,
+ 		    AMITK_HELP_INFO_CANVAS_NEW_ROI, &base_point, 0.0);
+-      canvas_item = 
+-	gnome_canvas_item_new(gnome_canvas_root(GNOME_CANVAS(canvas->canvas)),
+-			      (AMITK_ROI_TYPE(object) == AMITK_ROI_TYPE_BOX) ?
+-			      gnome_canvas_rect_get_type() : gnome_canvas_ellipse_get_type(),
+-			      "x1",canvas_cpoint.x, "y1", canvas_cpoint.y, 
+-			      "x2", canvas_cpoint.x, "y2", canvas_cpoint.y,
+-			      "fill_color", NULL,
+-			      "outline_color_rgba", amitk_color_table_rgba_to_uint32(outline_color),
+-			      "width_pixels", AMITK_STUDY_CANVAS_ROI_WIDTH(canvas->study),
+-			      NULL);
+-      g_signal_connect(G_OBJECT(canvas_item), "event", G_CALLBACK(canvas_event_cb), canvas);
++      if (AMITK_ROI_TYPE(object) == AMITK_ROI_TYPE_BOX)
++        canvas_item =
++          goo_canvas_rect_new(root, canvas_cpoint.x, canvas_cpoint.y, 0, 0,
++                              "stroke-color-rgba",
++                              amitk_color_table_rgba_to_uint32(outline_color),
++                              "line-width",
++                              (gdouble) AMITK_STUDY_CANVAS_ROI_WIDTH(canvas->study),
++                              NULL);
++      else
++        canvas_item =
++          goo_canvas_ellipse_new(root, canvas_cpoint.x, canvas_cpoint.y, 0, 0,
++                                 "stroke-color-rgba",
++                                 amitk_color_table_rgba_to_uint32(outline_color),
++                                 "line-width",
++                                 (gdouble) AMITK_STUDY_CANVAS_ROI_WIDTH(canvas->study),
++                                 NULL);
++      canvas_setup_handlers(canvas, canvas_item);
+       grab_on = TRUE;
+-      gnome_canvas_item_grab(canvas_item,
++      goo_canvas_pointer_grab(GOO_CANVAS(canvas->canvas), canvas_item,
+ 			     GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK,
+ 			     ui_common_cursor[UI_CURSOR_ROI_MODE],
+ 			     event->button.time);
+@@ -1794,8 +1811,9 @@
+ 		  AMITK_HELP_INFO_UPDATE_LOCATION, &base_point, voxel_value);
+ 
+     grab_on = TRUE;
+-    canvas_item = GNOME_CANVAS_ITEM(widget); 
+-    gnome_canvas_item_grab(canvas_item, GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK, 
++    canvas_item = item;
++    goo_canvas_pointer_grab(GOO_CANVAS(canvas->canvas), canvas_item,
++                            GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK,
+ 			   ui_common_cursor[cursor_type], event->button.time);
+ 
+     initial_base_point = base_point;
+@@ -1899,8 +1917,8 @@
+   case CANVAS_EVENT_PRESS_ERASE_POINT:
+   case CANVAS_EVENT_PRESS_ERASE_LARGE_POINT:
+     grab_on = TRUE;
+-    canvas_item = GNOME_CANVAS_ITEM(widget);
+-    gnome_canvas_item_grab(canvas_item,
++    canvas_item = item;
++    goo_canvas_pointer_grab(GOO_CANVAS(canvas->canvas), canvas_item,
+     			   GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK,
+     			   ui_common_cursor[UI_CURSOR_ROI_DRAW], event->button.time);
+     /* and fall through */
+@@ -1947,8 +1965,12 @@
+ 	temp_cpoint[0] = canvas_point_sub(initial_cpoint, diff_cpoint);
+ 	temp_cpoint[1] = canvas_point_add(initial_cpoint, diff_cpoint);
+       }
+-      gnome_canvas_item_set(canvas_item, "x1", temp_cpoint[0].x, "y1", temp_cpoint[0].y,
+-			    "x2", temp_cpoint[1].x, "y2", temp_cpoint[1].y,NULL);
++      /* Using fabs is probably wrong here but occasionally there are
++         some warnings for invalid width/height.  I couldn't find a
++         reliable way to reproduce this...  */
++      g_object_set(canvas_item, "x", temp_cpoint[0].x, "y", temp_cpoint[0].y,
++                   "width", fabs(temp_cpoint[1].x - temp_cpoint[0].x),
++                   "height", fabs(temp_cpoint[1].y - temp_cpoint[0].y), NULL);
+       break;
+     case AMITK_ROI_TYPE_ISOCONTOUR_2D:
+     case AMITK_ROI_TYPE_ISOCONTOUR_3D:
+@@ -1977,8 +1999,10 @@
+ 		    AMITK_HELP_INFO_UPDATE_LOCATION, &base_point, voxel_value);
+ 
+     diff_cpoint = canvas_point_sub(canvas_cpoint, previous_cpoint);
+-    gnome_canvas_item_i2w(canvas_item->parent, &diff_cpoint.x, &diff_cpoint.y);
+-    gnome_canvas_item_move(canvas_item,diff_cpoint.x,diff_cpoint.y); 
++    goo_canvas_convert_from_item_space(GOO_CANVAS(canvas->canvas),
++                                       goo_canvas_item_get_parent(canvas_item),
++                                       &diff_cpoint.x, &diff_cpoint.y);
++    goo_canvas_item_translate(canvas_item, diff_cpoint.x, diff_cpoint.y);
+     previous_cpoint = canvas_cpoint;
+     break;
+ 
+@@ -1990,6 +2014,7 @@
+ 	 but this isn't defined in the current version of gnome.... 
+ 	 so I'll have to do a whole bunch of shit*/
+       double affine[6];
++      cairo_matrix_t matrix;
+       AmitkCanvasPoint item_center;
+       AmitkPoint center;
+       
+@@ -2016,7 +2041,9 @@
+       affine[3] = affine[0];
+       affine[4] = (1.0-affine[0])*item_center.x+affine[1]*item_center.y;
+       affine[5] = (1.0-affine[3])*item_center.y+affine[2]*item_center.x;
+-      gnome_canvas_item_affine_absolute(canvas_item,affine);
++      cairo_matrix_init(&matrix, affine[0], affine[1], affine[2],
++                        affine[3], affine[4], affine[5]);
++      goo_canvas_item_set_transform(canvas_item, &matrix);
+     }
+     g_signal_emit(G_OBJECT (canvas), canvas_signals[HELP_EVENT], 0,
+ 		  AMITK_HELP_INFO_UPDATE_THETA, &base_point, theta*180.0/M_PI);
+@@ -2034,6 +2061,7 @@
+       /* also, this "zoom" strategy doesn't always work if the object is not
+ 	 aligned with the view.... oh well... good enough for now... */
+       double affine[6];
++      cairo_matrix_t matrix;
+       AmitkCanvasPoint item_center;
+       amide_real_t jump_limit, max, temp, dot;
+       double cos_r, sin_r, rot;
+@@ -2149,7 +2177,9 @@
+ 	- item_center.x*canvas_zoom.y*sin_r*sin_r + (canvas_zoom.y-canvas_zoom.x)*item_center.y*cos_r*sin_r;
+       affine[5] = item_center.y - item_center.y*canvas_zoom.y*cos_r*cos_r 
+ 	- item_center.y*canvas_zoom.x*sin_r*sin_r + (canvas_zoom.y-canvas_zoom.x)*item_center.x*cos_r*sin_r;
+-      gnome_canvas_item_affine_absolute(canvas_item,affine);
++      cairo_matrix_init(&matrix, affine[0], affine[1], affine[2],
++                        affine[3], affine[4], affine[5]);
++      goo_canvas_item_set_transform(canvas_item, &matrix);
+     }
+     break;
+ 
+@@ -2159,7 +2189,8 @@
+     g_signal_emit(G_OBJECT (canvas), canvas_signals[HELP_EVENT], 0,
+ 		  AMITK_HELP_INFO_UPDATE_LOCATION, &base_point, voxel_value);
+     grab_on = FALSE;
+-    gnome_canvas_item_ungrab(canvas->image, event->button.time);
++    goo_canvas_pointer_ungrab(GOO_CANVAS(canvas->canvas), canvas->image,
++                              event->button.time);
+     /* queue target cross redraw */
+     amitk_canvas_update_target(canvas, AMITK_CANVAS_TARGET_ACTION_HIDE, base_point, 0.0);
+ 
+@@ -2197,7 +2228,7 @@
+     g_signal_emit(G_OBJECT (canvas), canvas_signals[HELP_EVENT], 0,help_info, &base_point, 0.0);
+     extended_event_type = CANVAS_EVENT_NONE;
+     extended_object = NULL;
+-    gtk_object_destroy(GTK_OBJECT(canvas_item));
++    goo_canvas_item_remove(canvas_item);
+     break;
+ 
+   case CANVAS_EVENT_CANCEL_CHANGE_ISOCONTOUR:
+@@ -2214,7 +2245,7 @@
+     else /* DATA_SET */
+       help_info = AMITK_HELP_INFO_CANVAS_DATA_SET;
+     g_signal_emit(G_OBJECT (canvas), canvas_signals[HELP_EVENT], 0,help_info, &base_point, 0.0);
+-    gtk_object_destroy(GTK_OBJECT(canvas_item));
++    goo_canvas_item_remove(canvas_item);
+     extended_event_type = CANVAS_EVENT_NONE;
+     extended_object = NULL;
+ 
+@@ -2257,12 +2288,13 @@
+     case AMITK_ROI_TYPE_CYLINDER:
+     case AMITK_ROI_TYPE_BOX:
+     case AMITK_ROI_TYPE_ELLIPSOID:  
+-      gnome_canvas_item_ungrab(canvas_item, event->button.time);
++      goo_canvas_pointer_ungrab(GOO_CANVAS(canvas->canvas), canvas_item,
++                                event->button.time);
+ 
+       diff_point = point_diff(initial_canvas_point, canvas_point);
+       diff_point.z = canvas_check_z_dimension(canvas, AMITK_VOLUME_Z_CORNER(canvas->volume));
+       diff_point.z /= 2;
+-      gtk_object_destroy(GTK_OBJECT(canvas_item)); /* get rid of the roi drawn on the canvas */
++      goo_canvas_item_remove(canvas_item); /* get rid of the roi drawn on the canvas */
+       
+ 
+       if (event->button.button == 1) { /* edge to edge */
+@@ -2323,7 +2355,8 @@
+ 
+ 
+   case CANVAS_EVENT_RELEASE_SHIFT_OBJECT_IMMEDIATE:
+-    gnome_canvas_item_ungrab(GNOME_CANVAS_ITEM(widget), event->button.time);
++    goo_canvas_pointer_ungrab(GOO_CANVAS(canvas->canvas), item,
++                              event->button.time);
+     grab_on = FALSE;
+     shift = point_sub(base_point, initial_base_point);
+     
+@@ -2350,7 +2383,8 @@
+ 
+ 
+   case CANVAS_EVENT_RELEASE_ROTATE_OBJECT_IMMEDIATE:
+-    gnome_canvas_item_ungrab(GNOME_CANVAS_ITEM(widget), event->button.time);
++    goo_canvas_pointer_ungrab(GOO_CANVAS(canvas->canvas), item,
++                              event->button.time);
+     grab_on = FALSE;
+     if (canvas->view == AMITK_VIEW_SAGITTAL) theta = -theta; /* sagittal is a left-handed coord frame */
+     
+@@ -2368,7 +2402,8 @@
+ 
+ 
+   case CANVAS_EVENT_RELEASE_RESIZE_ROI:
+-    gnome_canvas_item_ungrab(GNOME_CANVAS_ITEM(widget), event->button.time);
++    goo_canvas_pointer_ungrab(GOO_CANVAS(canvas->canvas), item,
++                              event->button.time);
+     grab_on = FALSE;
+     
+     radius_point = point_cmult(0.5,AMITK_VOLUME_CORNER(object));
+@@ -2385,7 +2420,8 @@
+   case CANVAS_EVENT_RELEASE_DRAW_LARGE_POINT:
+   case CANVAS_EVENT_RELEASE_ERASE_POINT:
+   case CANVAS_EVENT_RELEASE_ERASE_LARGE_POINT:
+-    gnome_canvas_item_ungrab(GNOME_CANVAS_ITEM(widget), event->button.time);
++    goo_canvas_pointer_ungrab(GOO_CANVAS(canvas->canvas), item,
++                              event->button.time);
+     grab_on = FALSE;
+     break;
+ 
+@@ -2416,14 +2452,28 @@
+ }
+ 
+ 
++static void canvas_setup_handlers(AmitkCanvas * canvas, GooCanvasItem * item) {
+ 
++  g_signal_connect(item, "button-press-event",
++                   G_CALLBACK(canvas_event_cb), canvas);
++  g_signal_connect(item, "button-release-event",
++                   G_CALLBACK(canvas_event_cb), canvas);
++  g_signal_connect(item, "enter-notify-event",
++                   G_CALLBACK(canvas_event_cb), canvas);
++  g_signal_connect(item, "leave-notify-event",
++                   G_CALLBACK(canvas_event_cb), canvas);
++  g_signal_connect(item, "motion-notify-event",
++                   G_CALLBACK(canvas_event_cb), canvas);
++  g_signal_connect(item, "scroll-event",
++                   G_CALLBACK(canvas_event_cb), canvas);
++}
+ 
+ 
+ 
+ 
+ 
+ /* function called indicating the plane adjustment has changed */
+-static void canvas_scrollbar_adjustment_cb(GtkObject * adjustment, gpointer data) {
++static void canvas_scrollbar_adjustment_cb(GtkAdjustment * adjustment, gpointer data) {
+ 
+   AmitkCanvas * canvas = data;
+   AmitkPoint canvas_center;
+@@ -2431,7 +2481,7 @@
+   g_return_if_fail(AMITK_IS_CANVAS(canvas));
+ 
+   canvas_center = amitk_space_b2s(AMITK_SPACE(canvas->volume), canvas->center);
+-  canvas_center.z = GTK_ADJUSTMENT(adjustment)->value;
++  canvas_center.z = gtk_adjustment_get_value(adjustment);
+   canvas->center = amitk_space_s2b(AMITK_SPACE(canvas->volume), canvas_center);
+ 
+   canvas_add_update(canvas, UPDATE_ALL);
+@@ -2529,17 +2579,13 @@
+   }
+   
+   
+-  GTK_ADJUSTMENT(canvas->scrollbar_adjustment)->upper = upper;
+-  GTK_ADJUSTMENT(canvas->scrollbar_adjustment)->lower = lower;
+-  GTK_ADJUSTMENT(canvas->scrollbar_adjustment)->step_increment = min_voxel_size;
+-  GTK_ADJUSTMENT(canvas->scrollbar_adjustment)->page_increment = (thickness/2.0 < min_voxel_size) ? min_voxel_size : thickness/2.0;
+-  GTK_ADJUSTMENT(canvas->scrollbar_adjustment)->page_size = 0;
+-  GTK_ADJUSTMENT(canvas->scrollbar_adjustment)->value = zp_start.z;
+-
+   /* allright, we need to update widgets connected to the adjustment without triggering our callback */
+   g_signal_handlers_block_by_func(G_OBJECT(canvas->scrollbar_adjustment),
+ 				   G_CALLBACK(canvas_scrollbar_adjustment_cb), canvas);
+-  gtk_adjustment_changed(GTK_ADJUSTMENT(canvas->scrollbar_adjustment));  
++  gtk_adjustment_configure(canvas->scrollbar_adjustment, zp_start.z,
++                           lower, upper, min_voxel_size,
++                           (thickness/2.0 < min_voxel_size)
++                           ? min_voxel_size : thickness/2.0, 0);
+   g_signal_handlers_unblock_by_func(G_OBJECT(canvas->scrollbar_adjustment), 
+ 				     G_CALLBACK(canvas_scrollbar_adjustment_cb), canvas);
+ 
+@@ -2551,7 +2597,8 @@
+ static void canvas_update_target(AmitkCanvas * canvas, AmitkCanvasTargetAction action, 
+ 				 AmitkPoint center, amide_real_t thickness) {
+ 
+-  GnomeCanvasPoints * points[8];
++  GooCanvasPoints * points[8];
++  GooCanvasItem * root;
+   AmitkCanvasPoint point0, point1;
+   AmitkPoint start, end;
+   gint i;
+@@ -2564,7 +2611,9 @@
+       ((action == AMITK_CANVAS_TARGET_ACTION_HIDE) && 
+        (!AMITK_STUDY_CANVAS_TARGET(canvas->study)))) {
+     for (i=0; i < 8 ; i++) 
+-      if (canvas->target[i] != NULL) gnome_canvas_item_hide(canvas->target[i]);
++      if (canvas->target[i] != NULL)
++        g_object_set(canvas->target[i], "visibility",
++                     GOO_CANVAS_ITEM_INVISIBLE, NULL);
+     return;
+   }
+   if (((action == AMITK_CANVAS_TARGET_ACTION_HIDE) && AMITK_STUDY_CANVAS_TARGET(canvas->study)) ||
+@@ -2590,28 +2639,28 @@
+   else
+     separation = 0.0;
+     
+-  points[0] = gnome_canvas_points_new(2);
++  points[0] = goo_canvas_points_new(2);
+   points[0]->coords[0] = (gdouble) canvas->border_width;
+   points[0]->coords[1] = point1.y;
+   points[0]->coords[2] = 
+     ((point0.x-separation) > canvas->border_width) ? (point0.x-separation) : canvas->border_width;
+   points[0]->coords[3] = point1.y;
+ 
+-  points[1] = gnome_canvas_points_new(2);
++  points[1] = goo_canvas_points_new(2);
+   points[1]->coords[0] = point0.x;
+   points[1]->coords[1] = 
+     ((point1.y-separation) > canvas->border_width) ? (point1.y-separation) : canvas->border_width;
+   points[1]->coords[2] = point0.x;
+   points[1]->coords[3] = (gdouble) canvas->border_width;
+     
+-  points[2] = gnome_canvas_points_new(2);
++  points[2] = goo_canvas_points_new(2);
+   points[2]->coords[0] = point1.x;
+   points[2]->coords[1] = (gdouble) canvas->border_width;
+   points[2]->coords[2] = point1.x;
+   points[2]->coords[3] =
+     ((point1.y-separation) > canvas->border_width) ? (point1.y-separation) : canvas->border_width;
+ 
+-  points[3] = gnome_canvas_points_new(2);
++  points[3] = goo_canvas_points_new(2);
+   points[3]->coords[0] = 
+     ((point1.x+separation) < canvas->pixbuf_width+canvas->border_width) ? 
+     (point1.x+separation) : canvas->pixbuf_width+canvas->border_width;
+@@ -2619,14 +2668,14 @@
+   points[3]->coords[2] = (gdouble) (canvas->pixbuf_width+canvas->border_width);
+   points[3]->coords[3] = point1.y;
+   
+-  points[4] = gnome_canvas_points_new(2);
++  points[4] = goo_canvas_points_new(2);
+   points[4]->coords[0] = (gdouble) canvas->border_width;
+   points[4]->coords[1] = point0.y;
+   points[4]->coords[2] = 
+     ((point0.x-separation) > canvas->border_width) ? (point0.x-separation) : canvas->border_width;
+   points[4]->coords[3] = point0.y;
+ 
+-  points[5] = gnome_canvas_points_new(2);
++  points[5] = goo_canvas_points_new(2);
+   points[5]->coords[0] = point0.x;
+   points[5]->coords[1] = 
+     ((point0.y+separation) < canvas->pixbuf_height+canvas->border_width) ? 
+@@ -2634,7 +2683,7 @@
+   points[5]->coords[2] = point0.x;
+   points[5]->coords[3] = (gdouble) (canvas->pixbuf_height+canvas->border_width);
+   
+-  points[6] = gnome_canvas_points_new(2);
++  points[6] = goo_canvas_points_new(2);
+   points[6]->coords[0] = point1.x;
+   points[6]->coords[1] = (gdouble) (canvas->pixbuf_height+canvas->border_width);
+   points[6]->coords[2] = point1.x;
+@@ -2642,7 +2691,7 @@
+     ((point0.y+separation) < canvas->pixbuf_height+canvas->border_width) ? 
+     (point0.y+separation) : canvas->pixbuf_height+canvas->border_width;
+ 
+-  points[7] = gnome_canvas_points_new(2);
++  points[7] = goo_canvas_points_new(2);
+   points[7]->coords[0] = 
+     ((point1.x+separation) < canvas->pixbuf_width+canvas->border_width) ? 
+     (point1.x+separation) : canvas->pixbuf_width+canvas->border_width;
+@@ -2650,24 +2699,26 @@
+   points[7]->coords[2] = (gdouble) (canvas->pixbuf_width+canvas->border_width);
+   points[7]->coords[3] = point0.y;
+ 
++  root = goo_canvas_get_root_item(GOO_CANVAS(canvas->canvas));
+   for (i=0; i<8; i++) {
+     if (canvas->target[i]==NULL) {
+       canvas->target[i] =
+-	gnome_canvas_item_new(gnome_canvas_root(GNOME_CANVAS(canvas->canvas)),
+-			      gnome_canvas_line_get_type(),
+-			      "points", points[i], 
+-			      "fill_color_rgba", amitk_color_table_rgba_to_uint32(color),
+-			      "width_pixels", 1, NULL);
+-      g_signal_connect(G_OBJECT(canvas->target[i]), "event", G_CALLBACK(canvas_event_cb), canvas);
++        goo_canvas_polyline_new(root, FALSE, 0, "points", points[i],
++                                "stroke-color-rgba",
++                                amitk_color_table_rgba_to_uint32(color),
++                                "line-width", 1.0, NULL);
++      canvas_setup_handlers(canvas, canvas->target[i]);
+     } else if (action == AMITK_CANVAS_TARGET_ACTION_SHOW)
+-      gnome_canvas_item_set(canvas->target[i],"points",points[i], 
+-			    "fill_color_rgba", amitk_color_table_rgba_to_uint32(color),
+-			    "width_pixels", 1, NULL);
++      g_object_set(canvas->target[i], "points", points[i],
++                   "stroke-color-rgba", amitk_color_table_rgba_to_uint32(color),
++                   "line-width", 1.0, NULL);
+     else 
+-      gnome_canvas_item_set(canvas->target[i],"points",points[i], 
+-			    "fill_color_rgba", amitk_color_table_rgba_to_uint32(color), NULL);
+-    gnome_canvas_item_show(canvas->target[i]);
+-    gnome_canvas_points_unref(points[i]);
++      g_object_set(canvas->target[i], "points", points[i],
++                   "stroke-color-rgba", amitk_color_table_rgba_to_uint32(color),
++                   NULL);
++    g_object_set(canvas->target[i], "visibility", GOO_CANVAS_ITEM_VISIBLE,
++                 NULL);
++    goo_canvas_points_unref(points[i]);
+   }
+ 
+   return;
+@@ -2679,7 +2730,8 @@
+ /* function to update the arrows on the canvas */
+ static void canvas_update_arrows(AmitkCanvas * canvas) {
+ 
+-  GnomeCanvasPoints * points[4];
++  GooCanvasPoints * points[4];
++  GooCanvasItem * root;
+   AmitkCanvasPoint point0, point1;
+   AmitkPoint start, end;
+   gint i;
+@@ -2691,7 +2743,8 @@
+   if (canvas->slices == NULL) {
+     for (i=0; i<4; i++)
+       if (canvas->arrows[i] != NULL)
+-	gnome_canvas_item_hide(canvas->arrows[i]);
++        g_object_set(canvas->arrows[i], "visibility",
++                     GOO_CANVAS_ITEM_INVISIBLE, NULL);
+     return;
+   }
+ 
+@@ -2714,7 +2767,7 @@
+      3) X's origin is top left, ours is bottom left
+   */
+   /* left arrow */
+-  points[0] = gnome_canvas_points_new(4);
++  points[0] = goo_canvas_points_new(4);
+   points[0]->coords[0] = DEFAULT_CANVAS_BORDER_WIDTH-DEFAULT_CANVAS_TRIANGLE_SEPARATION;
+   points[0]->coords[1] = point1.y;
+   points[0]->coords[2] = points[0]->coords[0];
+@@ -2725,7 +2778,7 @@
+   points[0]->coords[7] = point1.y - DEFAULT_CANVAS_TRIANGLE_WIDTH/2.0;
+ 
+   /* top arrow */
+-  points[1] = gnome_canvas_points_new(4);
++  points[1] = goo_canvas_points_new(4);
+   points[1]->coords[0] = point0.x;
+   points[1]->coords[1] = DEFAULT_CANVAS_BORDER_WIDTH-DEFAULT_CANVAS_TRIANGLE_SEPARATION;
+   points[1]->coords[2] = point1.x;
+@@ -2736,7 +2789,7 @@
+   points[1]->coords[7] = DEFAULT_CANVAS_TRIANGLE_BORDER;
+ 
+   /* right arrow */
+-  points[2] = gnome_canvas_points_new(4);
++  points[2] = goo_canvas_points_new(4);
+   points[2]->coords[0] = DEFAULT_CANVAS_BORDER_WIDTH + DEFAULT_CANVAS_TRIANGLE_SEPARATION + canvas->pixbuf_width;
+   points[2]->coords[1] = point1.y;
+   points[2]->coords[2] = points[2]->coords[0];
+@@ -2747,7 +2800,7 @@
+   points[2]->coords[7] = point1.y - DEFAULT_CANVAS_TRIANGLE_WIDTH/2;
+ 
+   /* bottom arrow */
+-  points[3] = gnome_canvas_points_new(4);
++  points[3] = goo_canvas_points_new(4);
+   points[3]->coords[0] = point0.x;
+   points[3]->coords[1] = DEFAULT_CANVAS_BORDER_WIDTH + DEFAULT_CANVAS_TRIANGLE_SEPARATION + canvas->pixbuf_height;
+   points[3]->coords[2] = point1.x;
+@@ -2758,18 +2811,19 @@
+   points[3]->coords[7] = points[3]->coords[5];
+ 
+ 
++  root = goo_canvas_get_root_item(GOO_CANVAS(canvas->canvas));
+   for (i=0; i<4; i++) {
+     if (canvas->arrows[i] != NULL ) 
+-      gnome_canvas_item_set(canvas->arrows[i],"points",points[i], NULL);
++      g_object_set(canvas->arrows[i], "points", points[i], NULL);
+     else 
+       canvas->arrows[i] =
+-	gnome_canvas_item_new(gnome_canvas_root(GNOME_CANVAS(canvas->canvas)),
+-			      gnome_canvas_polygon_get_type(),
+-			      "points", points[i],"fill_color", "white",
+-			      "outline_color", "black", "width_pixels", 2,
+-			      NULL);
+-    gnome_canvas_item_show(canvas->arrows[i]);
+-    gnome_canvas_points_unref(points[i]);
++        goo_canvas_polyline_new(root, TRUE, 0, "fill-color", "white",
++                                "stroke-color", "black",
++                                "points", points[i], "line-width", 2.0,
++                                NULL);
++    g_object_set(canvas->arrows[i], "visibility",
++                 GOO_CANVAS_ITEM_VISIBLE, NULL);
++    goo_canvas_points_unref(points[i]);
+   }
+ 
+   return;
+@@ -2779,19 +2833,16 @@
+ /* function to update the line profile on the canvas */
+ static void canvas_update_line_profile(AmitkCanvas * canvas) {
+ 
+-  GnomeCanvasPoints * points;
++  GooCanvasPoints * points;
++  GooCanvasItem * root;
+   AmitkCanvasPoint point0, point1;
+   AmitkPoint start, end;
+   amide_real_t temp;
+   amide_real_t profile_angle;
+-  gint roi_width;
+-#ifndef AMIDE_LIBGNOMECANVAS_AA
+-  GdkLineStyle line_style;
+-#endif
++  gdouble roi_width;
+   guint32 fill_color_rgba;
+   rgba_t outline_color;
+   AmitkLineProfile * line_profile;
+-  gdouble affine[6];
+   AmitkPoint initial;
+   
+ 
+@@ -2807,7 +2858,8 @@
+     time */
+ 
+     if (canvas->line_profile_item != NULL)
+-      gnome_canvas_item_hide(canvas->line_profile_item);
++      g_object_set(canvas->line_profile_item, "visibility",
++                   GOO_CANVAS_ITEM_INVISIBLE, NULL);
+     return;
+   }
+ 
+@@ -2880,7 +2932,7 @@
+   amitk_line_profile_set_end_point(AMITK_STUDY_LINE_PROFILE(canvas->study), end);
+ 
+   /* calculate the line */
+-  points = gnome_canvas_points_new(2);
++  points = goo_canvas_points_new(2);
+   points->coords[0] = point0.x;
+   points->coords[1] = point0.y;
+   points->coords[2] = point1.x;
+@@ -2888,49 +2940,35 @@
+ 
+ 
+   roi_width = AMITK_STUDY_CANVAS_ROI_WIDTH(canvas->study);
+-#ifndef AMIDE_LIBGNOMECANVAS_AA
+-  line_style = AMITK_STUDY_CANVAS_LINE_STYLE(canvas->study);
+-#endif
+   outline_color = amitk_color_table_outline_color(canvas_get_color_table(canvas), TRUE);
+   fill_color_rgba = amitk_color_table_rgba_to_uint32(outline_color);
++  root = goo_canvas_get_root_item(GOO_CANVAS(canvas->canvas));
+ 
+   if (canvas->line_profile_item != NULL ) {
+     /* make sure to reset any affine translations we've done */
+-    gnome_canvas_item_i2w_affine(canvas->line_profile_item,affine);
+-    affine[0] = affine[3] = 1.0;
+-    affine[1] = affine[2] = affine[4] = affine[5] = 0.0;
+-    gnome_canvas_item_affine_absolute(canvas->line_profile_item,affine);
+-
+-    gnome_canvas_item_set(canvas->line_profile_item,
+-			  "points",points, 
+-			  "fill_color_rgba", fill_color_rgba,
+-			  "width_pixels", roi_width, 
+-#ifndef AMIDE_LIBGNOMECANVAS_AA
+-			  "line_style", line_style,  
+-#endif
+-			  NULL);
++    goo_canvas_item_set_transform(canvas->line_profile_item, NULL);
++
++    g_object_set(canvas->line_profile_item, "points", points,
++                 "stroke-color-rgba", fill_color_rgba,
++                 "line-width", roi_width, NULL);
+   } else {
+-    canvas->line_profile_item = 
+-      gnome_canvas_item_new(gnome_canvas_root(GNOME_CANVAS(canvas->canvas)),
+-			    gnome_canvas_line_get_type(),
+-			    "points", points,
+-			    "fill_color_rgba", fill_color_rgba,
+-			    "width_pixels", roi_width,
+-			    "last_arrowhead", TRUE,
+-			    "arrow_shape_a", (gdouble) 6.0,
+-			    "arrow_shape_b", (gdouble) 5.0,
+-			    "arrow_shape_c", (gdouble) 4.0,
+-#ifndef AMIDE_LIBGNOMECANVAS_AA
+-			    "line_style", line_style,
+-#endif
+-			    NULL);
++    canvas->line_profile_item =
++      goo_canvas_polyline_new(root, FALSE, 0, "points", points,
++                              "stroke-color-rgba", fill_color_rgba,
++                              "line-width", roi_width,
++                              "end-arrow", TRUE,
++                              "arrow-length", 6.0,
++                              "arrow-tip-length", 5.0,
++                              "arrow-width", 4.0,
++                              NULL);
+     g_object_set_data(G_OBJECT(canvas->line_profile_item), "object", line_profile);
+-    g_signal_connect(G_OBJECT(canvas->line_profile_item), "event", G_CALLBACK(canvas_event_cb), canvas);
++    canvas_setup_handlers(canvas, canvas->line_profile_item);
+   }
+ 
+   
+-  gnome_canvas_item_show(canvas->line_profile_item);
+-  gnome_canvas_points_unref(points);
++  g_object_set(canvas->line_profile_item, "visibility",
++               GOO_CANVAS_ITEM_VISIBLE, NULL);
++  goo_canvas_points_unref(points);
+ 
+   return;
+ }
+@@ -2939,6 +2977,7 @@
+ /* function to update the line profile on the canvas */
+ static void canvas_update_time_on_image(AmitkCanvas * canvas) {
+ 
++  GooCanvasItem * root;
+   amide_time_t midpt_time;
+   gint hours, minutes, seconds;
+   gchar * time_str;
+@@ -2957,24 +2996,20 @@
+     time_str = g_strdup_printf("%d:%.2d:%.2d",hours,minutes,seconds);
+ 
+     color = amitk_color_table_outline_color(canvas_get_color_table(canvas), FALSE);
++    root = goo_canvas_get_root_item(GOO_CANVAS(canvas->canvas));
+     if (canvas->time_label != NULL) 
+-      gnome_canvas_item_set(canvas->time_label,
+-			    "text", time_str,
+-			    "fill_color_rgba", color, NULL);
++      g_object_set(canvas->time_label, "text", time_str,
++                   "fill-color-rgba", color, NULL);
+     else
+-      canvas->time_label = 
+-	gnome_canvas_item_new(gnome_canvas_root(GNOME_CANVAS(canvas->canvas)),
+-			      gnome_canvas_text_get_type(),
+-			      "anchor", GTK_ANCHOR_SOUTH_WEST,
+-			      "text", time_str,
+-			      "x", 4.0,
+-			      "y", canvas->pixbuf_height-2.0,
+-			      "fill_color_rgba", color,
+-			      "font_desc", amitk_fixed_font_desc, NULL);
++      canvas->time_label =
++        goo_canvas_text_new(root, time_str, 4.0, canvas->pixbuf_height-2.0,
++                            -1, GOO_CANVAS_ANCHOR_SOUTH_WEST,
++                            "fill-color-rgba", color,
++                            "font-desc", amitk_fixed_font_desc, NULL);
+     g_free(time_str);
+   } else {
+     if (canvas->time_label != NULL) {
+-      gtk_object_destroy(GTK_OBJECT(canvas->time_label));
++      goo_canvas_item_remove(canvas->time_label);
+       canvas->time_label = NULL;
+     }
+   }
+@@ -2985,6 +3020,7 @@
+ 
+ static void canvas_update_subject_orientation(AmitkCanvas * canvas) {
+ 
++  GooCanvasItem * root;
+   gboolean remove = FALSE;
+   int i;
+   float x[4];
+@@ -3003,7 +3039,8 @@
+   if (remove) {
+     for (i=0; i<4; i++) 
+       if (canvas->orientation_label[i] != NULL)
+-	gnome_canvas_item_hide(canvas->orientation_label[i]);
++        g_object_set(canvas->orientation_label[i], "visibility",
++                     GOO_CANVAS_ITEM_INVISIBLE, NULL);
+ 
+   } else {
+ 
+@@ -3185,36 +3222,35 @@
+     /* text locations */
+     x[0] = 0;
+     y[0] = canvas->border_width;
+-    anchor[0] = GTK_ANCHOR_NORTH_WEST;
++    anchor[0] = GOO_CANVAS_ANCHOR_NORTH_WEST;
+ 
+     x[1] = 0;
+     y[1] = canvas->border_width + canvas->pixbuf_height;
+-    anchor[1] = GTK_ANCHOR_SOUTH_WEST;
++    anchor[1] = GOO_CANVAS_ANCHOR_SOUTH_WEST;
+     
+     x[2] = canvas->border_width;
+     y[2] = 2*canvas->border_width + canvas->pixbuf_height;
+-    anchor[2] = GTK_ANCHOR_SOUTH_WEST;
++    anchor[2] = GOO_CANVAS_ANCHOR_SOUTH_WEST;
+     
+     x[3] = canvas->border_width+canvas->pixbuf_width;
+     y[3] = 2*canvas->border_width + canvas->pixbuf_height;
+-    anchor[3] = GTK_ANCHOR_SOUTH_EAST;
++    anchor[3] = GOO_CANVAS_ANCHOR_SOUTH_EAST;
+ 
+     
++    root = goo_canvas_get_root_item(GOO_CANVAS(canvas->canvas));
+     for (i=0; i<4; i++) {
+       if (canvas->orientation_label[i] != NULL ) 
+-	gnome_canvas_item_set(canvas->orientation_label[i],"text", _(orientation_label[which_orientation[i]]), 
+-			      "x", x[i], "y", y[i], NULL);
++        g_object_set(canvas->orientation_label[i], "text",
++                     _(orientation_label[which_orientation[i]]),
++                     "x", x[i], "y", y[i], NULL);
+       else 
+-	canvas->orientation_label[i] = 
+-	  gnome_canvas_item_new(gnome_canvas_root(GNOME_CANVAS(canvas->canvas)),
+-				gnome_canvas_text_get_type(),
+-				"anchor", anchor[i],
+-				"text", _(orientation_label[which_orientation[i]]),
+-				"x", x[i],
+-				"y", y[i],
+-				"fill_color", "black",
+-				"font_desc", amitk_fixed_font_desc, NULL);
+-      gnome_canvas_item_show(canvas->orientation_label[i]);
++        canvas->orientation_label[i] =
++          goo_canvas_text_new(root, _(orientation_label[which_orientation[i]]),
++                              x[i], y[i], -1, anchor[i],
++                              "fill-color", "black",
++                              "font-desc", amitk_fixed_font_desc, NULL);
++      g_object_set(canvas->orientation_label[i], "visibility",
++                   GOO_CANVAS_ITEM_VISIBLE, NULL);
+     }
+   }
+ 
+@@ -3227,7 +3263,10 @@
+ 
+   gint old_width, old_height;
+   rgba_t blank_rgba;
+-  GtkStyle * widget_style;
++  GooCanvasItem * root;
++  GtkStyleContext * widget_style;
++  GtkWidget * toplevel;
++  GdkRGBA * rgba;
+   amide_real_t pixel_dim;
+   AmitkPoint corner;
+   gint width,height;
+@@ -3259,16 +3298,22 @@
+     /* just use a blank image */
+ 
+     /* figure out what color to use */
+-    widget_style = gtk_widget_get_style(GTK_WIDGET(canvas));
++    /* Obtain the style context from the toplevel widget because
++       canvas does not have background set.  */
++    toplevel = gtk_widget_get_toplevel(GTK_WIDGET(canvas));
++    widget_style = gtk_widget_get_style_context(toplevel);
+     if (widget_style == NULL) {
+       g_warning(_("Canvas has no style?\n"));
+-      widget_style = gtk_style_new();
++      widget_style = gtk_style_context_new();
+     }
+ 
+-    blank_rgba.r = widget_style->bg[GTK_STATE_NORMAL].red >> 8;
+-    blank_rgba.g = widget_style->bg[GTK_STATE_NORMAL].green >> 8;
+-    blank_rgba.b = widget_style->bg[GTK_STATE_NORMAL].blue >> 8;
++    gtk_style_context_get(widget_style, GTK_STATE_FLAG_NORMAL,
++                          GTK_STYLE_PROPERTY_BACKGROUND_COLOR, &rgba, NULL);
++    blank_rgba.r = (int) (0.5 + CLAMP(rgba->red, 0., 1.) * 255.);
++    blank_rgba.g = (int) (0.5 + CLAMP(rgba->green, 0., 1.) * 255.);
++    blank_rgba.b = (int) (0.5 + CLAMP(rgba->blue, 0., 1.) * 255.);
+     blank_rgba.a = 0xFF;
++    gdk_rgba_free(rgba);
+ 
+     corner = AMITK_VOLUME_CORNER(canvas->volume);
+ 
+@@ -3312,21 +3357,20 @@
+       gtk_widget_set_size_request(canvas->canvas, 
+ 				  canvas->pixbuf_width + 2 * canvas->border_width, 
+ 				  canvas->pixbuf_height + 2 * canvas->border_width);
+-      gnome_canvas_set_scroll_region(GNOME_CANVAS(canvas->canvas), 0.0, 0.0, 
++
++      goo_canvas_set_bounds(GOO_CANVAS(canvas->canvas), 0.0, 0.0,
+ 				     canvas->pixbuf_width + 2 * canvas->border_width,
+ 				     canvas->pixbuf_height + 2 * canvas->border_width);
+     }
+     /* put the canvas rgb image on the canvas_image */
+     if (canvas->image == NULL) {/* time to make a new image */
+-      canvas->image = gnome_canvas_item_new(gnome_canvas_root(GNOME_CANVAS(canvas->canvas)),
+-					    gnome_canvas_pixbuf_get_type(),
+-					    "pixbuf", canvas->pixbuf,
+-					    "x", (double) canvas->border_width,
+-					    "y", (double) canvas->border_width,
+-					    NULL);
+-      g_signal_connect(G_OBJECT(canvas->image), "event", G_CALLBACK(canvas_event_cb), canvas);
++      root = goo_canvas_get_root_item(GOO_CANVAS(canvas->canvas));
++      canvas->image = goo_canvas_image_new(root, canvas->pixbuf,
++                                           canvas->border_width,
++                                           canvas->border_width, NULL);
++      canvas_setup_handlers(canvas, canvas->image);
+     } else {
+-      gnome_canvas_item_set(canvas->image, "pixbuf", canvas->pixbuf, NULL);
++      g_object_set(canvas->image, "pixbuf", canvas->pixbuf, NULL);
+     }
+     
+   }
+@@ -3338,8 +3382,8 @@
+ static void canvas_update_object(AmitkCanvas * canvas, AmitkObject * object) {
+ 
+   rgba_t outline_color;
+-  GnomeCanvasItem * item;
+-  GnomeCanvasItem * new_item;
++  GooCanvasItem * item;
++  GooCanvasItem * new_item;
+   amide_real_t pixel_dim;
+ 
+   g_return_if_fail(object != NULL);
+@@ -3356,25 +3400,20 @@
+   /* compensate for zoom */
+   pixel_dim = (1/AMITK_STUDY_ZOOM(canvas->study))*AMITK_STUDY_VOXEL_DIM(canvas->study); 
+ 
+-  new_item = amitk_canvas_object_draw(GNOME_CANVAS(canvas->canvas), 
++  new_item = amitk_canvas_object_draw(GOO_CANVAS(canvas->canvas),
+ 				      canvas->volume, object, AMITK_CANVAS_VIEW_MODE(canvas),
+ 				      item, pixel_dim,
+ 				      canvas->pixbuf_width, canvas->pixbuf_height,
+ 				      canvas->border_width,canvas->border_width,
+ 				      outline_color, 
+ 				      AMITK_STUDY_CANVAS_ROI_WIDTH(canvas->study),
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+ 				      AMITK_STUDY_CANVAS_ROI_TRANSPARENCY(canvas->study)
+-#else
+-				      AMITK_STUDY_CANVAS_LINE_STYLE(canvas->study),
+-				      AMITK_STUDY_CANVAS_FILL_ROI(canvas->study)
+-#endif
+ );
+ 
+ 
+   if ((item == NULL) && (new_item != NULL)) {
+     g_object_set_data(G_OBJECT(new_item), "object", object);
+-    g_signal_connect(G_OBJECT(new_item), "event", G_CALLBACK(canvas_event_cb), canvas);
++    canvas_setup_handlers(canvas, new_item);
+     canvas->object_items = g_list_append(canvas->object_items, new_item);
+   }
+ 
+@@ -3425,17 +3464,13 @@
+     canvas->label = gtk_label_new(temp_str);
+     g_free(temp_str);
+ 
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+-    canvas->canvas = gnome_canvas_new_aa();
+-#else
+-    canvas->canvas = gnome_canvas_new();
+-#endif
++    canvas->canvas = goo_canvas_new();
+ 
+     canvas->scrollbar_adjustment = gtk_adjustment_new(0.5, 0, 1, 1, 1, 1); /* junk values */
+     g_signal_connect(canvas->scrollbar_adjustment, "value_changed", 
+ 		     G_CALLBACK(canvas_scrollbar_adjustment_cb), canvas);
+-    canvas->scrollbar = gtk_hscrollbar_new(GTK_ADJUSTMENT(canvas->scrollbar_adjustment));
+-    gtk_range_set_update_policy(GTK_RANGE(canvas->scrollbar), GTK_UPDATE_CONTINUOUS);
++    canvas->scrollbar = gtk_scrollbar_new(GTK_ORIENTATION_HORIZONTAL,
++                                          canvas->scrollbar_adjustment);
+ 
+   }
+ 
+@@ -3656,7 +3691,7 @@
+ 
+ static void canvas_remove_object(AmitkCanvas * canvas, AmitkObject * object) {
+ 
+-  GnomeCanvasItem * found_item;
++  GooCanvasItem * found_item;
+   GList * children;
+ 
+   g_return_if_fail(AMITK_IS_CANVAS(canvas));
+@@ -3716,7 +3751,7 @@
+   
+   if (found_item) {
+     canvas->object_items = g_list_remove(canvas->object_items, found_item);
+-    gtk_object_destroy(GTK_OBJECT(found_item));
++    goo_canvas_item_remove(found_item);
+     canvas_add_update(canvas, UPDATE_VIEW); /* needed to check if we need to reset the view slice */
+   } else if (AMITK_IS_DATA_SET(object)) {
+     canvas_add_update(canvas, UPDATE_ALL);
+@@ -3835,10 +3870,10 @@
+ 
+   height = canvas->pixbuf_height + 2*canvas->border_width;
+ 
+-  gtk_widget_size_request(canvas->label, &size);
++  gtk_widget_get_preferred_size(canvas->label, NULL, &size);
+   height+=size.height;
+ 
+-  gtk_widget_size_request(canvas->scrollbar, &size);
++  gtk_widget_get_preferred_size(canvas->scrollbar, NULL, &size);
+   height+=size.height;
+ 
+   return height;
+@@ -3849,7 +3884,7 @@
+ 
+   GdkPixbuf * pixbuf;
+ 
+-  pixbuf = amitk_get_pixbuf_from_canvas(GNOME_CANVAS(canvas->canvas), 
++  pixbuf = amitk_get_pixbuf_from_canvas(GOO_CANVAS(canvas->canvas),
+ 					canvas->border_width,canvas->border_width,
+ 					canvas->pixbuf_width, canvas->pixbuf_height);
+   
+--- amide.orig/amide-current/src/amitk_canvas_object.c
++++ amide/amide-current/src/amitk_canvas_object.c
+@@ -34,49 +34,36 @@
+ #define FIDUCIAL_MARK_WIDTH 4.0
+ #define FIDUCIAL_MARK_WIDTH_PIXELS 2
+ 
+-#ifndef AMIDE_LIBGNOMECANVAS_AA
+-#define FIDUCIAL_MARK_LINE_STYLE GDK_LINE_SOLID
+-#endif
+-
+ /* draws the given object on the given canvas.  */
+ /* if item is NULL, a new canvas item will be created */
+ /* pixel dim is the current dimensions of the pixels in the canvas */
+-GnomeCanvasItem * amitk_canvas_object_draw(GnomeCanvas * canvas, 
++GooCanvasItem * amitk_canvas_object_draw(GooCanvas * canvas,
+ 					   AmitkVolume * canvas_volume,
+ 					   AmitkObject * object,
+ 					   AmitkViewMode view_mode,
+-					   GnomeCanvasItem * item,
++					   GooCanvasItem * item,
+ 					   amide_real_t pixel_dim,
+ 					   gint width, gint height,
+ 					   gdouble x_offset, 
+ 					   gdouble y_offset,
+ 					   rgba_t roi_color,
+ 					   gint roi_width,
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+ 					   gdouble transparency
+-#else
+-					   GdkLineStyle line_style,
+-					   gboolean fill_roi
+-#endif
+ 					   ) {
+ 
+   guint32 fill_color_rgba;
+   guint32 outline_color_rgba;
+-  gdouble affine[6];
+   gboolean hide_object = FALSE;
+-  GnomeCanvasPoints * points;
++  GooCanvasPoints * points;
+ 
+-  g_return_val_if_fail(GNOME_IS_CANVAS(canvas), item);
++  g_return_val_if_fail(GOO_IS_CANVAS(canvas), item);
+   g_return_val_if_fail(AMITK_IS_VOLUME(canvas_volume), item);
+   g_return_val_if_fail(object != NULL, item);
+ 
+ 
+   if (item != NULL) {
+     /* make sure to reset any affine translations we've done */
+-    gnome_canvas_item_i2w_affine(item,affine);
+-    affine[0] = affine[3] = 1.0;
+-    affine[1] = affine[2] = affine[4] = affine[5] = 0.0;
+-    gnome_canvas_item_affine_absolute(item,affine);
++    goo_canvas_item_set_transform(item, NULL);
+   }
+ 
+   if (AMITK_IS_FIDUCIAL_MARK(object)) {
+@@ -100,7 +87,7 @@
+     center_cpoint= point_2_canvas_point(AMITK_VOLUME_CORNER(canvas_volume),
+ 					width, height, x_offset, y_offset, center_point);
+ 
+-    points = gnome_canvas_points_new(7);
++    points = goo_canvas_points_new(7);
+     points->coords[0] = center_cpoint.x-FIDUCIAL_MARK_WIDTH;
+     points->coords[1] = center_cpoint.y;
+     points->coords[2] = center_cpoint.x;
+@@ -117,17 +104,15 @@
+     points->coords[13] = center_cpoint.y-FIDUCIAL_MARK_WIDTH;
+ 
+     if (item == NULL)
+-      item = gnome_canvas_item_new(gnome_canvas_root(canvas),
+-				   gnome_canvas_line_get_type(), "points", points,
+-				   "fill_color_rgba", outline_color_rgba,
+-				   "width_pixels", FIDUCIAL_MARK_WIDTH_PIXELS, 
+-#ifndef AMIDE_LIBGNOMECANVAS_AA
+-    				   "line_style", FIDUCIAL_MARK_LINE_STYLE, 
+-#endif
+-				   NULL); 
++      item = goo_canvas_polyline_new(goo_canvas_get_root_item(canvas),
++                                     FALSE, 0, "points", points,
++                                     "stroke-color-rgba", outline_color_rgba,
++                                     "line-width",
++                                     (gdouble) FIDUCIAL_MARK_WIDTH_PIXELS,
++                                     NULL);
+     else
+-      gnome_canvas_item_set(item, "points", points,"fill_color_rgba", outline_color_rgba, NULL);
+-    gnome_canvas_points_unref(points);
++      g_object_set(item, "points", points, "stroke-color-rgba", outline_color_rgba, NULL);
++    goo_canvas_points_unref(points);
+ 
+     /* make sure the point is on this slice */
+     hide_object = ((center_point.x < 0.0) || 
+@@ -166,11 +151,7 @@
+       offset = zero_point;
+       corner = one_point;
+       pixbuf = image_slice_intersection(roi, canvas_volume, pixel_dim, 
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+ 					transparency,
+-#else
+-					fill_roi,
+-#endif
+ 					roi_color,&offset, &corner);
+       
+       offset_cpoint= point_2_canvas_point(AMITK_VOLUME_CORNER(canvas_volume),
+@@ -186,11 +167,11 @@
+       
+       /* create the item */ 
+       if (item == NULL) {
+-	item =  gnome_canvas_item_new(gnome_canvas_root(canvas),
+-				      gnome_canvas_pixbuf_get_type(), "pixbuf", pixbuf,
+-				      "x", (double) offset_cpoint.x, "y", (double) offset_cpoint.y, NULL);
++        item = goo_canvas_image_new(goo_canvas_get_root_item(canvas),
++                                    pixbuf, (double) offset_cpoint.x,
++                                    (double) offset_cpoint.y, NULL);
+       } else {
+-	gnome_canvas_item_set(item, "pixbuf", pixbuf, 
++	g_object_set(item, "pixbuf", pixbuf,
+ 			      "x", (double) offset_cpoint.x, "y", (double) offset_cpoint.y, NULL);
+       }
+       if (pixbuf != NULL)
+@@ -213,7 +194,7 @@
+     
+       /* transfer the points list to what we'll be using to construction the figure */
+       if (num_points > 1) {
+-	points = gnome_canvas_points_new(num_points);
++	points = goo_canvas_points_new(num_points);
+ 	temp=roi_points;
+ 	j=0;
+ 	while(temp!=NULL) {
+@@ -228,48 +209,34 @@
+       } else {
+ 	/* throw in junk we'll hide*/
+ 	hide_object = TRUE;
+-	points = gnome_canvas_points_new(3);
++	points = goo_canvas_points_new(3);
+ 	points->coords[0] = points->coords[1] = 0;
+ 	points->coords[2] = points->coords[3] = 1;
+ 	points->coords[4] = 0;
+ 	points->coords[5] = 1;
+       }
+       roi_points = amitk_roi_free_points_list(roi_points);
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+       outline_color_rgba = amitk_color_table_rgba_to_uint32(roi_color);
+       roi_color.a = transparency * 0xFF;
+-#endif
+       fill_color_rgba = amitk_color_table_rgba_to_uint32(roi_color);
+ 
+       if ((item == NULL)) {   /* create the item */ 
+-	item =  gnome_canvas_item_new(gnome_canvas_root(canvas),
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+-				      gnome_canvas_polygon_get_type(), 
+-#else
+-				      gnome_canvas_line_get_type(), 
+-#endif
+-				      "points", points,
+-				      "fill_color_rgba",fill_color_rgba,
+-				      "width_pixels", roi_width, 
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+-				      "outline_color_rgba", outline_color_rgba,
+-#else
+-				      "line_style", line_style, 
+-#endif
+-				      NULL);
++        item = goo_canvas_polyline_new(goo_canvas_get_root_item(canvas),
++                                       TRUE, 0,
++                                       "points", points,
++                                       "fill-color-rgba", fill_color_rgba,
++                                       "line-width", (gdouble) roi_width,
++                                       "stroke-color-rgba", outline_color_rgba,
++                                       NULL);
+       } else {
+ 	/* and reset the line points */
+-	gnome_canvas_item_set(item, "points", points, 
+-			      "fill_color_rgba", fill_color_rgba,
+-			      "width_pixels", roi_width, 
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+-			      "outline_color_rgba", outline_color_rgba,
+-#else
+-			      "line_style", line_style,  
+-#endif
++	g_object_set(item, "points", points,
++                     "fill-color-rgba", fill_color_rgba,
++                     "line-width", (gdouble) roi_width,
++                     "stroke-color-rgba", outline_color_rgba,
+ 			      NULL);
+       }
+-      gnome_canvas_points_unref(points);
++      goo_canvas_points_unref(points);
+       break;
+     default:
+       g_error("unexpected case in %s at %d\n", __FILE__, __LINE__);
+@@ -279,9 +246,9 @@
+  
+   /* make sure the point is on this canvas */
+   if (hide_object)
+-    gnome_canvas_item_hide(item);
++    g_object_set(item, "visibility", GOO_CANVAS_ITEM_INVISIBLE, NULL);
+   else if (item)
+-    gnome_canvas_item_show(item);
++    g_object_set(item, "visibility", GOO_CANVAS_ITEM_VISIBLE, NULL);
+ 
+   return item;
+ }
+--- amide.orig/amide-current/src/amitk_dial.c
++++ amide/amide-current/src/amitk_dial.c
+@@ -22,28 +22,27 @@
+ #include <stdio.h>
+ #include "amitk_dial.h"
+ 
+-#define SCROLL_DELAY_LENGTH  300
+-#define DIAL_DEFAULT_SIZE 100
++#define DIAL_DEFAULT_SIZE 50
+ 
+ /* Forward declarations */
+ 
+ static void amitk_dial_class_init               (AmitkDialClass    *klass);
+ static void amitk_dial_init                     (AmitkDial         *dial);
+-static void amitk_dial_destroy                  (GtkObject        *object);
++static void amitk_dial_destroy                  (GtkWidget         *object);
+ static void amitk_dial_realize                  (GtkWidget        *widget);
+ static void amitk_dial_size_request             (GtkWidget      *widget,
+-					       GtkRequisition *requisition);
++                                                 gint           *minimal,
++                                                 gint           *natural);
+ static void amitk_dial_size_allocate            (GtkWidget     *widget,
+ 					       GtkAllocation *allocation);
+ static gint amitk_dial_expose                   (GtkWidget        *widget,
+-						GdkEventExpose   *event);
++						cairo_t           *cr);
+ static gint amitk_dial_button_press             (GtkWidget        *widget,
+ 						GdkEventButton   *event);
+ static gint amitk_dial_button_release           (GtkWidget        *widget,
+ 						GdkEventButton   *event);
+ static gint amitk_dial_motion_notify            (GtkWidget        *widget,
+ 						GdkEventMotion   *event);
+-static gint amitk_dial_timer                    (AmitkDial         *dial);
+ 
+ static void amitk_dial_update_mouse             (AmitkDial *dial, gint x, gint y);
+ static void amitk_dial_update                   (AmitkDial *dial);
+@@ -85,19 +84,18 @@
+ static void
+ amitk_dial_class_init (AmitkDialClass *class)
+ {
+-  GtkObjectClass *object_class;
+   GtkWidgetClass *widget_class;
+ 
+-  object_class = (GtkObjectClass*) class;
+   widget_class = (GtkWidgetClass*) class;
+ 
+   parent_class = g_type_class_peek_parent (class);
+ 
+-  object_class->destroy = amitk_dial_destroy;
++  widget_class->destroy = amitk_dial_destroy;
+ 
+   widget_class->realize = amitk_dial_realize;
+-  widget_class->expose_event = amitk_dial_expose;
+-  widget_class->size_request = amitk_dial_size_request;
++  widget_class->draw = amitk_dial_expose;
++  widget_class->get_preferred_width = amitk_dial_size_request;
++  widget_class->get_preferred_height = amitk_dial_size_request;
+   widget_class->size_allocate = amitk_dial_size_allocate;
+   widget_class->button_press_event = amitk_dial_button_press;
+   widget_class->button_release_event = amitk_dial_button_release;
+@@ -108,8 +106,6 @@
+ amitk_dial_init (AmitkDial *dial)
+ {
+   dial->button = 0;
+-  dial->policy = GTK_UPDATE_CONTINUOUS;
+-  dial->timer = 0;
+   dial->radius = 0;
+   dial->pointer_width = 0;
+   dial->angle = 0.0;
+@@ -135,7 +131,7 @@
+ }
+ 
+ static void
+-amitk_dial_destroy (GtkObject *object)
++amitk_dial_destroy (GtkWidget *object)
+ {
+   AmitkDial *dial;
+ 
+@@ -149,7 +145,7 @@
+     dial->adjustment = NULL;
+   }
+ 
+-  (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
++  (* GTK_WIDGET_CLASS (parent_class)->destroy) (object);
+ }
+ 
+ GtkAdjustment*
+@@ -162,16 +158,6 @@
+ }
+ 
+ void
+-amitk_dial_set_update_policy (AmitkDial      *dial,
+-			     GtkUpdateType  policy)
+-{
+-  g_return_if_fail (dial != NULL);
+-  g_return_if_fail (AMITK_IS_DIAL (dial));
+-
+-  dial->policy = policy;
+-}
+-
+-void
+ amitk_dial_set_adjustment (AmitkDial      *dial,
+ 			  GtkAdjustment *adjustment)
+ {
+@@ -194,9 +180,9 @@
+ 		    G_CALLBACK (amitk_dial_adjustment_value_changed),
+ 		    (gpointer) dial);
+ 
+-  dial->old_value = adjustment->value;
+-  dial->old_lower = adjustment->lower;
+-  dial->old_upper = adjustment->upper;
++  dial->old_value = gtk_adjustment_get_value(adjustment);
++  dial->old_lower = gtk_adjustment_get_lower(adjustment);
++  dial->old_upper = gtk_adjustment_get_upper(adjustment);
+ 
+   amitk_dial_update (dial);
+ }
+@@ -206,18 +192,20 @@
+ {
+   /*  AmitkDial *dial; */
+   GdkWindowAttr attributes;
++  GtkAllocation allocation;
+   gint attributes_mask;
+ 
+   g_return_if_fail (widget != NULL);
+   g_return_if_fail (AMITK_IS_DIAL (widget));
+ 
+-  GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
++  gtk_widget_set_realized (widget, TRUE);
+   /* dial = AMITK_DIAL (widget); */
+ 
+-  attributes.x = widget->allocation.x;
+-  attributes.y = widget->allocation.y;
+-  attributes.width = widget->allocation.width;
+-  attributes.height = widget->allocation.height;
++  gtk_widget_get_allocation (widget, &allocation);
++  attributes.x = allocation.x;
++  attributes.y = allocation.y;
++  attributes.width = allocation.width;
++  attributes.height = allocation.height;
+   attributes.wclass = GDK_INPUT_OUTPUT;
+   attributes.window_type = GDK_WINDOW_CHILD;
+   attributes.event_mask = gtk_widget_get_events (widget) | 
+@@ -225,24 +213,21 @@
+     GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK |
+     GDK_POINTER_MOTION_HINT_MASK;
+   attributes.visual = gtk_widget_get_visual (widget);
+-  attributes.colormap = gtk_widget_get_colormap (widget);
+ 
+-  attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
+-  widget->window = gdk_window_new (widget->parent->window, &attributes, attributes_mask);
++  attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
++  gtk_widget_set_window (widget,
++                         gdk_window_new (gtk_widget_get_parent_window (widget),
++                                         &attributes, attributes_mask));
+ 
+-  widget->style = gtk_style_attach (widget->style, widget->window);
+-
+-  gdk_window_set_user_data (widget->window, widget);
+-
+-  gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
++  gtk_widget_register_window (widget, gtk_widget_get_window (widget));
+ }
+ 
+ static void 
+ amitk_dial_size_request (GtkWidget      *widget,
+-		       GtkRequisition *requisition)
++                         gint           *minimal,
++                         gint           *natural)
+ {
+-  requisition->width = DIAL_DEFAULT_SIZE;
+-  requisition->height = DIAL_DEFAULT_SIZE;
++  *minimal = *natural = DIAL_DEFAULT_SIZE;
+ }
+ 
+ static void
+@@ -255,13 +240,13 @@
+   g_return_if_fail (AMITK_IS_DIAL (widget));
+   g_return_if_fail (allocation != NULL);
+ 
+-  widget->allocation = *allocation;
++  gtk_widget_set_allocation (widget, allocation);
+   dial = AMITK_DIAL (widget);
+ 
+-  if (GTK_WIDGET_REALIZED (widget))
++  if (gtk_widget_get_realized (widget))
+     {
+ 
+-      gdk_window_move_resize (widget->window,
++      gdk_window_move_resize (gtk_widget_get_window (widget),
+ 			      allocation->x, allocation->y,
+ 			      allocation->width, allocation->height);
+ 
+@@ -270,23 +255,23 @@
+   dial->pointer_width = dial->radius / 2;
+ }
+ 
+-static gint
++static gboolean
+ amitk_dial_expose (GtkWidget      *widget,
+-		 GdkEventExpose *event)
++                   cairo_t        *cr)
+ {
+   AmitkDial *dial;
+-  GdkPoint points[6];
++  GtkStyleContext *ctxt;
++  cairo_pattern_t *pat;
++  cairo_rectangle_t points[6];
++  GdkRGBA color;
+   gdouble s,c;
+   gint xc, yc;
++  gint i;
+   /*  gint upper, lower; */
+ 
+   g_return_val_if_fail (widget != NULL, FALSE);
+   g_return_val_if_fail (AMITK_IS_DIAL (widget), FALSE);
+-  g_return_val_if_fail (event != NULL, FALSE);
+ 
+-  if (event->count > 0)
+-    return FALSE;
+-  
+   dial = AMITK_DIAL (widget);
+ 
+ /*  gdk_window_clear_area (widget->window,
+@@ -294,37 +279,31 @@
+ 			 widget->allocation.width,
+ 			 widget->allocation.height);
+ */
+-  xc = widget->allocation.width / 2;
+-  yc = widget->allocation.height / 2;
++  xc = gtk_widget_get_allocated_width (widget) / 2;
++  yc = gtk_widget_get_allocated_height (widget) / 2;
+ 
+   /*  upper = dial->adjustment->upper; */
+   /*  lower = dial->adjustment->lower; */
+ 
++  ctxt = gtk_widget_get_style_context (widget);
++  gtk_style_context_get_color (ctxt, GTK_STATE_FLAG_NORMAL, &color);
++  gdk_cairo_set_source_rgba (cr, &color);
++  cairo_set_line_width (cr, 1.0);
++  cairo_set_line_cap (cr, CAIRO_LINE_CAP_ROUND);
++
+   /* draw circle */
+-  gdk_draw_arc(widget->window,
+-	       widget->style->fg_gc[widget->state],
+-	       FALSE,
+-	       xc - dial->radius,
+-	       yc - dial->radius,
+-	       2*dial->radius,
+-	       2*dial->radius,
+-	       0, 23040);
++  cairo_arc (cr, xc, yc, dial->radius, 0, 2*M_PI);
++  cairo_new_sub_path (cr);
+ 
+   /* draw circle */
+-  gdk_draw_arc(widget->window,
+-	       widget->style->fg_gc[widget->state],
+-	       FALSE,
+-	       xc - 0.90*dial->radius,
+-	       yc - 0.90*dial->radius,
+-	       1.8*dial->radius,
+-	       1.8*dial->radius,
+-	       0, 23040);
++  cairo_arc (cr, xc - 0.05*dial->radius, yc - 0.05*dial->radius,
++             0.9*dial->radius, 0, 2*M_PI);
++  cairo_stroke (cr);
+ 
+   /* Draw pointer */
+ 
+   s = sin (dial->angle);
+   c = cos (dial->angle);
+-  dial->last_angle = dial->angle;
+ 
+   points[0].x = xc + 0.9*s*dial->pointer_width/2;
+   points[0].y = yc + 0.9*c*dial->pointer_width/2;
+@@ -338,15 +317,23 @@
+   points[4].y = points[0].y;
+ 
+ 
+-  gtk_paint_polygon (widget->style,
+-		    widget->window,
+-		    GTK_STATE_ACTIVE,
+-		    GTK_SHADOW_IN,
+-	            NULL,
+-                    widget,
+-                    NULL,
+-		    points, 5,
+-		    TRUE);
++  for (i = 0; i < 5; i++)
++    cairo_line_to (cr, points[i].x, points[i].y);
++  cairo_close_path (cr);
++
++  /* I find it difficult to immitate GTK_SHADOW_IN with cairo, so at
++     least resort to a simple gradient (otherwise the pointer looks
++     rather ugly whether filled or not).  */
++  pat = cairo_pattern_create_linear (points[0].x, points[0].y,
++                                     points[3].x, points[3].y);
++  cairo_pattern_add_color_stop_rgba (pat, 1, color.red, color.green,
++                                     color.blue, color.alpha);
++  cairo_pattern_add_color_stop_rgba (pat, 0, 1, 1, 1, 1);
++  cairo_set_source (cr, pat);
++  cairo_fill_preserve (cr);
++  cairo_pattern_destroy (pat);
++  gdk_cairo_set_source_rgba (cr, &color);
++  cairo_stroke (cr);
+ 
+   return FALSE;
+ }
+@@ -372,8 +359,8 @@
+      the point where the mouse was pressed from the line passing through
+      the pointer */
+   
+-  dx = event->x - widget->allocation.width / 2;
+-  dy = widget->allocation.height / 2 - event->y;
++  dx = event->x - gtk_widget_get_allocated_width (widget) / 2;
++  dy = gtk_widget_get_allocated_height (widget) / 2 - event->y;
+   
+   s = sin (dial->angle);
+   c = cos (dial->angle);
+@@ -413,11 +400,7 @@
+ 
+       dial->button = 0;
+ 
+-      if (dial->policy == GTK_UPDATE_DELAYED)
+-	g_source_remove (dial->timer);
+-      
+-      if ((dial->policy != GTK_UPDATE_CONTINUOUS) &&
+-	  (dial->old_value != dial->adjustment->value))
++      if (dial->old_value != gtk_adjustment_get_value (dial->adjustment))
+ 	g_signal_emit_by_name (G_OBJECT (dial->adjustment), "value_changed");
+     }
+ 
+@@ -429,7 +412,6 @@
+ 			 GdkEventMotion *event)
+ {
+   AmitkDial *dial;
+-  GdkModifierType mods;
+   gint x, y, mask;
+ 
+   g_return_val_if_fail (widget != NULL, FALSE);
+@@ -443,8 +425,8 @@
+       x = event->x;
+       y = event->y;
+ 
+-      if (event->is_hint || (event->window != widget->window))
+-	gdk_window_get_pointer (widget->window, &x, &y, &mods);
++      if (event->is_hint || (event->window != gtk_widget_get_window (widget)))
++        gdk_event_request_motions(event);
+ 
+       switch (dial->button)
+ 	{
+@@ -462,38 +444,25 @@
+ 	  break;
+ 	}
+ 
+-      if (mods & mask)
++      if (mask)
+ 	amitk_dial_update_mouse (dial, x,y);
+     }
+ 
+   return FALSE;
+ }
+ 
+-static gint
+-amitk_dial_timer (AmitkDial *dial)
+-{
+-  g_return_val_if_fail (dial != NULL, FALSE);
+-  g_return_val_if_fail (AMITK_IS_DIAL (dial), FALSE);
+-
+-  if (dial->policy == GTK_UPDATE_DELAYED)
+-    g_signal_emit_by_name (G_OBJECT (dial->adjustment), "value_changed");
+-
+-  return FALSE;
+-}
+-
+ static void
+ amitk_dial_update_mouse (AmitkDial *dial, gint x, gint y)
+ {
+   gint xc, yc;
+-  gfloat old_value;
+ 
+   g_return_if_fail (dial != NULL);
+   g_return_if_fail (AMITK_IS_DIAL (dial));
+ 
+-  xc = GTK_WIDGET(dial)->allocation.width / 2;
+-  yc = GTK_WIDGET(dial)->allocation.height / 2;
++  xc = gtk_widget_get_allocated_width (GTK_WIDGET(dial)) / 2;
++  yc = gtk_widget_get_allocated_height (GTK_WIDGET(dial)) / 2;
+ 
+-  old_value = dial->adjustment->value;
++  dial->old_value = gtk_adjustment_get_value (dial->adjustment);
+   dial->angle = atan2(yc-y, x-xc);
+ 
+   if (dial->angle < M_PI/2.0)
+@@ -501,56 +470,42 @@
+   if (dial->angle > 4*M_PI/3.0)
+     dial->angle -= 2*M_PI;
+ 
+-  dial->adjustment->value = dial->adjustment->upper - (dial->angle+M_PI/2.0)*
+-    (dial->adjustment->upper - dial->adjustment->lower) / (2*M_PI);
+-
+-  if (dial->adjustment->value != old_value)
+-    {
+-      if (dial->policy == GTK_UPDATE_CONTINUOUS)
+-	{
+-	  g_signal_emit_by_name (G_OBJECT (dial->adjustment), "value_changed");
+-	}
+-      else
+-	{
+-	  gtk_widget_queue_draw (GTK_WIDGET (dial));
++  gtk_adjustment_set_value (dial->adjustment,
++                            gtk_adjustment_get_upper (dial->adjustment)
++                            - (dial->angle+M_PI/2.0)*
++                            (gtk_adjustment_get_upper (dial->adjustment)
++                             - gtk_adjustment_get_lower (dial->adjustment))
++                            / (2*M_PI));
+ 
+-	  if (dial->policy == GTK_UPDATE_DELAYED)
+-	    {
+-	      if (dial->timer)
+-		g_source_remove (dial->timer);
+-
+-	      dial->timer = g_timeout_add (SCROLL_DELAY_LENGTH,
+-					   (GtkFunction) amitk_dial_timer,
+-					   (gpointer) dial);
+-	    }
+-	}
+-    }
++  if (gtk_adjustment_get_value (dial->adjustment) != dial->old_value)
++    gtk_widget_queue_draw (GTK_WIDGET (dial));
+ }
+ 
+ static void
+ amitk_dial_update (AmitkDial *dial)
+ {
+-  gfloat new_value;
++  gdouble new_value;
+   
+   g_return_if_fail (dial != NULL);
+   g_return_if_fail (AMITK_IS_DIAL (dial));
+ 
+-  new_value = dial->adjustment->value;
++  new_value = gtk_adjustment_get_value (dial->adjustment);
+   
+-  if (new_value < dial->adjustment->lower)
+-    new_value = dial->adjustment->lower;
++  if (new_value < gtk_adjustment_get_lower (dial->adjustment))
++    new_value = gtk_adjustment_get_lower (dial->adjustment);
+ 
+-  if (new_value > dial->adjustment->upper)
+-    new_value = dial->adjustment->upper;
++  if (new_value > gtk_adjustment_get_upper (dial->adjustment))
++    new_value = gtk_adjustment_get_upper (dial->adjustment);
+ 
+-  if (new_value != dial->adjustment->value)
++  if (new_value != gtk_adjustment_get_value (dial->adjustment))
+     {
+-      dial->adjustment->value = new_value;
+-      g_signal_emit_by_name (G_OBJECT (dial->adjustment), "value_changed");
++      gtk_adjustment_set_value (dial->adjustment, new_value);
+     }
+ 
+-  dial->angle = -M_PI/2.0 + 2.0*M_PI * (new_value - dial->adjustment->lower) /
+-    (dial->adjustment->upper - dial->adjustment->lower);
++  dial->angle = -M_PI/2.0 + 2.0*M_PI
++    * (new_value - gtk_adjustment_get_lower (dial->adjustment))
++    / (gtk_adjustment_get_upper (dial->adjustment)
++       - gtk_adjustment_get_lower (dial->adjustment));
+ 
+   gtk_widget_queue_draw (GTK_WIDGET (dial));
+ }
+@@ -566,15 +521,15 @@
+ 
+   dial = AMITK_DIAL (data);
+ 
+-  if ((dial->old_value != adjustment->value) ||
+-      (dial->old_lower != adjustment->lower) ||
+-      (dial->old_upper != adjustment->upper))
++  if ((dial->old_value != gtk_adjustment_get_value (adjustment)) ||
++      (dial->old_lower != gtk_adjustment_get_lower (adjustment)) ||
++      (dial->old_upper != gtk_adjustment_get_upper (adjustment)))
+     {
+       amitk_dial_update (dial);
+ 
+-      dial->old_value = adjustment->value;
+-      dial->old_lower = adjustment->lower;
+-      dial->old_upper = adjustment->upper;
++      dial->old_value = gtk_adjustment_get_value (adjustment);
++      dial->old_lower = gtk_adjustment_get_lower (adjustment);
++      dial->old_upper = gtk_adjustment_get_upper (adjustment);
+     }
+ }
+ 
+@@ -589,10 +544,13 @@
+ 
+   dial = AMITK_DIAL (data);
+ 
+-  if (dial->old_value != adjustment->value)
++  if (dial->button)
++    return;
++
++  if (dial->old_value != gtk_adjustment_get_value (adjustment))
+     {
+       amitk_dial_update (dial);
+ 
+-      dial->old_value = adjustment->value;
++      dial->old_value = gtk_adjustment_get_value (adjustment);
+     }
+ }
+--- amide.orig/amide-current/src/amitk_dial.h
++++ amide/amide-current/src/amitk_dial.h
+@@ -39,9 +39,6 @@
+ {
+   GtkWidget widget;
+ 
+-  /* update policy (GTK_UPDATE_[CONTINUOUS/DELAYED/DISCONTINUOUS]) */
+-  guint policy : 2;
+-
+   /* Button currently pressed or 0 if none */
+   guint8 button;
+ 
+@@ -49,17 +46,13 @@
+   gint radius;
+   gint pointer_width;
+ 
+-  /* ID of update timer, or 0 if none */
+-  guint32 timer;
+-
+   /* Current angle */
+-  gfloat angle;
+-  gfloat last_angle;
++  gdouble angle;
+ 
+   /* Old values from adjustment stored so we know when something changes */
+-  gfloat old_value;
+-  gfloat old_lower;
+-  gfloat old_upper;
++  gdouble old_value;
++  gdouble old_lower;
++  gdouble old_upper;
+ 
+   /* The adjustment object that stores the data for this dial */
+   GtkAdjustment *adjustment;
+@@ -74,8 +67,6 @@
+ GtkWidget*     amitk_dial_new                    (GtkAdjustment *adjustment);
+ GType          amitk_dial_get_type               (void);
+ GtkAdjustment* amitk_dial_get_adjustment         (AmitkDial      *dial);
+-void           amitk_dial_set_update_policy      (AmitkDial      *dial,
+-						GtkUpdateType  policy);
+ 
+ void           amitk_dial_set_adjustment         (AmitkDial      *dial,
+ 						GtkAdjustment *adjustment);
+--- amide.orig/amide-current/src/amitk_object_dialog.h
++++ amide/amide-current/src/amitk_object_dialog.h
+@@ -30,7 +30,7 @@
+ 
+ /* includes we always need with this widget */
+ #include <gtk/gtk.h>
+-#include <libgnomecanvas/libgnomecanvas.h>
++#include <goocanvas.h>
+ #include "amitk_object.h"
+ #include "amitk_data_set.h"
+ 
+@@ -92,13 +92,8 @@
+ 
+   /* study preferences */
+   GtkWidget * roi_width_spin;
+-  GnomeCanvasItem * roi_item;
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
++  GooCanvasItem * roi_item;
+   GtkWidget * roi_transparency_spin;
+-#else
+-  GtkWidget * line_style_menu;
+-  GtkWidget * fill_roi_button;
+-#endif
+   GtkWidget * layout_button1;
+   GtkWidget * layout_button2;
+   GtkWidget * panel_layout_button1;
+--- amide.orig/amide-current/src/amitk_object_dialog.c
++++ amide/amide-current/src/amitk_object_dialog.c
+@@ -43,7 +43,7 @@
+ 
+ static void object_dialog_class_init (AmitkObjectDialogClass *class);
+ static void object_dialog_init (AmitkObjectDialog *object_dialog);
+-static void object_dialog_destroy (GtkObject * object);
++static void object_dialog_destroy (GtkWidget * object);
+ static void object_dialog_construct(AmitkObjectDialog * dialog, 
+ 				    AmitkObject * object,
+ 				    AmitkLayout layout);
+@@ -86,18 +86,13 @@
+ static void dialog_change_cylinder_unit_cb (GtkWidget * widget, gpointer data);
+ 
+ static void dialog_change_roi_width_cb           (GtkWidget * widget, gpointer data);
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+ static void dialog_change_roi_transparency_cb    (GtkWidget * widget, gpointer data);
+-#else
+-static void dialog_change_line_style_cb          (GtkWidget * widget, gpointer data);
+-static void dialog_change_fill_roi_cb            (GtkWidget * widget, gpointer data);
+-#endif
+ static void dialog_change_layout_cb              (GtkWidget * widget, gpointer data);
+ static void dialog_change_panel_layout_cb        (GtkWidget * widget, gpointer data);
+ static void dialog_change_maintain_size_cb       (GtkWidget * widget, gpointer data);
+ static void dialog_change_target_empty_area_cb   (GtkWidget * widget, gpointer data);
+ static void dialog_specify_color_cb              (GtkWidget * widget, gpointer data);
+-static void dialog_change_color_cb               (GtkWidget * widget, gpointer data);
++static void dialog_change_color_cb               (GtkWidget * widget, GdkRGBA *rgba, gpointer data);
+ 
+ static GtkDialogClass *object_dialog_parent_class;
+ 
+@@ -131,9 +126,9 @@
+ 
+ static void object_dialog_class_init (AmitkObjectDialogClass *klass)
+ {
+-  GtkObjectClass *gtkobject_class;
++  GtkWidgetClass *gtkobject_class;
+ 
+-  gtkobject_class = (GtkObjectClass*) klass;
++  gtkobject_class = (GtkWidgetClass*) klass;
+ 
+   object_dialog_parent_class = g_type_class_peek_parent(klass);
+ 
+@@ -141,7 +136,7 @@
+ 
+ }
+ 
+-static void object_dialog_destroy (GtkObject * object) {
++static void object_dialog_destroy (GtkWidget * object) {
+ 
+   AmitkObjectDialog * dialog;
+ 
+@@ -176,8 +171,8 @@
+     dialog->duration_spins = NULL;
+   }
+ 
+-  if (GTK_OBJECT_CLASS (object_dialog_parent_class)->destroy)
+-    (* GTK_OBJECT_CLASS (object_dialog_parent_class)->destroy) (object);
++  if (GTK_WIDGET_CLASS (object_dialog_parent_class)->destroy)
++    (* GTK_WIDGET_CLASS (object_dialog_parent_class)->destroy) (object);
+ }
+ 
+ 
+@@ -215,11 +210,10 @@
+   guint i;
+   gboolean immutables;
+ 
+-  gtk_dialog_set_has_separator(GTK_DIALOG(dialog), FALSE);
+   gtk_dialog_add_buttons(GTK_DIALOG(dialog),
+-			 GTK_STOCK_REVERT_TO_SAVED, AMITK_RESPONSE_REVERT,
+-			 GTK_STOCK_HELP, GTK_RESPONSE_HELP,
+-			 GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, 
++			 _("_Revert"), AMITK_RESPONSE_REVERT,
++			 _("_Help"), GTK_RESPONSE_HELP,
++			 _("_Close"), GTK_RESPONSE_CLOSE,
+ 			 NULL);
+ 
+   /* create the temp object which will store the old info if we want revert */
+@@ -231,7 +225,8 @@
+   		   G_CALLBACK(dialog_response_cb), NULL);
+ 
+   notebook = gtk_notebook_new();
+-  gtk_container_add (GTK_CONTAINER (GTK_DIALOG(dialog)->vbox), notebook);
++  gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area
++                                    (GTK_DIALOG (dialog))), notebook);
+   gtk_widget_show(notebook);
+ 
+   /* ---------------------------
+@@ -239,7 +234,9 @@
+      --------------------------- */
+ 
+   /* start making the widgets for this dialog box */
+-  packing_table = gtk_table_new(14,4,FALSE);
++  packing_table = gtk_grid_new();
++  gtk_grid_set_row_spacing(GTK_GRID(packing_table), Y_PADDING);
++  gtk_grid_set_column_spacing(GTK_GRID(packing_table), X_PADDING);
+   label = gtk_label_new(_("Basic Info"));
+   table_row=0;
+   gtk_notebook_append_page(GTK_NOTEBOOK(notebook), packing_table, label);
+@@ -251,15 +248,15 @@
+     label = gtk_label_new(_("Data Set Name:"));
+   else 
+     label = gtk_label_new(_("Name:"));
+-  gtk_table_attach(GTK_TABLE(packing_table), label, 0,1, 
+-		   table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), label, 0, table_row, 1, 1);
+   gtk_widget_show(label);
+ 
+   dialog->name_entry = gtk_entry_new();
+   gtk_editable_set_editable(GTK_EDITABLE(dialog->name_entry), TRUE);
+   g_signal_connect(G_OBJECT(dialog->name_entry), "changed", G_CALLBACK(dialog_change_name_cb), dialog);
+-  gtk_table_attach(GTK_TABLE(packing_table),dialog->name_entry,1,4, 
+-		   table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_widget_set_hexpand(dialog->name_entry, TRUE);
++  gtk_grid_attach(GTK_GRID(packing_table), dialog->name_entry,
++                  1, table_row, 3, 1);
+   gtk_widget_show(dialog->name_entry);
+   table_row++;
+ 
+@@ -271,11 +268,10 @@
+ 
+     /* widgets to change the object's type */
+     label = gtk_label_new(_("Type:"));
+-    gtk_table_attach(GTK_TABLE(packing_table), label, 0,1,
+-		     table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(packing_table), label, 0, table_row, 1, 1);
+     gtk_widget_show(label);
+     
+-    dialog->roi_type_menu = gtk_combo_box_new_text();
++    dialog->roi_type_menu = gtk_combo_box_text_new();
+ 
+     switch(AMITK_ROI_TYPE(object)) {
+     case AMITK_ROI_TYPE_ELLIPSOID:
+@@ -297,12 +293,12 @@
+     }
+ 
+     for (i_roi_type=type_start; i_roi_type<=type_end; i_roi_type++) 
+-      gtk_combo_box_append_text(GTK_COMBO_BOX(dialog->roi_type_menu),
++      gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(dialog->roi_type_menu),
+     				amitk_roi_type_get_name(i_roi_type));
+     if (type_start != type_end)
+       g_signal_connect(G_OBJECT(dialog->roi_type_menu), "changed", G_CALLBACK(dialog_change_roi_type_cb), dialog);
+-    gtk_table_attach(GTK_TABLE(packing_table), dialog->roi_type_menu, 1,2, 
+-		     table_row,table_row+1, GTK_FILL, 0,  X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(packing_table), dialog->roi_type_menu,
++                    1, table_row, 1, 1);
+     gtk_widget_show(dialog->roi_type_menu);
+     table_row++;
+ 
+@@ -323,42 +319,38 @@
+ 
+     /* widgets to change the date of the scan name */
+     label = gtk_label_new(_("Scan Date:"));
+-    gtk_table_attach(GTK_TABLE(packing_table), label, 0,1,
+-		     table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(packing_table), label, 0, table_row, 1, 1);
+     gtk_widget_show(label);
+ 
+     dialog->scan_date_entry = gtk_entry_new();
+     gtk_editable_set_editable(GTK_EDITABLE(dialog->scan_date_entry), TRUE);
+     g_signal_connect(G_OBJECT(dialog->scan_date_entry), "changed", G_CALLBACK(dialog_change_scan_date_cb), dialog);
+-    gtk_table_attach(GTK_TABLE(packing_table), dialog->scan_date_entry,1,2,
+-		     table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(packing_table), dialog->scan_date_entry,
++                    1, table_row, 1, 1);
+     gtk_widget_show(dialog->scan_date_entry);
+ 
+     /* widgets to change the object's modality */
+     label = gtk_label_new(_("Modality:"));
+-    gtk_table_attach(GTK_TABLE(packing_table), label, 2,3,
+-		     table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(packing_table), label, 2, table_row, 1, 1);
+     gtk_widget_show(label);
+ 
+-    dialog->modality_menu = gtk_combo_box_new_text();
++    dialog->modality_menu = gtk_combo_box_text_new();
+     for (i_modality=0; i_modality<AMITK_MODALITY_NUM; i_modality++) 
+-      gtk_combo_box_append_text(GTK_COMBO_BOX(dialog->modality_menu),
++      gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(dialog->modality_menu),
+ 				amitk_modality_get_name(i_modality));
+     g_signal_connect(G_OBJECT(dialog->modality_menu), "changed", G_CALLBACK(dialog_change_modality_cb), dialog);
+-    gtk_table_attach(GTK_TABLE(packing_table), dialog->modality_menu, 3,4, 
+-		     table_row,table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(packing_table), dialog->modality_menu,
++                    3, table_row, 1, 1);
+     gtk_widget_show(dialog->modality_menu);
+     table_row++;
+     
+     /* widget to change the interpolation */
+     label = gtk_label_new(_("Interpolation Type:"));
+-    gtk_table_attach(GTK_TABLE(packing_table), label, 0,1,
+-		     table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(packing_table), label, 0, table_row, 1, 1);
+     gtk_widget_show(label);
+     
+-    hbox = gtk_hbox_new(FALSE, 0);
+-    gtk_table_attach(GTK_TABLE(packing_table), hbox,1,2,
+-		     table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++    hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
++    gtk_grid_attach(GTK_GRID(packing_table), hbox, 1, table_row, 1, 1);
+     gtk_widget_show(hbox);
+ 
+     for (i_interpolation = 0; i_interpolation < AMITK_INTERPOLATION_NUM; i_interpolation++) {
+@@ -371,10 +363,10 @@
+ 
+       switch (i_interpolation) {
+       case AMITK_INTERPOLATION_NEAREST_NEIGHBOR:
+-	image = gtk_image_new_from_stock("amide_icon_interpolation_nearest_neighbor",GTK_ICON_SIZE_LARGE_TOOLBAR);
++	image = gtk_image_new_from_icon_name("amide_icon_interpolation_nearest_neighbor",GTK_ICON_SIZE_LARGE_TOOLBAR);
+ 	break;
+       case AMITK_INTERPOLATION_TRILINEAR:
+-	image = gtk_image_new_from_stock("amide_icon_interpolation_trilinear",GTK_ICON_SIZE_LARGE_TOOLBAR);
++	image = gtk_image_new_from_icon_name("amide_icon_interpolation_trilinear",GTK_ICON_SIZE_LARGE_TOOLBAR);
+ 	break;
+       default:
+ 	g_error("unexpected case in %s at line %d",__FILE__, __LINE__);
+@@ -398,28 +390,26 @@
+ 
+     /* widget to change the rendering */
+     label = gtk_label_new(_("Rendering Type:"));
+-    gtk_table_attach(GTK_TABLE(packing_table), label, 2,3,
+-		     table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(packing_table), label, 2, table_row, 1, 1);
+     gtk_widget_show(label);
+     
+ 
+-    dialog->rendering_menu = gtk_combo_box_new_text();
+-    /*  gtk_widget_set_tooltip_text(dialog->rendering_menu, _(amitk_rendering_explanation)); 
+-	combo box's (as of 2.24 at least, don't have functioning tool tips */
++    dialog->rendering_menu = gtk_combo_box_text_new();
++    gtk_widget_set_tooltip_text(dialog->rendering_menu,
++                                _(amitk_rendering_explanation));
+     for (i_rendering = 0; i_rendering < AMITK_RENDERING_NUM; i_rendering++)
+-      gtk_combo_box_append_text(GTK_COMBO_BOX(dialog->rendering_menu),
++      gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(dialog->rendering_menu),
+ 				amitk_rendering_get_name(i_rendering));
+     g_signal_connect(G_OBJECT(dialog->rendering_menu), "changed", G_CALLBACK(dialog_change_rendering_cb), dialog);
+-    gtk_table_attach(GTK_TABLE(packing_table), dialog->rendering_menu, 3,4,
+-		     table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(packing_table), dialog->rendering_menu,
++                    3, table_row, 1, 1);
+     gtk_widget_show(dialog->rendering_menu);
+     table_row++;
+ 
+ 
+     /* a separator for clarity */
+-    hseparator = gtk_hseparator_new();
+-    gtk_table_attach(GTK_TABLE(packing_table), hseparator, 0, 5, table_row, table_row+1,
+-		     GTK_FILL, 0, X_PADDING, Y_PADDING);
++    hseparator = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
++    gtk_grid_attach(GTK_GRID(packing_table), hseparator, 0, table_row, 5, 1);
+     gtk_widget_show(hseparator);
+     table_row++;
+   
+@@ -429,82 +419,76 @@
+ 
+     /* widgets to change the subject name associated with the data */
+     label = gtk_label_new(_("Subject Name:"));
+-    gtk_table_attach(GTK_TABLE(packing_table), label, 0,1,
+-		     table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(packing_table), label, 0, table_row, 1, 1);
+     gtk_widget_show(label);
+ 
+     dialog->subject_name_entry = gtk_entry_new();
+     gtk_editable_set_editable(GTK_EDITABLE(dialog->subject_name_entry), TRUE);
+     g_signal_connect(G_OBJECT(dialog->subject_name_entry), "changed", G_CALLBACK(dialog_change_subject_name_cb), dialog);
+-    gtk_table_attach(GTK_TABLE(packing_table), dialog->subject_name_entry,1,4,
+-		     table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(packing_table), dialog->subject_name_entry,
++                    1, table_row, 3, 1);
+     gtk_widget_show(dialog->subject_name_entry);
+     table_row++;
+ 
+     /* widgets to change the id associated with the data */
+     label = gtk_label_new(_("Subject ID:"));
+-    gtk_table_attach(GTK_TABLE(packing_table), label, 0,1,
+-		     table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(packing_table), label, 0, table_row, 1, 1);
+     gtk_widget_show(label);
+ 
+     dialog->subject_id_entry = gtk_entry_new();
+     gtk_editable_set_editable(GTK_EDITABLE(dialog->subject_id_entry), TRUE);
+     g_signal_connect(G_OBJECT(dialog->subject_id_entry), "changed", G_CALLBACK(dialog_change_subject_id_cb), dialog);
+-    gtk_table_attach(GTK_TABLE(packing_table), dialog->subject_id_entry,1,2,
+-		     table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(packing_table), dialog->subject_id_entry,
++                    1, table_row, 1, 1);
+     gtk_widget_show(dialog->subject_id_entry);
+ 
+     /* widgets to change the subject's date of birth */
+     label = gtk_label_new(_("Subject DOB:"));
+-    gtk_table_attach(GTK_TABLE(packing_table), label, 2,3,
+-		     table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(packing_table), label, 2, table_row, 1, 1);
+     gtk_widget_show(label);
+ 
+     dialog->subject_dob_entry = gtk_entry_new();
+     gtk_editable_set_editable(GTK_EDITABLE(dialog->subject_dob_entry), TRUE);
+     g_signal_connect(G_OBJECT(dialog->subject_dob_entry), "changed", G_CALLBACK(dialog_change_subject_dob_cb), dialog);
+-    gtk_table_attach(GTK_TABLE(packing_table), dialog->subject_dob_entry,3,4,
+-		     table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(packing_table), dialog->subject_dob_entry,
++                    3, table_row, 1, 1);
+     gtk_widget_show(dialog->subject_dob_entry);
+ 
+     table_row++;
+ 
+     /* widgets to change the subject's orientation */
+     label = gtk_label_new(_("Subject Orientation:"));
+-    gtk_table_attach(GTK_TABLE(packing_table), label, 0,1,
+-		     table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(packing_table), label, 0, table_row, 1, 1);
+     gtk_widget_show(label);
+ 
+-    dialog->subject_orientation_menu = gtk_combo_box_new_text();
++    dialog->subject_orientation_menu = gtk_combo_box_text_new();
+     for (i_subject_orientation=0; i_subject_orientation<AMITK_SUBJECT_ORIENTATION_NUM; i_subject_orientation++) 
+-      gtk_combo_box_append_text(GTK_COMBO_BOX(dialog->subject_orientation_menu),
++      gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(dialog->subject_orientation_menu),
+ 				amitk_subject_orientation_get_name(i_subject_orientation));
+     g_signal_connect(G_OBJECT(dialog->subject_orientation_menu), "changed", G_CALLBACK(dialog_change_subject_orientation_cb), dialog);
+-    gtk_table_attach(GTK_TABLE(packing_table), dialog->subject_orientation_menu, 1,2, 
+-		     table_row,table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(packing_table), dialog->subject_orientation_menu,
++                    1, table_row, 1, 1);
+     gtk_widget_show(dialog->subject_orientation_menu);
+ 
+     /* widgets to change the subject's sex (much easier in the virtual world than in real life) */
+     label = gtk_label_new(_("Subject Sex:"));
+-    gtk_table_attach(GTK_TABLE(packing_table), label, 2,3,
+-		     table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(packing_table), label, 2, table_row, 1, 1);
+     gtk_widget_show(label);
+ 
+-    dialog->subject_sex_menu = gtk_combo_box_new_text();
++    dialog->subject_sex_menu = gtk_combo_box_text_new();
+     for (i_subject_sex=0; i_subject_sex<AMITK_SUBJECT_SEX_NUM; i_subject_sex++) 
+-      gtk_combo_box_append_text(GTK_COMBO_BOX(dialog->subject_sex_menu),
++      gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(dialog->subject_sex_menu),
+ 				amitk_subject_sex_get_name(i_subject_sex));
+     g_signal_connect(G_OBJECT(dialog->subject_sex_menu), "changed", G_CALLBACK(dialog_change_subject_sex_cb), dialog);
+-    gtk_table_attach(GTK_TABLE(packing_table), dialog->subject_sex_menu, 3,4,
+-		     table_row,table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(packing_table), dialog->subject_sex_menu,
++                    3, table_row, 1, 1);
+     gtk_widget_show(dialog->subject_sex_menu);
+ 
+     table_row++;
+     
+     /* a separator for clarity */
+-    hseparator = gtk_hseparator_new();
+-    gtk_table_attach(GTK_TABLE(packing_table), hseparator, 0, 5, table_row, table_row+1,
+-		     GTK_FILL, 0, X_PADDING, Y_PADDING);
++    hseparator = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
++    gtk_grid_attach(GTK_GRID(packing_table), hseparator, 0, table_row, 5, 1);
+     gtk_widget_show(hseparator);
+     table_row++;
+   
+@@ -514,8 +498,8 @@
+ 
+     /* widget to change the scaling factor */
+     label = gtk_label_new(_("Conversion Type:"));
+-    gtk_table_attach(GTK_TABLE(packing_table), label, table_column,table_column+1,
+-		     table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(packing_table), label,
++                    table_column, table_row, 1, 1);
+     gtk_widget_show(label);
+ 
+ 
+@@ -531,9 +515,11 @@
+       
+       g_object_set_data(G_OBJECT(dialog->conversion_button[i_conversion]), "conversion", 
+ 			GINT_TO_POINTER(i_conversion));
+-      gtk_table_attach(GTK_TABLE(packing_table), dialog->conversion_button[i_conversion], 
+-		       table_column,table_column+1, inner_table_row, inner_table_row+1,
+-		       0, 0, X_PADDING, Y_PADDING);
++      gtk_widget_set_halign(dialog->conversion_button[i_conversion],
++                            GTK_ALIGN_CENTER);
++      gtk_grid_attach(GTK_GRID(packing_table),
++                      dialog->conversion_button[i_conversion],
++                      table_column, inner_table_row, 1, 1);
+       gtk_widget_show(dialog->conversion_button[i_conversion]);
+       g_signal_connect(G_OBJECT(dialog->conversion_button[i_conversion]), "clicked",  
+ 		       G_CALLBACK(dialog_conversion_cb), dialog);
+@@ -548,8 +534,8 @@
+ 
+ 
+     label = gtk_label_new(_("Scaling Factor:"));
+-    gtk_table_attach(GTK_TABLE(packing_table), label, table_column,table_column+1,
+-		     table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(packing_table), label,
++                    table_column, table_row, 1, 1);
+     gtk_widget_show(label);
+ 
+     dialog->scaling_factor_spin = gtk_spin_button_new_with_range(0.0, G_MAXDOUBLE, 1.0);
+@@ -558,25 +544,23 @@
+ 		     G_CALLBACK(dialog_change_scale_factor_cb), dialog);
+     g_signal_connect(G_OBJECT(dialog->scaling_factor_spin), "output",
+ 		     G_CALLBACK(amitk_spin_button_scientific_output), NULL);
+-    gtk_table_attach(GTK_TABLE(packing_table), dialog->scaling_factor_spin,
+-		     table_column+1,table_column+2,table_row, table_row+1, 
+-		     GTK_FILL, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(packing_table), dialog->scaling_factor_spin,
++                    table_column+1, table_row, 1, 1);
+     gtk_widget_show(dialog->scaling_factor_spin);
+     table_row++;
+ 
+ 
+     /* a separator for clarity */
+-    hseparator = gtk_hseparator_new();
+-    gtk_table_attach(GTK_TABLE(packing_table), hseparator, 1, 5, table_row, table_row+1,
+-		     GTK_FILL, 0, X_PADDING, Y_PADDING);
++    hseparator = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
++    gtk_grid_attach(GTK_GRID(packing_table), hseparator, 1, table_row, 4, 1);
+     gtk_widget_show(hseparator);
+     table_row++;
+   
+ 
+     /* injected dose */
+     label = gtk_label_new(_("Injected Dose:"));
+-    gtk_table_attach(GTK_TABLE(packing_table), label, table_column,table_column+1,
+-		     table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(packing_table), label,
++                    table_column, table_row, 1, 1);
+     gtk_widget_show(label);
+ 
+     dialog->dose_spin = gtk_spin_button_new_with_range(0.0, G_MAXDOUBLE, 1.0);
+@@ -585,21 +569,19 @@
+ 		     G_CALLBACK(dialog_change_dose_cb), dialog);
+     g_signal_connect(G_OBJECT(dialog->dose_spin), "output",
+ 		     G_CALLBACK(amitk_spin_button_scientific_output), NULL);
+-    gtk_table_attach(GTK_TABLE(packing_table), dialog->dose_spin,
+-		     table_column+1,table_column+2,table_row, table_row+1, 
+-		     GTK_FILL, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(packing_table), dialog->dose_spin,
++                    table_column+1, table_row, 1, 1);
+     gtk_widget_show(dialog->dose_spin);
+ 
+     /* injected dose units */
+-    dialog->dose_unit_menu = gtk_combo_box_new_text();
++    dialog->dose_unit_menu = gtk_combo_box_text_new();
+     for (i_dose_unit=0; i_dose_unit<AMITK_DOSE_UNIT_NUM; i_dose_unit++) 
+-      gtk_combo_box_append_text(GTK_COMBO_BOX(dialog->dose_unit_menu),
++      gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(dialog->dose_unit_menu),
+ 				amitk_dose_unit_names[i_dose_unit]);				
+     g_signal_connect(G_OBJECT(dialog->dose_unit_menu), "changed", 
+ 		     G_CALLBACK(dialog_change_dose_unit_cb), dialog);
+-    gtk_table_attach(GTK_TABLE(packing_table), dialog->dose_unit_menu, 
+-		     table_column+2, table_column+3, table_row,table_row+1, 
+-		     GTK_FILL, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(packing_table), dialog->dose_unit_menu,
++                    table_column+2, table_row, 1, 1);
+     gtk_widget_show(dialog->dose_unit_menu);
+     table_row++;
+ 
+@@ -607,8 +589,8 @@
+ 
+     /* subject weight */
+     label = gtk_label_new(_("Subject Weight:"));
+-    gtk_table_attach(GTK_TABLE(packing_table), label, table_column,table_column+1,
+-		     table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(packing_table), label,
++                    table_column, table_row, 1, 1);
+     gtk_widget_show(label);
+ 
+     dialog->weight_spin = gtk_spin_button_new_with_range(0.0, G_MAXDOUBLE, 1.0);
+@@ -617,21 +599,19 @@
+ 		     G_CALLBACK(dialog_change_weight_cb), dialog);
+     g_signal_connect(G_OBJECT(dialog->weight_spin), "output",
+ 		     G_CALLBACK(amitk_spin_button_scientific_output), NULL);
+-    gtk_table_attach(GTK_TABLE(packing_table), dialog->weight_spin,
+-		     table_column+1,table_column+2,table_row, table_row+1, 
+-		     GTK_FILL, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(packing_table), dialog->weight_spin,
++                    table_column+1, table_row, 1, 1);
+     gtk_widget_show(dialog->weight_spin);
+ 
+     /* subject weight units */
+-    dialog->weight_unit_menu = gtk_combo_box_new_text();
++    dialog->weight_unit_menu = gtk_combo_box_text_new();
+     for (i_weight_unit=0; i_weight_unit<AMITK_WEIGHT_UNIT_NUM; i_weight_unit++) 
+-      gtk_combo_box_append_text(GTK_COMBO_BOX(dialog->weight_unit_menu),
++      gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(dialog->weight_unit_menu),
+ 				amitk_weight_unit_names[i_weight_unit]);
+     g_signal_connect(G_OBJECT(dialog->weight_unit_menu), "changed", 
+ 		     G_CALLBACK(dialog_change_weight_unit_cb), dialog);
+-    gtk_table_attach(GTK_TABLE(packing_table), dialog->weight_unit_menu, 
+-		     table_column+2, table_column+3, table_row,table_row+1, 
+-		     GTK_FILL, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(packing_table), dialog->weight_unit_menu,
++                    table_column+2, table_row, 1, 1);
+     gtk_widget_show(dialog->weight_unit_menu);
+     table_row++;
+     
+@@ -639,8 +619,8 @@
+ 
+     /* cylinder factor */
+     label = gtk_label_new(_("Cylinder Factor:"));
+-    gtk_table_attach(GTK_TABLE(packing_table), label, table_column,table_column+1,
+-		     table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(packing_table), label,
++                    table_column, table_row, 1, 1);
+     gtk_widget_show(label);
+ 
+     dialog->cylinder_spin = gtk_spin_button_new_with_range(0.0, G_MAXDOUBLE, 1.0);
+@@ -649,21 +629,19 @@
+ 		     G_CALLBACK(dialog_change_cylinder_cb), dialog);
+     g_signal_connect(G_OBJECT(dialog->cylinder_spin), "output",
+ 		     G_CALLBACK(amitk_spin_button_scientific_output), NULL);
+-    gtk_table_attach(GTK_TABLE(packing_table), dialog->cylinder_spin,
+-		     table_column+1,table_column+2,table_row, table_row+1, 
+-		     GTK_FILL, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(packing_table), dialog->cylinder_spin,
++                    table_column+1, table_row, 1, 1);
+     gtk_widget_show(dialog->cylinder_spin);
+ 
+     /* cylinder factor units */
+-    dialog->cylinder_unit_menu = gtk_combo_box_new_text();
++    dialog->cylinder_unit_menu = gtk_combo_box_text_new();
+     for (i_cylinder_unit=0; i_cylinder_unit<AMITK_CYLINDER_UNIT_NUM; i_cylinder_unit++) 
+-      gtk_combo_box_append_text(GTK_COMBO_BOX(dialog->cylinder_unit_menu),
++      gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(dialog->cylinder_unit_menu),
+ 				amitk_cylinder_unit_names[i_cylinder_unit]);				
+     g_signal_connect(G_OBJECT(dialog->cylinder_unit_menu), "changed", 
+ 		     G_CALLBACK(dialog_change_cylinder_unit_cb), dialog);
+-    gtk_table_attach(GTK_TABLE(packing_table), dialog->cylinder_unit_menu, 
+-		     table_column+2, table_column+3, table_row,table_row+1, 
+-		     GTK_FILL, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(packing_table), dialog->cylinder_unit_menu,
++                    table_column+2, table_row, 1, 1);
+     gtk_widget_show(dialog->cylinder_unit_menu);
+     table_row++;
+     
+@@ -677,15 +655,15 @@
+   } else if (AMITK_IS_STUDY(object)) {
+     /* widgets to change the study's creation date */
+     label = gtk_label_new(_("Creation Date:"));
+-    gtk_table_attach(GTK_TABLE(packing_table), label, 0,1,
+-		     table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(packing_table), label, 0, table_row, 1, 1);
+     gtk_widget_show(label);
+ 
+     dialog->creation_date_entry = gtk_entry_new();
+     gtk_editable_set_editable(GTK_EDITABLE(dialog->creation_date_entry), TRUE);
+     g_signal_connect(G_OBJECT(dialog->creation_date_entry), "changed", G_CALLBACK(dialog_change_creation_date_cb), dialog);
+-    gtk_table_attach(GTK_TABLE(packing_table), dialog->creation_date_entry,1,2,
+-		     table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++    gtk_widget_set_hexpand(dialog->creation_date_entry, TRUE);
++    gtk_grid_attach(GTK_GRID(packing_table), dialog->creation_date_entry,
++                    1, table_row, 1, 1);
+     gtk_widget_show(dialog->creation_date_entry);
+     table_row++;
+  
+@@ -706,14 +684,15 @@
+   /* keep this on page 1 for fiducial points */
+   if (AMITK_IS_FIDUCIAL_MARK(object)) {
+     /* a separator for clarity */
+-    hseparator = gtk_hseparator_new();
+-    gtk_table_attach(GTK_TABLE(packing_table), hseparator, 0, 4, 
+-		     table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++    hseparator = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
++    gtk_grid_attach(GTK_GRID(packing_table), hseparator, 0, table_row, 4, 1);
+     gtk_widget_show(hseparator);
+     table_row++;
+   } else {
+     /* the next page of options */
+-    packing_table = gtk_table_new(7,7,FALSE);
++    packing_table = gtk_grid_new();
++    gtk_grid_set_row_spacing(GTK_GRID(packing_table), Y_PADDING);
++    gtk_grid_set_column_spacing(GTK_GRID(packing_table), X_PADDING);
+     table_row=0;
+     if (AMITK_IS_STUDY(object))
+       label = gtk_label_new(_("View Center"));
+@@ -728,16 +707,14 @@
+     label = gtk_label_new(_("View Center (mm from origin)"));
+   else
+     label = gtk_label_new(_("Center Location (mm from origin)"));
+-  gtk_table_attach(GTK_TABLE(packing_table), label, 0,2,
+-		   table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), label, 0, table_row, 2, 1);
+   gtk_widget_show(label);
+   table_row++;
+ 
+   /* location, and dimensions for data set's */
+   for (i_axis=0; i_axis<AMITK_AXIS_NUM; i_axis++) {
+     label = gtk_label_new(amitk_axis_get_name(i_axis));
+-    gtk_table_attach(GTK_TABLE(packing_table), label, 0,1,
+-		     table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(packing_table), label, 0, table_row, 1, 1);
+     gtk_widget_show(label);
+     
+     dialog->center_spin[i_axis] = 
+@@ -748,8 +725,8 @@
+ 		     G_CALLBACK(dialog_change_center_cb), dialog);
+     g_signal_connect(G_OBJECT(dialog->center_spin[i_axis]), "output",
+ 		     G_CALLBACK(amitk_spin_button_scientific_output), NULL);
+-    gtk_table_attach(GTK_TABLE(packing_table), dialog->center_spin[i_axis],1,2,
+-		     table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(packing_table), dialog->center_spin[i_axis],
++                    1, table_row, 1, 1);
+     gtk_widget_show(dialog->center_spin[i_axis]);
+     
+     table_row++;
+@@ -757,8 +734,7 @@
+ 
+   if (AMITK_IS_STUDY(object)) {
+     button = gtk_button_new_with_label("Shift all objects so view center is origin");
+-    gtk_table_attach(GTK_TABLE(packing_table), button, 0,3,
+-		     table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(packing_table), button, 0, table_row, 3, 1);
+     g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(dialog_set_view_center_to_origin_cb), object);
+     gtk_widget_show(button);
+     table_row++;
+@@ -766,16 +742,14 @@
+   }
+   
+   /* a separator for clarity */
+-  hseparator = gtk_hseparator_new();
+-  gtk_table_attach(GTK_TABLE(packing_table), hseparator, 0, 5, table_row, table_row+1,
+-		   GTK_FILL, 0, X_PADDING, Y_PADDING);
++  hseparator = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
++  gtk_grid_attach(GTK_GRID(packing_table), hseparator, 0, table_row, 5, 1);
+   gtk_widget_show(hseparator);
+   table_row++;
+ 
+   /* a canvas to indicate which way is x, y, and z */
+   axis_indicator = ui_common_create_view_axis_indicator(layout);
+-  gtk_table_attach(GTK_TABLE(packing_table), axis_indicator,0,5,
+-		   table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), axis_indicator, 0, table_row, 5, 1);
+   gtk_widget_show(axis_indicator);
+   
+   table_row++;
+@@ -790,22 +764,22 @@
+   if (AMITK_IS_DATA_SET(object)) {
+ 
+     /* the next page of options */
+-    packing_table = gtk_table_new(4,2,FALSE);
++    packing_table = gtk_grid_new();
++    gtk_grid_set_row_spacing(GTK_GRID(packing_table), Y_PADDING);
++    gtk_grid_set_column_spacing(GTK_GRID(packing_table), X_PADDING);
+     table_row=0;
+     label = gtk_label_new(_("Voxel Size"));
+     gtk_notebook_append_page(GTK_NOTEBOOK(notebook), packing_table, label);
+     gtk_widget_show(label);
+ 
+     label = gtk_label_new(_("Voxel Size (mm)"));
+-    gtk_table_attach(GTK_TABLE(packing_table), label, 0,2,
+-		     table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(packing_table), label, 0, table_row, 2, 1);
+     gtk_widget_show(label);
+     table_row++;
+       
+     for (i_axis=0; i_axis<AMITK_AXIS_NUM; i_axis++) {
+       label = gtk_label_new(amitk_axis_get_name(i_axis));
+-      gtk_table_attach(GTK_TABLE(packing_table), label, 0,1,
+-		       table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++      gtk_grid_attach(GTK_GRID(packing_table), label, 0, table_row, 1, 1);
+       gtk_widget_show(label);
+ 
+       dialog->voxel_size_spin[i_axis] = 
+@@ -817,8 +791,8 @@
+ 		       G_CALLBACK(dialog_change_voxel_size_cb), dialog);
+       g_signal_connect(G_OBJECT(dialog->voxel_size_spin[i_axis]), "output",
+ 		       G_CALLBACK(amitk_spin_button_scientific_output), NULL);
+-      gtk_table_attach(GTK_TABLE(packing_table), dialog->voxel_size_spin[i_axis],1,2,
+-		       table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++      gtk_grid_attach(GTK_GRID(packing_table), dialog->voxel_size_spin[i_axis],
++                      1, table_row, 1, 1);
+       gtk_widget_show(dialog->voxel_size_spin[i_axis]);
+       table_row++;
+     }	
+@@ -827,8 +801,7 @@
+     gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check_button), 
+ 				 dialog->aspect_ratio);
+     g_signal_connect(G_OBJECT(check_button), "toggled", G_CALLBACK(dialog_aspect_ratio_cb), dialog);
+-    gtk_table_attach(GTK_TABLE(packing_table), check_button,1,2,
+-		     table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(packing_table), check_button, 1, table_row, 1, 1);
+     gtk_widget_show(check_button);
+     table_row++;
+ 
+@@ -848,7 +821,9 @@
+ 	(AMITK_ROI_TYPE(object) != AMITK_ROI_TYPE_FREEHAND_3D)) {
+       
+       /* the next page of options */
+-      packing_table = gtk_table_new(4,2,FALSE);
++      packing_table = gtk_grid_new();
++      gtk_grid_set_row_spacing(GTK_GRID(packing_table), Y_PADDING);
++      gtk_grid_set_column_spacing(GTK_GRID(packing_table), X_PADDING);
+       table_row=0;
+       label = gtk_label_new(_("Dimensions"));
+       gtk_notebook_append_page(GTK_NOTEBOOK(notebook), packing_table, label);
+@@ -856,8 +831,7 @@
+ 
+       /* widgets to change the dimensions of the objects (in object's space) */
+       label = gtk_label_new(_("Dimensions (mm) wrt to ROI"));
+-      gtk_table_attach(GTK_TABLE(packing_table), label, 0,2,
+-		       table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++      gtk_grid_attach(GTK_GRID(packing_table), label, 0, table_row, 2, 1);
+       gtk_widget_show(label);
+       table_row++;
+       
+@@ -868,8 +842,7 @@
+ 	
+ 	  /**************/
+ 	  label = gtk_label_new(amitk_axis_get_name(i_axis));
+-	  gtk_table_attach(GTK_TABLE(packing_table), label, 0,1,
+-			   table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++	  gtk_grid_attach(GTK_GRID(packing_table), label, 0, table_row, 1, 1);
+ 	  gtk_widget_show(label);
+ 	
+ 	  dialog->dimension_spin[i_axis] = 
+@@ -880,8 +853,8 @@
+ 			   G_CALLBACK(dialog_change_dim_cb), dialog);
+ 	  g_signal_connect(G_OBJECT(dialog->dimension_spin[i_axis]), "output",
+ 			   G_CALLBACK(amitk_spin_button_scientific_output), NULL);
+-	  gtk_table_attach(GTK_TABLE(packing_table), dialog->dimension_spin[i_axis],1,2,
+-			   table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++	  gtk_grid_attach(GTK_GRID(packing_table),
++			  dialog->dimension_spin[i_axis], 1, table_row, 1, 1);
+ 	  gtk_widget_show(dialog->dimension_spin[i_axis]);
+ 	  table_row++;
+ 	}
+@@ -933,7 +906,9 @@
+ 
+     /* start making the page to adjust time values */
+     label = gtk_label_new(_("Time/Gate"));
+-    packing_table = gtk_table_new(4,5,FALSE);
++    packing_table = gtk_grid_new();
++    gtk_grid_set_row_spacing(GTK_GRID(packing_table), X_PADDING);
++    gtk_grid_set_column_spacing(GTK_GRID(packing_table), Y_PADDING);
+     gtk_notebook_append_page(GTK_NOTEBOOK(notebook), packing_table, label);
+     table_row=0;
+     gtk_widget_show(label);
+@@ -941,39 +916,35 @@
+ 
+     /* scan start time..... */
+     label = gtk_label_new(_("Scan Start Time (s)"));
+-    gtk_table_attach(GTK_TABLE(packing_table),label, 0,1,
+-		     table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(packing_table), label, 0, table_row, 1, 1);
+     gtk_widget_show(label);
+ 
+     dialog->start_spin = gtk_spin_button_new_with_range(-G_MAXDOUBLE, G_MAXDOUBLE, 1.0);
+     gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(dialog->start_spin), FALSE);
+-    g_signal_connect(GTK_OBJECT(dialog->start_spin), "value_changed", 
++    g_signal_connect(dialog->start_spin, "value_changed",
+ 		     G_CALLBACK(dialog_change_scan_start_cb), dialog);
+     g_signal_connect(G_OBJECT(dialog->start_spin), "output",
+ 		     G_CALLBACK(amitk_spin_button_scientific_output), NULL);
+-    gtk_table_attach(GTK_TABLE(packing_table), dialog->start_spin,1,2,
+-		     table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(packing_table), dialog->start_spin,
++                    1, table_row, 1, 1);
+     gtk_widget_show(dialog->start_spin);
+     table_row++;
+ 
+ 
+     /* a separator for clarity */
+-    hseparator = gtk_hseparator_new();
+-    gtk_table_attach(GTK_TABLE(packing_table), hseparator,0,2,
+-		     table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++    hseparator = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
++    gtk_grid_attach(GTK_GRID(packing_table), hseparator, 0, table_row, 2, 1);
+     gtk_widget_show(hseparator);
+     table_row++;
+ 
+ 
+     /* frame duration(s).... */
+     label = gtk_label_new(_("Frame"));
+-    gtk_table_attach(GTK_TABLE(packing_table), label, 0,1,
+-		     table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(packing_table), label, 0, table_row, 1, 1);
+     gtk_widget_show(label);
+ 
+     label = gtk_label_new(_("Duration (s)"));
+-    gtk_table_attach(GTK_TABLE(packing_table), label, 1,2,
+-		     table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(packing_table), label, 1, table_row, 1, 1);
+     gtk_widget_show(label);
+     table_row++;
+ 
+@@ -982,12 +953,17 @@
+     gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled),
+ 				   GTK_POLICY_NEVER,
+ 				   GTK_POLICY_AUTOMATIC);
+-    secondary_table = gtk_table_new(AMITK_DATA_SET_NUM_FRAMES(object),2,TRUE);
+-    gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrolled), secondary_table);
++    gtk_widget_set_vexpand(scrolled, TRUE);
++    secondary_table = gtk_grid_new();
++    gtk_grid_set_row_homogeneous(GTK_GRID(secondary_table), TRUE);
++    gtk_grid_set_column_homogeneous(GTK_GRID(secondary_table), TRUE);
++    gtk_grid_set_row_spacing(GTK_GRID(secondary_table), Y_PADDING);
++    gtk_grid_set_column_spacing(GTK_GRID(secondary_table), X_PADDING);
++    gtk_widget_set_valign(secondary_table, GTK_ALIGN_START);
++    gtk_container_add(GTK_CONTAINER(scrolled), secondary_table);
+     gtk_widget_show(secondary_table);
+ 
+-    gtk_table_attach(GTK_TABLE(packing_table), scrolled, 0,2,
+-		     table_row, table_row+1, 0, GTK_FILL|GTK_EXPAND, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(packing_table), scrolled, 0, table_row, 2, 1);
+ 
+     /* get memory for the spin buttons */
+     dialog->duration_spins = g_try_new(GtkWidget *,AMITK_DATA_SET_NUM_FRAMES(object));
+@@ -999,7 +975,7 @@
+       temp_string = g_strdup_printf("%d", i);
+       label = gtk_label_new(temp_string);
+       g_free(temp_string);
+-      gtk_table_attach(GTK_TABLE(secondary_table), label, 0,1, i, i+1, 0, 0, X_PADDING, Y_PADDING);
++      gtk_grid_attach(GTK_GRID(secondary_table), label, 0, i, 1, 1);
+       gtk_widget_show(label);
+       
+       /* and this frame's spin_button */
+@@ -1012,8 +988,8 @@
+ 		       G_CALLBACK(dialog_change_frame_duration_cb), dialog);
+       g_signal_connect(G_OBJECT(dialog->duration_spins[i]), "output",
+ 		       G_CALLBACK(amitk_spin_button_scientific_output), NULL);
+-      gtk_table_attach(GTK_TABLE(secondary_table), dialog->duration_spins[i],1,2,
+-		       i, i+1, 0, 0, X_PADDING, Y_PADDING);
++      gtk_grid_attach(GTK_GRID(secondary_table), dialog->duration_spins[i],
++                      1, i, 1, 1);
+       gtk_widget_show(dialog->duration_spins[i]);
+       
+     }
+@@ -1022,9 +998,8 @@
+ 
+ 
+     /* a separator for clarity */
+-    vseparator = gtk_vseparator_new();
+-    gtk_table_attach(GTK_TABLE(packing_table), vseparator,2,3,
+-		     0, table_row+1, GTK_FILL, GTK_FILL, X_PADDING, Y_PADDING);
++    vseparator = gtk_separator_new(GTK_ORIENTATION_VERTICAL);
++    gtk_grid_attach(GTK_GRID(packing_table), vseparator, 2, 0, 1, table_row+1);
+     gtk_widget_show(vseparator);
+     table_row=0;
+ 
+@@ -1034,13 +1009,11 @@
+     
+     /* gate time(s).... */
+     label = gtk_label_new(_("Gate"));
+-    gtk_table_attach(GTK_TABLE(packing_table), label, 3,4,
+-		     table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(packing_table), label, 3, table_row, 1, 1);
+     gtk_widget_show(label);
+ 
+     label = gtk_label_new(_("Trigger Time (s)"));
+-    gtk_table_attach(GTK_TABLE(packing_table), label, 4,5,
+-		     table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(packing_table), label, 4, table_row, 1, 1);
+     gtk_widget_show(label);
+     table_row++;
+ 
+@@ -1049,12 +1022,17 @@
+     gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled),
+ 				   GTK_POLICY_NEVER,
+ 				   GTK_POLICY_AUTOMATIC);
+-    secondary_table = gtk_table_new(AMITK_DATA_SET_NUM_GATES(object),2,TRUE);
+-    gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrolled), secondary_table);
++    gtk_widget_set_vexpand(scrolled, TRUE);
++    secondary_table = gtk_grid_new();
++    gtk_grid_set_row_homogeneous(GTK_GRID(secondary_table), TRUE);
++    gtk_grid_set_column_homogeneous(GTK_GRID(secondary_table), TRUE);
++    gtk_grid_set_row_spacing(GTK_GRID(secondary_table), Y_PADDING);
++    gtk_grid_set_column_spacing(GTK_GRID(secondary_table), X_PADDING);
++    gtk_widget_set_valign(secondary_table, GTK_ALIGN_START);
++    gtk_container_add(GTK_CONTAINER(scrolled), secondary_table);
+     gtk_widget_show(secondary_table);
+ 
+-    gtk_table_attach(GTK_TABLE(packing_table), scrolled, 3,5,
+-		     table_row, table_row+1, 0, GTK_FILL|GTK_EXPAND, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(packing_table), scrolled, 3, table_row, 2, 1);
+ 
+     /* get memory for the spin buttons */
+     dialog->gate_spins = g_try_new(GtkWidget *,AMITK_DATA_SET_NUM_GATES(object));
+@@ -1066,7 +1044,7 @@
+       temp_string = g_strdup_printf("%d", i);
+       label = gtk_label_new(temp_string);
+       g_free(temp_string);
+-      gtk_table_attach(GTK_TABLE(secondary_table), label, 0,1, i, i+1, 0, 0, X_PADDING, Y_PADDING);
++      gtk_grid_attach(GTK_GRID(secondary_table), label, 0, i, 1, 1);
+       gtk_widget_show(label);
+       
+       /* and this gates spin_button */
+@@ -1078,8 +1056,8 @@
+ 		       G_CALLBACK(dialog_change_gate_time_cb), dialog);
+       g_signal_connect(G_OBJECT(dialog->gate_spins[i]), "output",
+ 		       G_CALLBACK(amitk_spin_button_scientific_output), NULL);
+-      gtk_table_attach(GTK_TABLE(secondary_table), dialog->gate_spins[i],1,2,
+-		       i, i+1, 0, 0, X_PADDING, Y_PADDING);
++      gtk_grid_attach(GTK_GRID(secondary_table), dialog->gate_spins[i],
++                      1, i, 1, 1);
+       gtk_widget_show(dialog->gate_spins[i]);
+       
+     }
+@@ -1094,7 +1072,9 @@
+      ---------------------------------------- */
+   if (AMITK_IS_STUDY(object) || AMITK_IS_DATA_SET(object)) {
+ 
+-    packing_table = gtk_table_new(4,2,FALSE);
++    packing_table = gtk_grid_new();
++    gtk_grid_set_row_spacing(GTK_GRID(packing_table), Y_PADDING);
++    gtk_grid_set_column_spacing(GTK_GRID(packing_table), X_PADDING);
+     if (AMITK_IS_STUDY(object))
+       label = gtk_label_new(_("ROI/View Preferences"));
+     else /* AMITK_IS_DATA_SET */
+@@ -1108,12 +1088,7 @@
+       ui_common_study_preferences_widgets(packing_table, table_row,
+ 					  &(dialog->roi_width_spin),
+ 					  &(dialog->roi_item), 
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+ 					  &(dialog->roi_transparency_spin),
+-#else
+-					  &(dialog->line_style_menu),
+-					  &(dialog->fill_roi_button),
+-#endif
+ 					  &(dialog->layout_button1), 
+ 					  &(dialog->layout_button2), 
+ 					  &(dialog->panel_layout_button1), 
+@@ -1125,15 +1100,8 @@
+ 
+       g_signal_connect(G_OBJECT(dialog->roi_width_spin), "value_changed",  
+ 		       G_CALLBACK(dialog_change_roi_width_cb), dialog);
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+       g_signal_connect(G_OBJECT(dialog->roi_transparency_spin), "value_changed",  
+ 		       G_CALLBACK(dialog_change_roi_transparency_cb), dialog);
+-#else
+-      g_signal_connect(G_OBJECT(dialog->line_style_menu), "changed", 
+-		       G_CALLBACK(dialog_change_line_style_cb), dialog);
+-      g_signal_connect(G_OBJECT(dialog->fill_roi_button), "toggled", 
+-		       G_CALLBACK(dialog_change_fill_roi_cb), dialog);
+-#endif
+       g_signal_connect(G_OBJECT(dialog->layout_button1), "clicked", 
+ 		       G_CALLBACK(dialog_change_layout_cb), dialog);
+       g_signal_connect(G_OBJECT(dialog->layout_button2), "clicked", 
+@@ -1160,11 +1128,11 @@
+ 				     GTK_POLICY_AUTOMATIC);
+ 
+       windows_widget = amitk_window_edit_new(AMITK_DATA_SET(object), NULL);
+-      gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrolled), windows_widget);
++      gtk_container_add(GTK_CONTAINER(scrolled), windows_widget);
+       gtk_widget_show(windows_widget);
+ 
+-      gtk_table_attach(GTK_TABLE(packing_table), scrolled, 0,4,
+-		       table_row, table_row+1, 0, GTK_FILL|GTK_EXPAND, X_PADDING, Y_PADDING);
++      gtk_widget_set_vexpand(scrolled, TRUE);
++      gtk_grid_attach(GTK_GRID(packing_table), scrolled, 0, table_row, 4, 1);
+       gtk_widget_show(scrolled);
+ 
+     }
+@@ -1178,12 +1146,13 @@
+      ---------------------------------------- */
+   if (AMITK_IS_ROI(object) || AMITK_IS_FIDUCIAL_MARK(object)) {
+     rgba_t color_rgba;
+-    GdkColor color_gdk;
+-    guint16 alpha_gdk;
++    GdkRGBA rgba;
+     GtkWidget * color_sel;
+ 
+ 
+-    packing_table = gtk_table_new(2,2,FALSE);
++    packing_table = gtk_grid_new();
++    gtk_grid_set_row_spacing(GTK_GRID(packing_table), Y_PADDING);
++    gtk_grid_set_column_spacing(GTK_GRID(packing_table), X_PADDING);
+     label = gtk_label_new(_("Color"));
+     table_row=0;
+     gtk_notebook_append_page(GTK_NOTEBOOK(notebook), packing_table, label);
+@@ -1194,27 +1163,22 @@
+ 				 AMITK_IS_ROI(object) ? AMITK_ROI_SPECIFY_COLOR(object) :
+ 				 AMITK_FIDUCIAL_MARK_SPECIFY_COLOR(object));
+     g_signal_connect(G_OBJECT(check_button), "toggled", G_CALLBACK(dialog_specify_color_cb), dialog);
+-    gtk_table_attach(GTK_TABLE(packing_table), check_button,0,1,
+-		     table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(packing_table), check_button, 0, table_row, 1, 1);
+     gtk_widget_show(check_button);
+     table_row++;
+ 
+     
+     color_rgba = AMITK_IS_ROI(object) ? AMITK_ROI_COLOR(object) : AMITK_FIDUCIAL_MARK_COLOR(object);
+-    color_gdk.red = color_rgba.r << 8;
+-    color_gdk.green = color_rgba.g << 8;
+-    color_gdk.blue = color_rgba.b << 8;
+-    alpha_gdk = color_rgba.a << 8;
+-  
+-
+-    color_sel = gtk_color_selection_new();
+-    gtk_color_selection_set_has_opacity_control(GTK_COLOR_SELECTION(color_sel), TRUE);
+-    gtk_color_selection_set_has_palette(GTK_COLOR_SELECTION(color_sel), TRUE);
+-    gtk_color_selection_set_current_alpha(GTK_COLOR_SELECTION(color_sel), alpha_gdk);
+-    gtk_color_selection_set_current_color(GTK_COLOR_SELECTION(color_sel), &color_gdk);
+-    g_signal_connect(G_OBJECT(color_sel), "color_changed", G_CALLBACK(dialog_change_color_cb), dialog);
+-    gtk_table_attach(GTK_TABLE(packing_table), color_sel, 0, 2,
+-		     table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++    rgba.red = CLAMP(color_rgba.r / 255., 0., 1.);
++    rgba.green = CLAMP(color_rgba.g / 255., 0., 1.);
++    rgba.blue = CLAMP(color_rgba.b / 255., 0., 1.);
++    rgba.alpha = CLAMP(color_rgba.a / 255., 0., 1.);
++
++    color_sel = gtk_color_chooser_widget_new();
++    gtk_color_chooser_set_use_alpha(GTK_COLOR_CHOOSER(color_sel), TRUE);
++    gtk_color_chooser_set_rgba(GTK_COLOR_CHOOSER(color_sel), &rgba);
++    g_signal_connect(color_sel, "color-activated", G_CALLBACK(dialog_change_color_cb), dialog);
++    gtk_grid_attach(GTK_GRID(packing_table), color_sel, 0, table_row, 2, 1);
+     gtk_widget_show(color_sel);
+     table_row++;
+ 
+@@ -1239,7 +1203,9 @@
+     
+   if (immutables) {
+ 
+-    packing_table = gtk_table_new(12,5,FALSE);
++    packing_table = gtk_grid_new();
++    gtk_grid_set_row_spacing(GTK_GRID(packing_table), Y_PADDING);
++    gtk_grid_set_column_spacing(GTK_GRID(packing_table), X_PADDING);
+     label = gtk_label_new(_("Immutables"));
+     table_row=0;
+     gtk_notebook_append_page(GTK_NOTEBOOK(notebook), packing_table, label);
+@@ -1247,14 +1213,13 @@
+     
+     if (AMITK_IS_STUDY(object)) {
+       label = gtk_label_new(_("Max-Min Voxel Dim"));
+-      gtk_table_attach(GTK_TABLE(packing_table), label, 0,1,
+-		       table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++      gtk_grid_attach(GTK_GRID(packing_table), label, 0, table_row, 1, 1);
+       gtk_widget_show(label);
+       
+       dialog->voxel_dim_entry = gtk_entry_new();
+       gtk_editable_set_editable(GTK_EDITABLE(dialog->voxel_dim_entry), FALSE);
+-      gtk_table_attach(GTK_TABLE(packing_table), dialog->voxel_dim_entry,1,2,
+-		       table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++      gtk_grid_attach(GTK_GRID(packing_table), dialog->voxel_dim_entry,
++                      1, table_row, 1, 1);
+       gtk_widget_show(dialog->voxel_dim_entry);
+       
+       table_row++;
+@@ -1263,27 +1228,25 @@
+       if (AMITK_ROI_TYPE_ISOCONTOUR(object)) {
+ 
+ 	label = gtk_label_new(_("Isocontour Min Specified Value"));
+-	gtk_table_attach(GTK_TABLE(packing_table), label, 0,1,
+-			 table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++	gtk_grid_attach(GTK_GRID(packing_table), label, 0, table_row, 1, 1);
+ 	gtk_widget_show(label);
+ 	
+ 	dialog->isocontour_min_value_entry = gtk_entry_new();
+ 	gtk_editable_set_editable(GTK_EDITABLE(dialog->isocontour_min_value_entry), FALSE);
+-	gtk_table_attach(GTK_TABLE(packing_table), dialog->isocontour_min_value_entry,1,2,
+-			 table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++	gtk_grid_attach(GTK_GRID(packing_table),
++			dialog->isocontour_min_value_entry, 1, table_row, 1, 1);
+ 	gtk_widget_show(dialog->isocontour_min_value_entry);
+ 	
+ 	table_row++;
+ 
+ 	label = gtk_label_new(_("Isocontour Max Specified Value"));
+-	gtk_table_attach(GTK_TABLE(packing_table), label, 0,1,
+-			 table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++	gtk_grid_attach(GTK_GRID(packing_table), label, 0, table_row, 1, 1);
+ 	gtk_widget_show(label);
+ 	
+ 	dialog->isocontour_max_value_entry = gtk_entry_new();
+ 	gtk_editable_set_editable(GTK_EDITABLE(dialog->isocontour_max_value_entry), FALSE);
+-	gtk_table_attach(GTK_TABLE(packing_table), dialog->isocontour_max_value_entry,1,2,
+-			 table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++	gtk_grid_attach(GTK_GRID(packing_table),
++			dialog->isocontour_max_value_entry, 1, table_row, 1, 1);
+ 	gtk_widget_show(dialog->isocontour_max_value_entry);
+ 	
+ 	table_row++;
+@@ -1329,8 +1292,7 @@
+ 	label = gtk_label_new(_("Memory Used (bytes):"));
+ 	break;
+       }
+-      gtk_table_attach(GTK_TABLE(packing_table), label, 0,1,
+-		       table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++      gtk_grid_attach(GTK_GRID(packing_table), label, 0, table_row, 1, 1);
+       gtk_widget_show(label);
+       
+       entry = gtk_entry_new();
+@@ -1338,62 +1300,53 @@
+       gtk_entry_set_text(GTK_ENTRY(entry), temp_string);
+       g_free(temp_string);
+       gtk_editable_set_editable(GTK_EDITABLE(entry), FALSE);
+-      gtk_table_attach(GTK_TABLE(packing_table), entry,
+-		       1,2, table_row, table_row+1, 
+-		       GTK_FILL, 0, X_PADDING, Y_PADDING);
++      gtk_grid_attach(GTK_GRID(packing_table), entry, 1, table_row, 1, 1);
+       gtk_widget_show(entry);
+       table_row++;
+       
+       /* widget to tell you the internal data format */
+       label = gtk_label_new(_("Data Format:"));
+-      gtk_table_attach(GTK_TABLE(packing_table), label, 0,1,
+-		       table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++      gtk_grid_attach(GTK_GRID(packing_table), label, 0, table_row, 1, 1);
+       gtk_widget_show(label);
+       
+       entry = gtk_entry_new();
+       gtk_entry_set_text(GTK_ENTRY(entry), 
+ 			 amitk_format_names[AMITK_DATA_SET_FORMAT(object)]);
+       gtk_editable_set_editable(GTK_EDITABLE(entry), FALSE);
+-      gtk_table_attach(GTK_TABLE(packing_table), entry,
+-		       1,2, table_row, table_row+1, 
+-		       GTK_FILL, 0, X_PADDING, Y_PADDING);
++      gtk_grid_attach(GTK_GRID(packing_table), entry, 1, table_row, 1, 1);
+       gtk_widget_show(entry);
+       table_row++;
+       
+       /* a separator for clarity */
+-      hseparator = gtk_hseparator_new();
+-      gtk_table_attach(GTK_TABLE(packing_table), hseparator,0,2,
+-		       table_row, table_row+1, GTK_FILL, GTK_FILL, X_PADDING, Y_PADDING);
++      hseparator = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
++      gtk_widget_set_valign(hseparator, GTK_ALIGN_CENTER);
++      gtk_grid_attach(GTK_GRID(packing_table), hseparator, 0, table_row, 2, 1);
+       gtk_widget_show(hseparator);
+       table_row++;
+       
+       /* widget to tell you the scaling format */
+       label = gtk_label_new(_("Scale Format:"));
+-      gtk_table_attach(GTK_TABLE(packing_table), label, 0,1,
+-		       table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++      gtk_grid_attach(GTK_GRID(packing_table), label, 0, table_row, 1, 1);
+       gtk_widget_show(label);
+       
+       entry = gtk_entry_new();
+       gtk_entry_set_text(GTK_ENTRY(entry), 
+ 			 amitk_scaling_menu_names[AMITK_DATA_SET_SCALING_TYPE(object)]);
+       gtk_editable_set_editable(GTK_EDITABLE(entry), FALSE);
+-      gtk_table_attach(GTK_TABLE(packing_table), entry,
+-		       1,2, table_row, table_row+1, 
+-		       GTK_FILL, 0, X_PADDING, Y_PADDING);
++      gtk_grid_attach(GTK_GRID(packing_table), entry, 1, table_row, 1, 1);
+       gtk_widget_show(entry);
+       table_row++;
+       
+       /* a separator for clarity */
+-      hseparator = gtk_hseparator_new();
+-      gtk_table_attach(GTK_TABLE(packing_table), hseparator,0,2,
+-		       table_row, table_row+1, GTK_FILL, GTK_FILL, X_PADDING, Y_PADDING);
++      hseparator = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
++      gtk_widget_set_valign(hseparator, GTK_ALIGN_CENTER);
++      gtk_grid_attach(GTK_GRID(packing_table), hseparator, 0, table_row, 2, 1);
+       gtk_widget_show(hseparator);
+       table_row++;
+       
+       /* widgets to display the data set dimensions */
+       label = gtk_label_new(_("Data Set Dimensions (voxels)"));
+-      gtk_table_attach(GTK_TABLE(packing_table), label, 0,2,
+-		       table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++      gtk_grid_attach(GTK_GRID(packing_table), label, 0, table_row, 2, 1);
+       gtk_widget_show(label);
+       table_row++;
+       
+@@ -1401,8 +1354,7 @@
+       for (i_dim=0; i_dim < AMITK_DIM_NUM; i_dim++) {
+ 
+ 	label = gtk_label_new(amitk_dim_get_name(i_dim));
+-	gtk_table_attach(GTK_TABLE(packing_table), label, 0,1,
+-			 table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++	gtk_grid_attach(GTK_GRID(packing_table), label, 0, table_row, 1, 1);
+ 	gtk_widget_show(label);
+ 	
+ 	entry = gtk_entry_new();
+@@ -1410,25 +1362,22 @@
+ 	gtk_entry_set_text(GTK_ENTRY(entry), temp_string);
+ 	g_free(temp_string);
+ 	gtk_editable_set_editable(GTK_EDITABLE(entry), FALSE);
+-	gtk_table_attach(GTK_TABLE(packing_table), entry,1,2,
+-			 table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++	gtk_grid_attach(GTK_GRID(packing_table), entry, 1, table_row, 1, 1);
+ 	gtk_widget_show(entry);
+ 	table_row++;
+       }
+ 
+ 
+       /* a separator for clarity */
+-      vseparator = gtk_vseparator_new();
+-      gtk_table_attach(GTK_TABLE(packing_table), vseparator,2,3,
+-		       0, table_row, GTK_FILL, GTK_FILL, X_PADDING, Y_PADDING);
++      vseparator = gtk_separator_new(GTK_ORIENTATION_VERTICAL);
++      gtk_grid_attach(GTK_GRID(packing_table), vseparator, 2, 0, 1, table_row);
+       gtk_widget_show(vseparator);
+ 
+       table_row=0;
+ 
+       /* MRI parameters */
+       label = gtk_label_new(_("MRI Parameters"));
+-      gtk_table_attach(GTK_TABLE(packing_table), label, 3,5,
+-		       table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++      gtk_grid_attach(GTK_GRID(packing_table), label, 3, table_row, 2, 1);
+       gtk_widget_show(label);
+       table_row++;
+ 
+@@ -1436,8 +1385,7 @@
+ 
+       /* inversion time */
+       label = gtk_label_new(_("Inversion Time (ms):"));
+-      gtk_table_attach(GTK_TABLE(packing_table), label, 3,4,
+-		       table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++      gtk_grid_attach(GTK_GRID(packing_table), label, 3, table_row, 1, 1);
+       gtk_widget_show(label);
+       
+       entry = gtk_entry_new();
+@@ -1446,16 +1394,13 @@
+       g_free(temp_string);
+ 			 
+       gtk_editable_set_editable(GTK_EDITABLE(entry), FALSE);
+-      gtk_table_attach(GTK_TABLE(packing_table), entry,
+-		       4,5, table_row, table_row+1, 
+-		       GTK_FILL, 0, X_PADDING, Y_PADDING);
++      gtk_grid_attach(GTK_GRID(packing_table), entry, 4, table_row, 1, 1);
+       gtk_widget_show(entry);
+       table_row++;
+ 
+       /* echo time */
+       label = gtk_label_new(_("Echo Time (ms):"));
+-      gtk_table_attach(GTK_TABLE(packing_table), label, 3,4,
+-		       table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++      gtk_grid_attach(GTK_GRID(packing_table), label, 3, table_row, 1, 1);
+       gtk_widget_show(label);
+       
+       entry = gtk_entry_new();
+@@ -1464,16 +1409,13 @@
+       g_free(temp_string);
+ 			 
+       gtk_editable_set_editable(GTK_EDITABLE(entry), FALSE);
+-      gtk_table_attach(GTK_TABLE(packing_table), entry,
+-		       4,5, table_row, table_row+1, 
+-		       GTK_FILL, 0, X_PADDING, Y_PADDING);
++      gtk_grid_attach(GTK_GRID(packing_table), entry, 4, table_row, 1, 1);
+       gtk_widget_show(entry);
+       table_row++;
+ 
+       /* b factor */
+       label = gtk_label_new(_("Diffusion B Value:"));
+-      gtk_table_attach(GTK_TABLE(packing_table), label, 3,4,
+-		       table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++      gtk_grid_attach(GTK_GRID(packing_table), label, 3, table_row, 1, 1);
+       gtk_widget_show(label);
+       
+       entry = gtk_entry_new();
+@@ -1482,16 +1424,13 @@
+       g_free(temp_string);
+ 			 
+       gtk_editable_set_editable(GTK_EDITABLE(entry), FALSE);
+-      gtk_table_attach(GTK_TABLE(packing_table), entry,
+-		       4,5, table_row, table_row+1, 
+-		       GTK_FILL, 0, X_PADDING, Y_PADDING);
++      gtk_grid_attach(GTK_GRID(packing_table), entry, 4, table_row, 1, 1);
+       gtk_widget_show(entry);
+       table_row++;
+ 
+       /* diffusion direction */
+       label = gtk_label_new(_("Diffusion Direction:"));
+-      gtk_table_attach(GTK_TABLE(packing_table), label, 3,4,
+-		       table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++      gtk_grid_attach(GTK_GRID(packing_table), label, 3, table_row, 1, 1);
+       gtk_widget_show(label);
+       
+       entry = gtk_entry_new();
+@@ -1503,30 +1442,26 @@
+       g_free(temp_string);
+ 			 
+       gtk_editable_set_editable(GTK_EDITABLE(entry), FALSE);
+-      gtk_table_attach(GTK_TABLE(packing_table), entry,
+-		       4,5, table_row, table_row+1, 
+-		       GTK_FILL, 0, X_PADDING, Y_PADDING);
++      gtk_grid_attach(GTK_GRID(packing_table), entry, 4, table_row, 1, 1);
+       gtk_widget_show(entry);
+       table_row++;
+ 
+       /* a separator for clarity */
+-      hseparator = gtk_hseparator_new();
+-      gtk_table_attach(GTK_TABLE(packing_table), hseparator,3,5,
+-		       table_row, table_row+1, GTK_FILL, GTK_FILL, X_PADDING, Y_PADDING);
++      hseparator = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
++      gtk_widget_set_valign(hseparator, GTK_ALIGN_CENTER);
++      gtk_grid_attach(GTK_GRID(packing_table), hseparator, 3, table_row, 2, 1);
+       gtk_widget_show(hseparator);
+       table_row++;
+ 
+       /* additional parameters */
+       label = gtk_label_new(_("Misc. Parameters"));
+-      gtk_table_attach(GTK_TABLE(packing_table), label, 3,5,
+-		       table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++      gtk_grid_attach(GTK_GRID(packing_table), label, 3, table_row, 2, 1);
+       gtk_widget_show(label);
+       table_row++;
+ 
+       /* series number */
+       label = gtk_label_new(_("Series Number:"));
+-      gtk_table_attach(GTK_TABLE(packing_table), label, 3,4,
+-		       table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++      gtk_grid_attach(GTK_GRID(packing_table), label, 3, table_row, 1, 1);
+       gtk_widget_show(label);
+       
+       entry = gtk_entry_new();
+@@ -1535,16 +1470,13 @@
+       g_free(temp_string);
+ 			 
+       gtk_editable_set_editable(GTK_EDITABLE(entry), FALSE);
+-      gtk_table_attach(GTK_TABLE(packing_table), entry,
+-		       4,5, table_row, table_row+1, 
+-		       GTK_FILL, 0, X_PADDING, Y_PADDING);
++      gtk_grid_attach(GTK_GRID(packing_table), entry, 4, table_row, 1, 1);
+       gtk_widget_show(entry);
+       table_row++;
+ 
+       /* dicom image type */
+       label = gtk_label_new(_("Dicom Image Type:"));
+-      gtk_table_attach(GTK_TABLE(packing_table), label, 3,4,
+-		       table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++      gtk_grid_attach(GTK_GRID(packing_table), label, 3, table_row, 1, 1);
+       gtk_widget_show(label);
+       
+       entry = gtk_entry_new();
+@@ -1552,9 +1484,7 @@
+ 	gtk_entry_set_text(GTK_ENTRY(entry), AMITK_DATA_SET_DICOM_IMAGE_TYPE(object));
+ 			 
+       gtk_editable_set_editable(GTK_EDITABLE(entry), FALSE);
+-      gtk_table_attach(GTK_TABLE(packing_table), entry,
+-		       4,5, table_row, table_row+1, 
+-		       GTK_FILL, 0, X_PADDING, Y_PADDING);
++      gtk_grid_attach(GTK_GRID(packing_table), entry, 4, table_row, 1, 1);
+       gtk_widget_show(entry);
+       table_row++;
+     }
+@@ -1737,19 +1667,9 @@
+       gtk_spin_button_set_value(GTK_SPIN_BUTTON(dialog->roi_width_spin), AMITK_STUDY_CANVAS_ROI_WIDTH(dialog->object));
+       g_signal_handlers_unblock_by_func(G_OBJECT(dialog->roi_width_spin),  G_CALLBACK(dialog_change_roi_width_cb), dialog);
+ 
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+       g_signal_handlers_block_by_func(G_OBJECT(dialog->roi_transparency_spin),  G_CALLBACK(dialog_change_roi_transparency_cb), dialog);
+       gtk_spin_button_set_value(GTK_SPIN_BUTTON(dialog->roi_transparency_spin), AMITK_STUDY_CANVAS_ROI_TRANSPARENCY(dialog->object));
+       g_signal_handlers_unblock_by_func(G_OBJECT(dialog->roi_transparency_spin),  G_CALLBACK(dialog_change_roi_transparency_cb), dialog);
+-#else
+-      g_signal_handlers_block_by_func(G_OBJECT(dialog->line_style_menu), G_CALLBACK(dialog_change_line_style_cb), dialog);
+-      gtk_combo_box_set_active(GTK_COMBO_BOX(dialog->line_style_menu), AMITK_STUDY_CANVAS_LINE_STYLE(dialog->object));
+-      g_signal_handlers_unblock_by_func(G_OBJECT(dialog->line_style_menu), G_CALLBACK(dialog_change_line_style_cb), dialog);
+-      g_signal_handlers_block_by_func(G_OBJECT(dialog->fill_roi_button), G_CALLBACK(dialog_change_fill_roi_cb), dialog);
+-      gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->fill_roi_button), 
+-				   AMITK_STUDY_CANVAS_FILL_ROI(dialog->object));
+-      g_signal_handlers_unblock_by_func(G_OBJECT(dialog->fill_roi_button), G_CALLBACK(dialog_change_fill_roi_cb), dialog);
+-#endif
+ 
+       g_signal_handlers_block_by_func(G_OBJECT(dialog->layout_button1), G_CALLBACK(dialog_change_layout_cb), dialog);
+       g_signal_handlers_block_by_func(G_OBJECT(dialog->layout_button2),  G_CALLBACK(dialog_change_layout_cb), dialog);
+@@ -1860,8 +1780,6 @@
+   for (i_interpolation=0; i_interpolation < AMITK_INTERPOLATION_NUM; i_interpolation++)
+     g_signal_handlers_block_by_func(G_OBJECT(dialog->interpolation_button[i_interpolation]),
+ 				    G_CALLBACK(dialog_change_interpolation_cb), dialog);
+-  /* need the button pressed to get the display to update correctly */
+-  gtk_button_pressed(GTK_BUTTON(dialog->interpolation_button[interpolation]));
+   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->interpolation_button[interpolation]),TRUE);
+ 
+   for (i_interpolation=0; i_interpolation < AMITK_INTERPOLATION_NUM; i_interpolation++)
+@@ -1892,8 +1810,6 @@
+   for (i_conversion=0; i_conversion < AMITK_CONVERSION_NUM; i_conversion++)
+     g_signal_handlers_block_by_func(G_OBJECT(dialog->conversion_button[i_conversion]),
+ 				    G_CALLBACK(dialog_conversion_cb), dialog);
+-  /* need the button pressed to get the display to update correctly */
+-  gtk_button_pressed(GTK_BUTTON(dialog->conversion_button[conversion]));
+   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->conversion_button[conversion]),TRUE);
+ 
+   for (i_conversion=0; i_conversion < AMITK_CONVERSION_NUM; i_conversion++)
+@@ -1928,11 +1844,7 @@
+ 
+   ui_common_update_sample_roi_item(dialog->roi_item,
+ 				   AMITK_STUDY_CANVAS_ROI_WIDTH(dialog->object),
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+ 				   AMITK_STUDY_CANVAS_ROI_TRANSPARENCY(dialog->object)
+-#else
+-				   AMITK_STUDY_CANVAS_LINE_STYLE(dialog->object)
+-#endif
+ 				   );
+   
+   return;
+@@ -2493,7 +2405,6 @@
+   return;
+ }
+ 
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+ static void dialog_change_roi_transparency_cb(GtkWidget * widget, gpointer data){
+   AmitkObjectDialog * dialog = data;
+   g_return_if_fail(AMITK_IS_STUDY(dialog->object));
+@@ -2503,24 +2414,6 @@
+   return;
+ }
+ 
+-#else
+-static void dialog_change_line_style_cb(GtkWidget * widget, gpointer data) {
+-  AmitkObjectDialog * dialog = data;
+-  g_return_if_fail(AMITK_IS_STUDY(dialog->object));
+-  amitk_study_set_canvas_line_style(AMITK_STUDY(dialog->object), 
+-				    gtk_combo_box_get_active(GTK_COMBO_BOX(widget)));
+-  return;
+-}
+-
+-static void dialog_change_fill_roi_cb(GtkWidget * widget, gpointer data) {
+-  AmitkObjectDialog * dialog = data;
+-  g_return_if_fail(AMITK_IS_STUDY(dialog->object));
+-  amitk_study_set_canvas_fill_roi(AMITK_STUDY(dialog->object),
+-				  gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)));
+-  return;
+-}
+-#endif
+-
+ static void dialog_change_layout_cb(GtkWidget * widget, gpointer data) {
+   AmitkObjectDialog * dialog = data;
+   AmitkLayout new_layout;
+@@ -2571,20 +2464,14 @@
+   return;
+ }
+ 
+-static void dialog_change_color_cb(GtkWidget * widget, gpointer data) {
++static void dialog_change_color_cb(GtkWidget * widget, GdkRGBA *rgba, gpointer data) {
+   AmitkObjectDialog * dialog = data;
+   rgba_t new_color;
+-  GdkColor color_gdk;
+-  guint16 alpha;
+-
+-
+-  gtk_color_selection_get_current_color(GTK_COLOR_SELECTION(widget), &color_gdk);
+-  alpha = gtk_color_selection_get_current_alpha(GTK_COLOR_SELECTION(widget));
+ 
+-  new_color.r = color_gdk.red >> 8;
+-  new_color.g = color_gdk.green >> 8;
+-  new_color.b = color_gdk.blue >> 8;
+-  new_color.a = alpha >> 8;
++  new_color.r = (int)(0.5 + CLAMP(rgba->red, 0., 1.) * 255.);
++  new_color.g = (int)(0.5 + CLAMP(rgba->green, 0., 1.) * 255.);
++  new_color.b = (int)(0.5 + CLAMP(rgba->blue, 0., 1.) * 255.);
++  new_color.a = (int)(0.5 + CLAMP(rgba->alpha, 0., 1.) * 255.);
+ 
+   if (AMITK_IS_ROI(dialog->object))
+     amitk_roi_set_color(AMITK_ROI(dialog->object), new_color);
+--- amide.orig/amide-current/src/amitk_progress_dialog.c
++++ amide/amide-current/src/amitk_progress_dialog.c
+@@ -81,18 +81,16 @@
+ static void dialog_init (AmitkProgressDialog * dialog)
+ {
+ 
+-  gtk_dialog_set_has_separator(GTK_DIALOG(dialog), FALSE);
+-
+   dialog->can_continue = TRUE;
+ 
+   dialog->message_label = gtk_label_new(NULL);
+-  gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), dialog->message_label, FALSE, FALSE, 0);
++  gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))),
++                     dialog->message_label, FALSE, FALSE, 0);
+ 
+   dialog->progress_bar = gtk_progress_bar_new();
+   gtk_progress_bar_set_pulse_step(GTK_PROGRESS_BAR(dialog->progress_bar), 0.01);
+-  gtk_progress_bar_set_orientation(GTK_PROGRESS_BAR(dialog->progress_bar), 
+-				   GTK_PROGRESS_LEFT_TO_RIGHT);
+-  gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), dialog->progress_bar, FALSE, FALSE, 0);
++  gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))),
++                     dialog->progress_bar, FALSE, FALSE, 0);
+ 
+   return;
+ }
+@@ -132,18 +130,18 @@
+ gboolean amitk_progress_dialog_set_fraction(AmitkProgressDialog * dialog, gdouble fraction) {
+ 
+   if (fraction > 1.0) {
+-    if (GTK_WIDGET_VISIBLE(dialog))
+-      gtk_widget_hide_all(GTK_WIDGET(dialog));
++    if (gtk_widget_is_visible(GTK_WIDGET(dialog)))
++      gtk_widget_hide(GTK_WIDGET(dialog));
+ 
+   } else if (fraction >= 0.0) {
+-    if (!GTK_WIDGET_VISIBLE(dialog)) {
++    if (!gtk_widget_is_visible(GTK_WIDGET(dialog))) {
+       gtk_widget_show_all(GTK_WIDGET(dialog));
+       dialog->can_continue = TRUE;
+     }
+     gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(dialog->progress_bar), fraction);
+ 
+   } else if (fraction < -0.5) {
+-    if (!GTK_WIDGET_VISIBLE(dialog)) {
++    if (!gtk_widget_is_visible(GTK_WIDGET(dialog))) {
+       gtk_widget_show_all(GTK_WIDGET(dialog));
+       dialog->can_continue = TRUE;
+     }
+@@ -165,7 +163,7 @@
+   gtk_window_set_title (GTK_WINDOW (dialog), _("Progress Dialog"));
+   gtk_window_set_transient_for(GTK_WINDOW (dialog), parent);
+   gtk_window_set_destroy_with_parent(GTK_WINDOW (dialog), TRUE);
+-  gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
++  gtk_dialog_add_button(GTK_DIALOG(dialog), _("_Cancel"), GTK_RESPONSE_CANCEL);
+ 
+   return GTK_WIDGET (dialog);
+ }
+--- amide.orig/amide-current/src/amitk_space_edit.c
++++ amide/amide-current/src/amitk_space_edit.c
+@@ -36,8 +36,9 @@
+ 
+ static void space_edit_class_init (AmitkSpaceEditClass *klass);
+ static void space_edit_init (AmitkSpaceEdit *space_edit);
+-static void space_edit_destroy(GtkObject * object);
++static void space_edit_destroy(GtkWidget * object);
+ static void space_edit_update_entries(AmitkSpaceEdit * space_edit);
++static gboolean space_edit_button_release(GtkWidget * widget, GdkEvent * event, gpointer data);
+ static void space_edit_rotate_axis(GtkAdjustment * adjustment, gpointer data);
+ static gboolean space_edit_prompt(AmitkSpaceEdit * space_edit, const gchar * message);
+ static void space_edit_apply_entries(GtkWidget * button, gpointer space_edit);
+@@ -48,7 +49,7 @@
+ static void space_edit_export_air(GtkWidget * button, gpointer data);
+ #endif
+ 
+-static GtkVBoxClass *parent_class;
++static GtkBoxClass *parent_class;
+ 
+ GType amitk_space_edit_get_type (void) {
+ 
+@@ -70,7 +71,7 @@
+ 	NULL /* value table */
+       };
+ 
+-      space_edit_type = g_type_register_static(GTK_TYPE_VBOX, "AmitkSpaceEdit", &space_edit_info, 0);
++      space_edit_type = g_type_register_static(GTK_TYPE_BOX, "AmitkSpaceEdit", &space_edit_info, 0);
+     }
+ 
+   return space_edit_type;
+@@ -80,11 +81,11 @@
+ {
+   /*  GObjectClass   *gobject_class;
+       GtkWidgetClass *widget_class; */
+-  GtkObjectClass *gtkobject_class;
++  GtkWidgetClass *gtkobject_class;
+ 
+   /*  gobject_class =   (GObjectClass *) klass;
+       widget_class =    (GtkWidgetClass*) klass; */
+-  gtkobject_class = (GtkObjectClass*) klass;
++  gtkobject_class = (GtkWidgetClass*) klass;
+ 
+   parent_class = g_type_class_peek_parent(klass);
+ 
+@@ -102,13 +103,18 @@
+   GtkWidget * hseparator;
+   guint row=0;
+   AmitkView i_view;
+-  GtkObject * adjustment;
++  GtkAdjustment * adjustment;
+   AmitkAxis i_axis, j_axis;
+ 
++  gtk_orientable_set_orientation(GTK_ORIENTABLE(space_edit),
++                                 GTK_ORIENTATION_VERTICAL);
++
+   /* initialize some critical stuff */
+   space_edit->object = NULL;
+ 
+-  table = gtk_table_new(14,5, FALSE);
++  table = gtk_grid_new();
++  gtk_grid_set_row_spacing(GTK_GRID(table), Y_PADDING);
++  gtk_grid_set_column_spacing(GTK_GRID(table), X_PADDING);
+   gtk_container_add(GTK_CONTAINER(space_edit), table);
+   gtk_widget_show(table);
+ 
+@@ -118,38 +124,37 @@
+ 
+     /* label */
+     label = gtk_label_new(amitk_view_get_name(i_view));
+-    gtk_table_attach(GTK_TABLE(table), label, 0,1, row, row+1, 0, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(table), label, 0, row, 1, 1);
+     gtk_widget_show(label);
+ 
+     /* the slider */
+     adjustment = gtk_adjustment_new(0,-45.0,45.5,0.5,0.5,0.5);
+     g_object_set_data(G_OBJECT(adjustment), "view", GINT_TO_POINTER(i_view));
+-    slider = gtk_hscale_new(GTK_ADJUSTMENT(adjustment));
+-    gtk_range_set_update_policy(GTK_RANGE(slider), GTK_UPDATE_DISCONTINUOUS);
+-    gtk_table_attach(GTK_TABLE(table), slider, 1,5, row, row+1,
+-		     X_PACKING_OPTIONS | GTK_FILL,FALSE, X_PADDING, Y_PADDING);
+-    g_signal_connect(G_OBJECT(adjustment), "value_changed", 
+-		     G_CALLBACK(space_edit_rotate_axis), space_edit);
++    slider = gtk_scale_new(GTK_ORIENTATION_HORIZONTAL, adjustment);
++    gtk_widget_set_hexpand(slider, TRUE);
++    gtk_grid_attach(GTK_GRID(table), slider, 1, row, 4, 1);
++    g_signal_connect(slider, "button-release-event",
++                     G_CALLBACK(space_edit_button_release), space_edit);
+     gtk_widget_show(slider);
+     row++;
+   }
+ 
+ 
+   /* a separator for clarity */
+-  hseparator = gtk_hseparator_new();
+-  gtk_table_attach(GTK_TABLE(table), hseparator, 0, 5, row, row+1,GTK_FILL, 0, X_PADDING, Y_PADDING);
++  hseparator = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
++  gtk_grid_attach(GTK_GRID(table), hseparator, 0, row, 5, 1);
+   row++;
+   gtk_widget_show(hseparator);
+ 
+   /* and a display of the current axis */
+   label = gtk_label_new(_("i"));
+-  gtk_table_attach(GTK_TABLE(table), label, 1,2, row, row+1, 0, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), label, 1, row, 1, 1);
+   gtk_widget_show(label);
+   label = gtk_label_new(_("j"));
+-  gtk_table_attach(GTK_TABLE(table), label, 2,3, row, row+1, 0, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), label, 2, row, 1, 1);
+   gtk_widget_show(label);
+   label = gtk_label_new(_("k"));
+-  gtk_table_attach(GTK_TABLE(table), label, 3,4, row, row+1, 0, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), label, 3, row, 1, 1);
+   gtk_widget_show(label);
+   row++;
+ 
+@@ -158,7 +163,7 @@
+ 
+     /* the row label */
+     label = gtk_label_new(amitk_axis_get_name(i_axis));
+-    gtk_table_attach(GTK_TABLE(table), label, 0,1, row, row+1, 0, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(table), label, 0, row, 1, 1);
+     gtk_widget_show(label);
+ 
+     for (j_axis=0;j_axis<AMITK_AXIS_NUM;j_axis++) {
+@@ -166,14 +171,14 @@
+       space_edit->entry[i_axis][j_axis] = gtk_entry_new();
+       gtk_widget_set_size_request(space_edit->entry[i_axis][j_axis], DEFAULT_ENTRY_WIDTH,-1);
+       gtk_editable_set_editable(GTK_EDITABLE(space_edit->entry[i_axis][j_axis]), TRUE);
+-      gtk_table_attach(GTK_TABLE(table), space_edit->entry[i_axis][j_axis],j_axis+1, j_axis+2,
+-		       row, row+1, 0, 0, X_PADDING, Y_PADDING);
++      gtk_grid_attach(GTK_GRID(table), space_edit->entry[i_axis][j_axis],
++                      j_axis+1, row, 1, 1);
+       gtk_widget_show(space_edit->entry[i_axis][j_axis]);
+     }
+     
+     /* the invert button */
+     button = gtk_button_new_with_label("invert axis");
+-    gtk_table_attach(GTK_TABLE(table), button, 4,5, row, row+1, 0, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(table), button, 4, row, 1, 1);
+     g_object_set_data(G_OBJECT(button), "axis", GINT_TO_POINTER(i_axis));
+     g_signal_connect(G_OBJECT(button), "pressed",
+ 		     G_CALLBACK(space_edit_invert_axis), space_edit);
+@@ -184,22 +189,19 @@
+   }
+ 
+   label = gtk_label_new(_("data set axis:"));
+-  gtk_table_attach(GTK_TABLE(table), label, 0,1, row, row+1,
+-  		   0, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), label, 0, row, 1, 1);
+   gtk_widget_show(label);
+   
+   /* button to apply entries */
+   button = gtk_button_new_with_label(_("apply manual entries"));
+-  gtk_table_attach(GTK_TABLE(table), button, 1,2, 
+-		   row, row+1, 0, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), button, 1, row, 1, 1);
+   g_signal_connect(G_OBJECT(button), "pressed",
+ 		   G_CALLBACK(space_edit_apply_entries), space_edit);
+   gtk_widget_show(button);
+ 
+   /* button to reset the axis */
+   button = gtk_button_new_with_label(_("reset to identity"));
+-  gtk_table_attach(GTK_TABLE(table), button, 2,3, 
+-		   row, row+1, 0, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), button, 2, row, 1, 1);
+   g_signal_connect(G_OBJECT(button), "pressed",
+ 		   G_CALLBACK(space_edit_reset_axis), space_edit);
+   gtk_widget_show(button);
+@@ -236,7 +238,7 @@
+ #endif
+ }
+ 
+-static void space_edit_destroy (GtkObject * gtkobject) {
++static void space_edit_destroy (GtkWidget * gtkobject) {
+ 
+   AmitkSpaceEdit * space_edit;
+ 
+@@ -254,8 +256,8 @@
+ 
+ 
+ 
+-  if (GTK_OBJECT_CLASS (parent_class)->destroy)
+-    (* GTK_OBJECT_CLASS (parent_class)->destroy) (gtkobject);
++  if (GTK_WIDGET_CLASS (parent_class)->destroy)
++    (* GTK_WIDGET_CLASS (parent_class)->destroy) (gtkobject);
+ }
+ 
+ 
+@@ -282,6 +284,17 @@
+   return;
+ }
+ 
++/* Compensate the lack of GTK_UPDATE_DISCONTINUOUS.  */
++static gboolean space_edit_button_release(GtkWidget * widget, GdkEvent * event, gpointer data) {
++
++  AmitkSpaceEdit * space_edit = data;
++  GtkAdjustment * adjustment;
++
++  adjustment = gtk_range_get_adjustment(GTK_RANGE(widget));
++  space_edit_rotate_axis(adjustment, space_edit);
++
++  return FALSE;
++}
+ 
+ static void space_edit_rotate_axis(GtkAdjustment * adjustment, gpointer data) {
+ 
+@@ -293,7 +306,7 @@
+   /* figure out which scale widget called me */
+   i_view = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(adjustment),"view"));
+ 
+-  rotation = (adjustment->value/180)*M_PI; /* get rotation in radians */
++  rotation = (gtk_adjustment_get_value(adjustment)/180)*M_PI; /* get rotation in radians */
+ 
+   /* compensate for sagittal being a left-handed coordinate frame */
+   if (i_view == AMITK_VIEW_SAGITTAL) rotation = -rotation; 
+@@ -311,8 +324,7 @@
+ 			       rotation, center);
+ 
+   /* return adjustment back to normal */
+-  adjustment->value = 0.0;
+-  gtk_adjustment_changed(adjustment);
++  gtk_adjustment_set_value(adjustment, 0.0);
+ 
+   return;
+ }
+--- amide.orig/amide-current/src/amitk_threshold.c
++++ amide/amide-current/src/amitk_threshold.c
+@@ -71,7 +71,7 @@
+ 
+ static void threshold_class_init (AmitkThresholdClass *klass);
+ static void threshold_init (AmitkThreshold *threshold);
+-static void threshold_destroy (GtkObject *object);
++static void threshold_destroy (GtkWidget *object);
+ static void threshold_show_all (GtkWidget * widget);
+ static void threshold_construct(AmitkThreshold * threshold, AmitkThresholdLayout layout);
+ static void threshold_add_data_set(AmitkThreshold * threshold, AmitkDataSet * ds);
+@@ -99,7 +99,7 @@
+ static void ds_conversion_changed_cb(AmitkDataSet * ds, AmitkThreshold* threshold);
+ static void ds_modality_changed_cb(AmitkDataSet * ds, AmitkThreshold* threshold);
+ static void study_view_mode_changed_cb(AmitkStudy * study, AmitkThreshold * threshold);
+-static gint threshold_arrow_cb(GtkWidget* widget, GdkEvent * event, gpointer AmitkThreshold);
++static gint threshold_arrow_cb(GooCanvasItem * item, GooCanvasItem * target, GdkEvent * event, gpointer AmitkThreshold);
+ static void color_table_cb(GtkWidget * widget, gpointer data);
+ static void color_table_independent_cb(GtkWidget * widget, gpointer AmitkThreshold);
+ static void threshold_ref_frame_cb(GtkWidget* widget, gpointer data);
+@@ -118,7 +118,7 @@
+ static void thresholds_dialog_init (AmitkThresholdsDialog *thresholds_dialog);
+ static void thresholds_dialog_construct(AmitkThresholdsDialog * thresholds_dialog, GtkWindow * parent, GList * data_sets);
+ 
+-static GtkVBoxClass *threshold_parent_class;
++static GtkBoxClass *threshold_parent_class;
+ static GtkDialogClass *threshold_dialog_parent_class;
+ static GtkDialogClass *thresholds_dialog_parent_class;
+ 
+@@ -144,7 +144,7 @@
+ 	NULL /* value table */
+       };
+ 
+-      threshold_type = g_type_register_static(GTK_TYPE_VBOX, "AmitkThreshold", &threshold_info, 0);
++      threshold_type = g_type_register_static(GTK_TYPE_BOX, "AmitkThreshold", &threshold_info, 0);
+     }
+ 
+   return threshold_type;
+@@ -152,15 +152,13 @@
+ 
+ static void threshold_class_init (AmitkThresholdClass *klass)
+ {
+-  GtkObjectClass *gtkobject_class;
+   GtkWidgetClass *widget_class;
+ 
+-  gtkobject_class = (GtkObjectClass*) klass;
+   widget_class    = (GtkWidgetClass*) klass;
+ 
+   threshold_parent_class = g_type_class_peek_parent(klass);
+ 
+-  gtkobject_class->destroy = threshold_destroy;
++  widget_class->destroy = threshold_destroy;
+   widget_class->show_all = threshold_show_all;
+ 
+ }
+@@ -173,6 +171,8 @@
+   guint i_ref;
+ 
+ 
++  gtk_orientable_set_orientation(GTK_ORIENTABLE(threshold),
++                                 GTK_ORIENTATION_VERTICAL);
+ 
+   /* initialize some critical stuff */
+   for (i_ref=0; i_ref<2; i_ref++) {
+@@ -185,10 +185,11 @@
+   threshold->histogram_image = NULL;
+ 
+   if (threshold_cursor == NULL)
+-    threshold_cursor = gdk_cursor_new(GDK_SB_V_DOUBLE_ARROW);
++    threshold_cursor = gdk_cursor_new_for_display(gdk_display_get_default(),
++                                                  GDK_SB_V_DOUBLE_ARROW);
+ 
+ }
+-static void threshold_destroy (GtkObject * object) {
++static void threshold_destroy (GtkWidget * object) {
+ 
+   AmitkThreshold * threshold;
+ 
+@@ -199,8 +200,8 @@
+ 
+   threshold_remove_data_set(threshold);
+ 
+-  if (GTK_OBJECT_CLASS (threshold_parent_class)->destroy)
+-    (* GTK_OBJECT_CLASS (threshold_parent_class)->destroy) (object);
++  if (GTK_WIDGET_CLASS (threshold_parent_class)->destroy)
++    (* GTK_WIDGET_CLASS (threshold_parent_class)->destroy) (object);
+ }
+ 
+ /* this is used to catch the show_all signal, which would show the
+@@ -228,10 +229,10 @@
+     radio_buttons[i_threshold_style] = gtk_radio_button_new(NULL);
+     switch(i_threshold_style) {
+     case AMITK_THRESHOLD_STYLE_MIN_MAX:
+-      image = gtk_image_new_from_stock("amide_icon_threshold_style_min_max",GTK_ICON_SIZE_LARGE_TOOLBAR);
++      image = gtk_image_new_from_icon_name("amide_icon_threshold_style_min_max",GTK_ICON_SIZE_LARGE_TOOLBAR);
+       break;
+     case AMITK_THRESHOLD_STYLE_CENTER_WIDTH:
+-      image = gtk_image_new_from_stock("amide_icon_threshold_style_center_width",GTK_ICON_SIZE_LARGE_TOOLBAR);
++      image = gtk_image_new_from_icon_name("amide_icon_threshold_style_center_width",GTK_ICON_SIZE_LARGE_TOOLBAR);
+       break;
+     default:
+       image = NULL;
+@@ -282,9 +283,9 @@
+ 
+   /* we're using two tables packed into a box */
+   if (layout == AMITK_THRESHOLD_BOX_LAYOUT)
+-    main_box = gtk_hbox_new(FALSE,0);
++    main_box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
+   else /* layout == AMITK_THRESHOLD_LINEAR_LAYOUT */
+-    main_box = gtk_vbox_new(FALSE,0);
++    main_box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
+   gtk_container_add(GTK_CONTAINER(threshold), main_box);
+ 
+ 
+@@ -292,22 +293,22 @@
+     left table 
+     --------------------------------------- */
+   
+-  left_table = gtk_table_new(8,5,FALSE);
++  left_table = gtk_grid_new();
++  gtk_grid_set_row_spacing(GTK_GRID(left_table), Y_PADDING);
++  gtk_grid_set_column_spacing(GTK_GRID(left_table), X_PADDING);
+   left_row=0;
+   gtk_box_pack_start(GTK_BOX(main_box), left_table, TRUE,TRUE,0);
+   
+   if (!threshold->minimal) {
+     for (i_ref=0; i_ref<2; i_ref++) {
+       threshold->percent_label[i_ref] = gtk_label_new(_("Percent"));
+-      gtk_table_attach(GTK_TABLE(left_table), threshold->percent_label[i_ref], 
+-		       1+2*i_ref,2+2*i_ref,left_row,left_row+1,
+-		       X_PACKING_OPTIONS | GTK_FILL, 0, X_PADDING, Y_PADDING);
++      gtk_grid_attach(GTK_GRID(left_table), threshold->percent_label[i_ref],
++                      1+2*i_ref, left_row, 1, 1);
+       /* show/hide taken care of by threshold_update_layout */
+       
+       threshold->absolute_label[i_ref] = gtk_label_new("");
+-      gtk_table_attach(GTK_TABLE(left_table), threshold->absolute_label[i_ref], 
+-		       2+2*i_ref,3+2*i_ref,left_row,left_row+1,
+-		       X_PACKING_OPTIONS | GTK_FILL, 0, X_PADDING, Y_PADDING);
++      gtk_grid_attach(GTK_GRID(left_table), threshold->absolute_label[i_ref],
++                      2+2*i_ref, left_row, 1, 1);
+       /* show/hide taken care of by threshold_update_layout */
+     }
+     left_row++;
+@@ -315,8 +316,8 @@
+     
+     for (i_limit=0; i_limit < AMITK_LIMIT_NUM; i_limit++) {
+       threshold->min_max_label[i_limit] = gtk_label_new(NULL);
+-      gtk_table_attach(GTK_TABLE(left_table),  threshold->min_max_label[i_limit], 0,1,left_row+1-i_limit,left_row+2-i_limit,
+-		       X_PACKING_OPTIONS | GTK_FILL, 0, X_PADDING, Y_PADDING);
++      gtk_grid_attach(GTK_GRID(left_table), threshold->min_max_label[i_limit],
++                      0, left_row+1-i_limit, 1, 1);
+       gtk_widget_show(threshold->min_max_label[i_limit]);
+     }
+     
+@@ -345,14 +346,14 @@
+ 	g_signal_connect(G_OBJECT(threshold->spin_button[i_ref][i_entry]), "value_changed",  
+ 			 G_CALLBACK(threshold_spin_button_cb), threshold);
+       }
+-      gtk_table_attach(GTK_TABLE(left_table),  threshold->spin_button[i_ref][AMITK_THRESHOLD_ENTRY_MAX_PERCENT], 1+2*i_ref,2+2*i_ref,
+-		       left_row,left_row+1, X_PACKING_OPTIONS | GTK_FILL,  0,  X_PADDING, Y_PADDING);
+-      gtk_table_attach(GTK_TABLE(left_table), threshold->spin_button[i_ref][AMITK_THRESHOLD_ENTRY_MAX_ABSOLUTE], 2+2*i_ref,3+2*i_ref,
+-		       left_row,left_row+1,X_PACKING_OPTIONS | GTK_FILL, 0, X_PADDING, Y_PADDING);
+-      gtk_table_attach(GTK_TABLE(left_table), threshold->spin_button[i_ref][AMITK_THRESHOLD_ENTRY_MIN_PERCENT], 1+2*i_ref,2+2*i_ref, 
+-		       left_row+1,left_row+2, X_PACKING_OPTIONS | GTK_FILL, 0, X_PADDING, Y_PADDING);
+-      gtk_table_attach(GTK_TABLE(left_table), threshold->spin_button[i_ref][AMITK_THRESHOLD_ENTRY_MIN_ABSOLUTE], 2+2*i_ref,3+2*i_ref, 
+-		       left_row+1, left_row+2, X_PACKING_OPTIONS | GTK_FILL, 0, X_PADDING, Y_PADDING);
++      gtk_grid_attach(GTK_GRID(left_table), threshold->spin_button[i_ref][AMITK_THRESHOLD_ENTRY_MAX_PERCENT],
++                      1+2*i_ref, left_row, 1, 1);
++      gtk_grid_attach(GTK_GRID(left_table), threshold->spin_button[i_ref][AMITK_THRESHOLD_ENTRY_MAX_ABSOLUTE],
++                      2+2*i_ref, left_row, 1, 1);
++      gtk_grid_attach(GTK_GRID(left_table), threshold->spin_button[i_ref][AMITK_THRESHOLD_ENTRY_MIN_PERCENT],
++                      1+2*i_ref, left_row+1, 1, 1);
++      gtk_grid_attach(GTK_GRID(left_table), threshold->spin_button[i_ref][AMITK_THRESHOLD_ENTRY_MIN_ABSOLUTE],
++                      2+2*i_ref, left_row+1, 1, 1);
+       /* show/hide taken care of by threshold_update_layout */
+     }
+     left_row+=2;
+@@ -368,12 +369,15 @@
+       threshold->color_table_label[i_view_mode] = gtk_label_new(temp_string);
+       g_free(temp_string);
+     }
+-    gtk_table_attach(GTK_TABLE(left_table), threshold->color_table_label[i_view_mode], 
+-		     0,1, left_row,left_row+1, X_PACKING_OPTIONS | GTK_FILL, 0, X_PADDING, Y_PADDING);
+-
+-    threshold->color_table_hbox[i_view_mode] = gtk_hbox_new(FALSE, 0);
+-    gtk_table_attach(GTK_TABLE(left_table), threshold->color_table_hbox[i_view_mode], 
+-		     1,5, left_row,left_row+1, X_PACKING_OPTIONS | GTK_FILL, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(left_table),
++                    threshold->color_table_label[i_view_mode],
++                    0, left_row, 1, 1);
++
++    threshold->color_table_hbox[i_view_mode] =
++      gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
++    gtk_grid_attach(GTK_GRID(left_table),
++                    threshold->color_table_hbox[i_view_mode],
++                    1, left_row, 4, 1);
+ 
+     if (i_view_mode == AMITK_VIEW_MODE_SINGLE) {
+       threshold->color_table_independent[i_view_mode] = NULL;
+@@ -400,13 +404,11 @@
+   if (!threshold->minimal) {
+     /* threshold type selection */
+     label = gtk_label_new(_("Threshold Type"));
+-    gtk_table_attach(GTK_TABLE(left_table), label, 0,1, left_row,left_row+1,
+-		     X_PACKING_OPTIONS | GTK_FILL, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(left_table), label, 0, left_row, 1, 1);
+     gtk_widget_show(label);
+     
+-    hbox = gtk_hbox_new(FALSE, 0);
+-    gtk_table_attach(GTK_TABLE(left_table), hbox, 1,5, left_row,left_row+1,
+-		     X_PACKING_OPTIONS | GTK_FILL, 0, X_PADDING, Y_PADDING);
++    hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
++    gtk_grid_attach(GTK_GRID(left_table), hbox, 1, left_row, 4, 1);
+     gtk_widget_show(hbox);
+     left_row++;
+ 
+@@ -415,16 +417,16 @@
+       threshold->type_button[i_thresholding] = gtk_radio_button_new(NULL);
+       switch(i_thresholding) {
+       case AMITK_THRESHOLDING_PER_SLICE:
+-	image = gtk_image_new_from_stock("amide_icon_thresholding_per_slice",GTK_ICON_SIZE_LARGE_TOOLBAR);
++	image = gtk_image_new_from_icon_name("amide_icon_thresholding_per_slice",GTK_ICON_SIZE_LARGE_TOOLBAR);
+ 	break;
+       case AMITK_THRESHOLDING_PER_FRAME:
+-	image = gtk_image_new_from_stock("amide_icon_thresholding_per_frame",GTK_ICON_SIZE_LARGE_TOOLBAR);
++	image = gtk_image_new_from_icon_name("amide_icon_thresholding_per_frame",GTK_ICON_SIZE_LARGE_TOOLBAR);
+ 	break;
+       case AMITK_THRESHOLDING_INTERPOLATE_FRAMES:
+-	image = gtk_image_new_from_stock("amide_icon_thresholding_interpolate_frames",GTK_ICON_SIZE_LARGE_TOOLBAR);
++	image = gtk_image_new_from_icon_name("amide_icon_thresholding_interpolate_frames",GTK_ICON_SIZE_LARGE_TOOLBAR);
+ 	break;
+       case AMITK_THRESHOLDING_GLOBAL:
+-	image = gtk_image_new_from_stock("amide_icon_thresholding_global",GTK_ICON_SIZE_LARGE_TOOLBAR);
++	image = gtk_image_new_from_icon_name("amide_icon_thresholding_global",GTK_ICON_SIZE_LARGE_TOOLBAR);
+ 	break;
+       default:
+ 	image = NULL;
+@@ -455,14 +457,12 @@
+ 
+     /* threshold type selection */
+     label = gtk_label_new(_("Threshold Style"));
+-    gtk_table_attach(GTK_TABLE(left_table), label, 0,1, left_row,left_row+1,
+-		     X_PACKING_OPTIONS | GTK_FILL, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(left_table), label, 0, left_row, 1, 1);
+     gtk_widget_show(label);
+     
+-    hbox = gtk_hbox_new(FALSE, 0);
++    hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
+     amitk_threshold_style_widgets(threshold->style_button, hbox);
+-    gtk_table_attach(GTK_TABLE(left_table), hbox, 1,5, left_row,left_row+1,
+-		     X_PACKING_OPTIONS | GTK_FILL, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(left_table), hbox, 1, left_row, 4, 1);
+     for (i_threshold_style = 0; i_threshold_style < AMITK_THRESHOLD_STYLE_NUM; i_threshold_style++) 
+       g_signal_connect(G_OBJECT(threshold->style_button[i_threshold_style]), "clicked",  
+ 		       G_CALLBACK(threshold_style_cb), threshold);
+@@ -471,26 +471,24 @@
+ 
+ 
+     threshold->window_label = gtk_label_new("Apply Window");
+-    gtk_table_attach(GTK_TABLE(left_table), threshold->window_label,
+-		     0,1,left_row,left_row+1,
+-		     X_PACKING_OPTIONS | GTK_FILL, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(left_table), threshold->window_label,
++                    0, left_row, 1, 1);
+     /* show/hide taken care of by threshold_update_window */
+ 
+-    threshold->window_vbox = gtk_vbox_new(FALSE, 0);
+-    gtk_table_attach(GTK_TABLE(left_table), threshold->window_vbox,
+-		     1,5,left_row,left_row+1,
+-		     X_PACKING_OPTIONS | GTK_FILL, 0, X_PADDING, Y_PADDING);
++    threshold->window_vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
++    gtk_grid_attach(GTK_GRID(left_table), threshold->window_vbox,
++                    1, left_row, 4, 1);
+     /* show/hide taken care of by threshold_update_window */
+ 
+     for (i_window=0; i_window < AMITK_WINDOW_NUM; i_window++) {
+       x = div(i_window, 5);
+       if (x.rem == 0) {
+-	hbox = gtk_hbox_new(FALSE, 0);
++	hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
+ 	gtk_box_pack_start(GTK_BOX(threshold->window_vbox), hbox, FALSE, FALSE, 3);
+ 	gtk_widget_show(hbox);
+       }
+       button = gtk_button_new();
+-      image = gtk_image_new_from_stock(windowing_icons[i_window],GTK_ICON_SIZE_LARGE_TOOLBAR);
++      image = gtk_image_new_from_icon_name(windowing_icons[i_window],GTK_ICON_SIZE_LARGE_TOOLBAR);
+       gtk_button_set_image(GTK_BUTTON(button), image);
+       g_object_set_data(G_OBJECT(button), "which_window",GINT_TO_POINTER(i_window));
+       gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 3);
+@@ -506,26 +504,28 @@
+   /*---------------------------------------
+     right table 
+     --------------------------------------- */
+-  right_table = gtk_table_new(4,5,FALSE);
++  right_table = gtk_grid_new();
++  gtk_grid_set_row_spacing(GTK_GRID(right_table), Y_PADDING);
++  gtk_grid_set_column_spacing(GTK_GRID(right_table), X_PADDING);
+   right_row=0;
+   gtk_box_pack_start(GTK_BOX(main_box), right_table, TRUE,TRUE,0);
+ 
+   /* color table selector */
+   threshold->ref_frame_label[0] = gtk_label_new(_("ref. frame 0:"));
+-  gtk_table_attach(GTK_TABLE(right_table), threshold->ref_frame_label[0], 1,2, right_row,right_row+1,
+-		   X_PACKING_OPTIONS | GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(right_table), threshold->ref_frame_label[0],
++                  1, right_row, 1, 1);
+   /* show/hide taken care of by threshold_update_layout */
+   
+   threshold->ref_frame_label[1] = gtk_label_new(_("ref. frame 1:"));
+-  gtk_table_attach(GTK_TABLE(right_table), threshold->ref_frame_label[1], 3,4, right_row,right_row+1,
+-		   X_PACKING_OPTIONS | GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(right_table), threshold->ref_frame_label[1],
++                  3, right_row, 1, 1);
+   /* show/hide taken care of by threshold_update_layout */
+ 
+   for (i_ref=0; i_ref<2; i_ref++) {
+-    threshold->threshold_ref_frame_menu[i_ref] = gtk_combo_box_new_text();
+-    gtk_table_attach(GTK_TABLE(right_table), threshold->threshold_ref_frame_menu[i_ref],
+-		     2+i_ref*2,3+i_ref*2, right_row,right_row+1,
+-		     X_PACKING_OPTIONS | GTK_FILL, 0, X_PADDING, Y_PADDING);
++    threshold->threshold_ref_frame_menu[i_ref] = gtk_combo_box_text_new();
++    gtk_grid_attach(GTK_GRID(right_table),
++                    threshold->threshold_ref_frame_menu[i_ref],
++                    2+i_ref*2, right_row, 1, 1);
+     gtk_widget_set_size_request(threshold->threshold_ref_frame_menu[i_ref], 50, -1);
+     g_object_set_data(G_OBJECT(threshold->threshold_ref_frame_menu[i_ref]), 
+ 		      "which_ref", GINT_TO_POINTER(i_ref));
+@@ -541,23 +541,20 @@
+ 
+   if (!threshold->minimal) {
+     threshold->histogram_label = gtk_label_new(_("distribution"));
+-    gtk_table_attach(GTK_TABLE(right_table),  threshold->histogram_label, 
+-		     0,1, right_row, right_row+1,
+-		     X_PACKING_OPTIONS | GTK_FILL, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(right_table), threshold->histogram_label,
++                    0, right_row, 1, 1);
+     /* show/hide taken care of by threshold_update_layout */
+   }
+ 
+   for (i_ref=0; i_ref<2; i_ref++) {
+     threshold->full_label[i_ref] = gtk_label_new(_("full"));
+-    gtk_table_attach(GTK_TABLE(right_table),  threshold->full_label[i_ref], 
+-		     1+2*i_ref,2+2*i_ref, right_row, right_row+1,
+-		     X_PACKING_OPTIONS | GTK_FILL, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(right_table), threshold->full_label[i_ref],
++                    1+2*i_ref, right_row, 1, 1);
+     /* show/hide taken care of by threshold_update_layout */
+ 
+     threshold->scaled_label[i_ref] = gtk_label_new(_("scaled"));
+-    gtk_table_attach(GTK_TABLE(right_table),  threshold->scaled_label[i_ref], 
+-		     2+2*i_ref,3+2*i_ref, right_row, right_row+1,
+-		     X_PACKING_OPTIONS | GTK_FILL, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(right_table), threshold->scaled_label[i_ref],
++                    2+2*i_ref, right_row, 1, 1);
+     /* show/hide taken care of by threshold_update_layout */
+ 
+   }
+@@ -568,17 +565,15 @@
+ 
+   /* the histogram */
+   if (!threshold->minimal) {
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+-    threshold->histogram = gnome_canvas_new_aa();
+-#else
+-    threshold->histogram = gnome_canvas_new();
+-#endif
+-    gtk_table_attach(GTK_TABLE(right_table), threshold->histogram, 0,1,right_row,right_row+1,
+-		     X_PACKING_OPTIONS | GTK_FILL, Y_PACKING_OPTIONS | GTK_FILL, X_PADDING, Y_PADDING);
++    threshold->histogram = goo_canvas_new();
++    gtk_widget_set_hexpand(threshold->histogram, TRUE);
++    gtk_widget_set_halign(threshold->histogram, GTK_ALIGN_CENTER);
++    gtk_grid_attach(GTK_GRID(right_table), threshold->histogram,
++                    0, right_row, 1, 1);
+     gtk_widget_set_size_request(threshold->histogram,
+ 				IMAGE_DISTRIBUTION_WIDTH,
+ 				AMITK_DATA_SET_DISTRIBUTION_SIZE + 2*THRESHOLD_TRIANGLE_HEIGHT);
+-    gnome_canvas_set_scroll_region(GNOME_CANVAS(threshold->histogram), 
++    goo_canvas_set_bounds(GOO_CANVAS(threshold->histogram),
+ 				   0.0, THRESHOLD_TRIANGLE_WIDTH/2.0,
+ 				   IMAGE_DISTRIBUTION_WIDTH,
+ 				   (THRESHOLD_TRIANGLE_WIDTH/2.0 + AMITK_DATA_SET_DISTRIBUTION_SIZE));
+@@ -589,15 +584,12 @@
+ 
+   /* the color scale */
+   for (i_ref=0; i_ref<2; i_ref++) {
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+-    threshold->color_scales[i_ref] = gnome_canvas_new_aa();
+-#else
+-    threshold->color_scales[i_ref] = gnome_canvas_new();
+-#endif
+-    gtk_table_attach(GTK_TABLE(right_table),  threshold->color_scales[i_ref], 
+-		     1+2*i_ref,3+2*i_ref,right_row,right_row+1,
+-		     X_PACKING_OPTIONS | GTK_FILL, Y_PACKING_OPTIONS | GTK_FILL, X_PADDING, Y_PADDING);
+-    gnome_canvas_set_scroll_region(GNOME_CANVAS(threshold->color_scales[i_ref]), 0.0, 0.0,
++    threshold->color_scales[i_ref] = goo_canvas_new();
++    gtk_widget_set_hexpand(threshold->color_scales[i_ref], TRUE);
++    gtk_widget_set_halign(threshold->color_scales[i_ref], GTK_ALIGN_CENTER);
++    gtk_grid_attach(GTK_GRID(right_table), threshold->color_scales[i_ref],
++                    1+2*i_ref, right_row, 2, 1);
++    goo_canvas_set_bounds(GOO_CANVAS(threshold->color_scales[i_ref]), 0.0, 0.0,
+ 				   THRESHOLD_COLOR_SCALES_WIDTH+2* THRESHOLD_TRIANGLE_WIDTH,
+ 				   THRESHOLD_COLOR_SCALE_HEIGHT + 2*THRESHOLD_TRIANGLE_HEIGHT + 1);
+     gtk_widget_set_size_request(threshold->color_scales[i_ref],
+@@ -694,34 +686,39 @@
+ static void threshold_update_histogram(AmitkThreshold * threshold) {
+ 
+   rgb_t fg;
+-  GtkStyle * widget_style;
++  GooCanvasItem * root;
++  GtkStyleContext * widget_style;
+   GdkPixbuf * pixbuf;
++  GdkRGBA rgba;
+ 
+   if (threshold->minimal) return; /* no histogram in minimal configuration */
+ 
+   /* figure out what colors to use for the distribution image */
+-  widget_style = gtk_widget_get_style(GTK_WIDGET(threshold));
++  /* GTK 3 returns white color for the threshold widget, while GTK 2
++     returns black.  So use the progress dialog (should be the same).  */
++  widget_style = gtk_widget_get_style_context(threshold->progress_dialog);
+   if (widget_style == NULL) {
+     g_warning(_("Threshold has no style?\n"));
+-    widget_style = gtk_style_new();
++    widget_style = gtk_style_context_new();
+   }
+ 
+-  fg.r = widget_style->fg[GTK_STATE_NORMAL].red >> 8;
+-  fg.g = widget_style->fg[GTK_STATE_NORMAL].green >> 8;
+-  fg.b = widget_style->fg[GTK_STATE_NORMAL].blue >> 8;
++  gtk_style_context_get_color(widget_style, GTK_STATE_FLAG_NORMAL, &rgba);
++  fg.r = (int)(0.5 + CLAMP(rgba.red, 0., 1.) * 255.);
++  fg.g = (int)(0.5 + CLAMP(rgba.green, 0., 1.) * 255.);
++  fg.b = (int)(0.5 + CLAMP(rgba.blue, 0., 1.) * 255.);
+ 
+   pixbuf = image_of_distribution(threshold->data_set, fg, 
+ 				 amitk_progress_dialog_update, 
+ 				 threshold->progress_dialog);
+ 
++  root = goo_canvas_get_root_item(GOO_CANVAS(threshold->histogram));
+   if (pixbuf != NULL) {
+     if (threshold->histogram_image != NULL)
+-      gnome_canvas_item_set(threshold->histogram_image, "pixbuf", pixbuf, NULL);
++      g_object_set(threshold->histogram_image, "pixbuf", pixbuf, NULL);
+     else 
+       threshold->histogram_image = 
+-	gnome_canvas_item_new(gnome_canvas_root(GNOME_CANVAS(threshold->histogram)),
+-			      gnome_canvas_pixbuf_get_type(), "pixbuf", pixbuf,
+-			      "x", 0.0, "y", ((gdouble) THRESHOLD_TRIANGLE_HEIGHT),  NULL);
++        goo_canvas_image_new(root, pixbuf, 0.0, THRESHOLD_TRIANGLE_HEIGHT,
++                             NULL);
+     g_object_unref(pixbuf);
+   }
+ 
+@@ -794,7 +791,7 @@
+ 
+ static void threshold_update_arrow(AmitkThreshold * threshold, AmitkThresholdArrow arrow) {
+ 
+-  GnomeCanvasPoints * points;
++  GooCanvasPoints * points;
+   gdouble left, right, point, top, bottom;
+   gboolean up_pointing=FALSE;
+   gboolean down_pointing=FALSE;
+@@ -812,7 +809,7 @@
+ 
+   for (i_ref=0; i_ref< threshold_visible_refs(threshold->data_set); i_ref++) {
+ 
+-    points = gnome_canvas_points_new(3);
++    points = goo_canvas_points_new(3);
+     initial_diff = 
+       threshold->initial_max[i_ref]-
+       threshold->initial_min[i_ref];
+@@ -962,29 +959,31 @@
+     if ((AMITK_DATA_SET_THRESHOLD_STYLE(threshold->data_set) == AMITK_THRESHOLD_STYLE_MIN_MAX) && 
+ 	((arrow == AMITK_THRESHOLD_ARROW_FULL_CENTER) || (arrow == AMITK_THRESHOLD_ARROW_SCALED_CENTER)) ) {
+       if (threshold->arrow[i_ref][arrow] != NULL) {
+-	gtk_object_destroy(GTK_OBJECT(threshold->arrow[i_ref][arrow]));
++	goo_canvas_item_remove(threshold->arrow[i_ref][arrow]);
+ 	threshold->arrow[i_ref][arrow] = NULL;
+       }
+     } else { /* otherwise, do all the drawing */
+       
+       if (threshold->arrow[i_ref][arrow] != NULL)
+-	gnome_canvas_item_set(threshold->arrow[i_ref][arrow], "points", points, NULL);
++	g_object_set(threshold->arrow[i_ref][arrow], "points", points, NULL);
+       else {
+ 	threshold->arrow[i_ref][arrow] = 
+-	  gnome_canvas_item_new(gnome_canvas_root(GNOME_CANVAS(threshold->color_scales[i_ref])),
+-				gnome_canvas_polygon_get_type(),
+-				"points", points,
+-				"fill_color", fill_color,
+-				"outline_color", "black",
+-				"width_pixels", 2,
+-				NULL);
++          goo_canvas_polyline_new(goo_canvas_get_root_item(GOO_CANVAS(threshold->color_scales[i_ref])),
++                                  TRUE, 0, "points", points,
++                                  "fill-color", fill_color,
++                                  "stroke-color", "black",
++                                  "line-width", 2.0, NULL);
+ 	g_object_set_data(G_OBJECT(threshold->arrow[i_ref][arrow]), "type", GINT_TO_POINTER(arrow));
+ 	g_object_set_data(G_OBJECT(threshold->arrow[i_ref][arrow]), "which_ref", GINT_TO_POINTER(i_ref));
+-	g_signal_connect(G_OBJECT(threshold->arrow[i_ref][arrow]), "event",
++	g_signal_connect(G_OBJECT(threshold->arrow[i_ref][arrow]), "button-press-event",
++			 G_CALLBACK(threshold_arrow_cb), threshold);
++	g_signal_connect(G_OBJECT(threshold->arrow[i_ref][arrow]), "button-release-event",
++			 G_CALLBACK(threshold_arrow_cb), threshold);
++	g_signal_connect(G_OBJECT(threshold->arrow[i_ref][arrow]), "motion-notify-event",
+ 			 G_CALLBACK(threshold_arrow_cb), threshold);
+       }
+     }
+-    gnome_canvas_points_unref(points);
++    goo_canvas_points_unref(points);
+   }
+     
+   return;
+@@ -1039,11 +1038,11 @@
+     }
+    
+     if (threshold->color_scale_image[i_ref][scale] != NULL) {
+-      gnome_canvas_item_set(threshold->color_scale_image[i_ref][scale], "pixbuf", pixbuf, NULL);
++      g_object_set(threshold->color_scale_image[i_ref][scale], "pixbuf", pixbuf, NULL);
+     } else {
+       threshold->color_scale_image[i_ref][scale] = 
+-	gnome_canvas_item_new(gnome_canvas_root(GNOME_CANVAS(threshold->color_scales[i_ref])),
+-			      gnome_canvas_pixbuf_get_type(), "pixbuf", pixbuf,  "x", x, "y", y, NULL);
++        goo_canvas_image_new(goo_canvas_get_root_item(GOO_CANVAS(threshold->color_scales[i_ref])),
++                             pixbuf, x, y, NULL);
+     }
+     g_object_unref(pixbuf);
+ 
+@@ -1055,7 +1054,7 @@
+ static void threshold_update_connector_lines(AmitkThreshold * threshold, AmitkThresholdScale scale) {
+ 
+   gdouble temp;
+-  GnomeCanvasPoints * line_points;
++  GooCanvasPoints * line_points;
+   guint i_ref;
+   amide_data_t initial_diff;
+   amide_data_t global_diff;
+@@ -1071,7 +1070,7 @@
+     if (initial_diff < EPSILON) initial_diff = EPSILON;
+ 
+     /* update the line that connect the max arrows of each color scale */
+-    line_points = gnome_canvas_points_new(2);
++    line_points = goo_canvas_points_new(2);
+     line_points->coords[0] = THRESHOLD_COLOR_SCALE_WIDTH+THRESHOLD_TRIANGLE_WIDTH;
+     temp = (1.0-(threshold->threshold_max[i_ref]-
+ 		 amitk_data_set_get_global_min(threshold->data_set))/global_diff);
+@@ -1084,19 +1083,18 @@
+     else if (temp > 1.0) temp = 1.0;
+     line_points->coords[3] = THRESHOLD_TRIANGLE_HEIGHT + THRESHOLD_COLOR_SCALE_HEIGHT * temp;
+     if (threshold->connector_line[i_ref][AMITK_THRESHOLD_LINE_MAX] != NULL)
+-      gnome_canvas_item_set(threshold->connector_line[i_ref][AMITK_THRESHOLD_LINE_MAX],
++      g_object_set(threshold->connector_line[i_ref][AMITK_THRESHOLD_LINE_MAX],
+ 			    "points", line_points, NULL);
+     else
+       threshold->connector_line[i_ref][AMITK_THRESHOLD_LINE_MAX] =
+-	gnome_canvas_item_new(gnome_canvas_root(GNOME_CANVAS(threshold->color_scales[i_ref])),
+-			      gnome_canvas_line_get_type(),
+-			      "points", line_points, 
+-			      "fill_color", "black",
+-			      "width_units", 1.0, NULL);
+-    gnome_canvas_points_unref(line_points);
++        goo_canvas_polyline_new(goo_canvas_get_root_item(GOO_CANVAS(threshold->color_scales[i_ref])),
++                                FALSE, 0, "points", line_points,
++                                "fill-color", "black",
++                                "line-width", 1.0, NULL);
++    goo_canvas_points_unref(line_points);
+ 
+     /* update the line that connect the min arrows of each color scale */
+-    line_points = gnome_canvas_points_new(2);
++    line_points = goo_canvas_points_new(2);
+     line_points->coords[0] = THRESHOLD_COLOR_SCALE_WIDTH+THRESHOLD_TRIANGLE_WIDTH;
+     temp = (1.0-(threshold->threshold_min[i_ref]-
+ 		 amitk_data_set_get_global_min(threshold->data_set))/global_diff);
+@@ -1109,20 +1107,19 @@
+     else if (temp < 0.0) temp = 0.0;
+     line_points->coords[3] = THRESHOLD_TRIANGLE_HEIGHT + THRESHOLD_COLOR_SCALE_HEIGHT * temp;
+     if (threshold->connector_line[i_ref][AMITK_THRESHOLD_LINE_MIN] != NULL)
+-      gnome_canvas_item_set(threshold->connector_line[i_ref][AMITK_THRESHOLD_LINE_MIN],
++      g_object_set(threshold->connector_line[i_ref][AMITK_THRESHOLD_LINE_MIN],
+ 			    "points", line_points, NULL);
+     else
+       threshold->connector_line[i_ref][AMITK_THRESHOLD_LINE_MIN] =
+-	gnome_canvas_item_new(gnome_canvas_root(GNOME_CANVAS(threshold->color_scales[i_ref])),
+-			      gnome_canvas_line_get_type(),
+-			      "points", line_points, 
+-			      "fill_color", "black",
+-			      "width_units", 1.0, NULL);
+-    gnome_canvas_points_unref(line_points);
++        goo_canvas_polyline_new(goo_canvas_get_root_item(GOO_CANVAS(threshold->color_scales[i_ref])),
++                                FALSE, 0, "points", line_points,
++                                "fill-color", "black",
++                                "line-width", 1.0, NULL);
++    goo_canvas_points_unref(line_points);
+ 
+     /* update the line that connects the center arrows of each color scale */
+     if (AMITK_DATA_SET_THRESHOLD_STYLE(threshold->data_set) == AMITK_THRESHOLD_STYLE_CENTER_WIDTH) {
+-      line_points = gnome_canvas_points_new(2);
++      line_points = goo_canvas_points_new(2);
+       line_points->coords[0] = THRESHOLD_COLOR_SCALE_WIDTH+THRESHOLD_TRIANGLE_WIDTH;
+       temp = (1.0-((threshold->threshold_max[i_ref]+threshold->threshold_min[i_ref])/2.0-
+ 		   amitk_data_set_get_global_min(threshold->data_set))/global_diff);
+@@ -1138,19 +1135,18 @@
+       else if (temp < 0.0) temp = 0.0;
+       line_points->coords[3] = THRESHOLD_TRIANGLE_HEIGHT + THRESHOLD_COLOR_SCALE_HEIGHT * temp;
+       if (threshold->connector_line[i_ref][AMITK_THRESHOLD_LINE_CENTER] != NULL)
+-	gnome_canvas_item_set(threshold->connector_line[i_ref][AMITK_THRESHOLD_LINE_CENTER],
++	g_object_set(threshold->connector_line[i_ref][AMITK_THRESHOLD_LINE_CENTER],
+ 			      "points", line_points, NULL);
+       else
+ 	threshold->connector_line[i_ref][AMITK_THRESHOLD_LINE_CENTER] =
+-	  gnome_canvas_item_new(gnome_canvas_root(GNOME_CANVAS(threshold->color_scales[i_ref])),
+-				gnome_canvas_line_get_type(),
+-				"points", line_points, 
+-				"fill_color", "black",
+-				"width_units", 1.0, NULL);
+-      gnome_canvas_points_unref(line_points);
++          goo_canvas_polyline_new(goo_canvas_get_root_item(GOO_CANVAS(threshold->color_scales[i_ref])),
++                                  FALSE, 0, "points", line_points,
++                                  "fill-color", "black",
++                                  "line-width", 1.0, NULL);
++      goo_canvas_points_unref(line_points);
+     } else { /* hide if not CENTER_WIDTH style */
+       if (threshold->connector_line[i_ref][AMITK_THRESHOLD_LINE_CENTER] != NULL) {
+-	gtk_object_destroy(GTK_OBJECT(threshold->connector_line[i_ref][AMITK_THRESHOLD_LINE_CENTER]));
++	goo_canvas_item_remove(threshold->connector_line[i_ref][AMITK_THRESHOLD_LINE_CENTER]);
+ 	threshold->connector_line[i_ref][AMITK_THRESHOLD_LINE_CENTER] = NULL;
+       }
+     }
+@@ -1358,7 +1354,7 @@
+     /* make new menu */
+     for (i_frame=0; i_frame<AMITK_DATA_SET_NUM_FRAMES(threshold->data_set); i_frame++) {
+       temp_string = g_strdup_printf("%d",i_frame);
+-      gtk_combo_box_append_text(GTK_COMBO_BOX(threshold->threshold_ref_frame_menu[i_ref]),
++      gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(threshold->threshold_ref_frame_menu[i_ref]),
+ 				temp_string);
+       g_free(temp_string);
+      }
+@@ -1539,24 +1535,27 @@
+ 
+ /* function called when the max or min triangle is moved 
+  * mostly taken from Pennington's fine book */
+-static gint threshold_arrow_cb(GtkWidget* widget, GdkEvent * event, gpointer data) {
++static gint threshold_arrow_cb(GooCanvasItem * item, GooCanvasItem * target, GdkEvent * event, gpointer data) {
+ 
+   AmitkThreshold * threshold = data;
+-  gdouble item_x, item_y;
++  GooCanvas * canvas;
++  gdouble item_y;
+   gdouble delta;
+   amide_data_t temp, center, width, max, min;
+   AmitkThresholdArrow which_threshold_arrow;
+   guint which_ref;
+ 
+-  which_ref = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(widget), "which_ref"));
++  which_ref = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(item), "which_ref"));
+   
+-  /* get the location of the event, and convert it to our coordinate system */
+-  item_x = event->button.x;
+-  item_y = event->button.y;
+-  gnome_canvas_item_w2i(GNOME_CANVAS_ITEM(widget)->parent, &item_x, &item_y);
++  if (event->type == GDK_MOTION_NOTIFY)
++    item_y = event->motion.y;
++  else
++    item_y = event->button.y;
++
++  canvas = goo_canvas_item_get_canvas(item);
+ 
+   /* figure out which of the arrows triggered the callback */
+-  which_threshold_arrow = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(widget), "type"));
++  which_threshold_arrow = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(item), "type"));
+ 
+   /* switch on the event which called this */
+   switch (event->type)
+@@ -1566,7 +1565,8 @@
+       threshold->initial_y[which_ref] = item_y;
+       threshold->initial_min[which_ref] = threshold->threshold_min[which_ref];
+       threshold->initial_max[which_ref] = threshold->threshold_max[which_ref];
+-      gnome_canvas_item_grab(GNOME_CANVAS_ITEM(threshold->arrow[which_ref][which_threshold_arrow]),
++      goo_canvas_pointer_grab(canvas,
++                              threshold->arrow[which_ref][which_threshold_arrow],
+ 			     GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK,
+ 			     threshold_cursor,
+ 			     event->button.time);
+@@ -1730,7 +1730,7 @@
+       } 
+ 
+ 
+-      gnome_canvas_item_ungrab(GNOME_CANVAS_ITEM(widget), event->button.time);
++      goo_canvas_pointer_ungrab(canvas, item, event->button.time);
+ 
+       /* reset the scaled color scale */
+       threshold->initial_max[which_ref] = threshold->threshold_max[which_ref];
+@@ -2052,7 +2052,8 @@
+   g_return_if_fail(GTK_IS_WINDOW(dialog));
+ 
+   pixbuf =  
+-    gtk_widget_render_icon(GTK_WIDGET(dialog), "amide_icon_thresholding", -1, 0);
++    gtk_icon_theme_load_icon(gtk_icon_theme_get_default(),
++                             "amide_icon_thresholding", 64, 0, NULL);
+   gtk_window_set_icon(dialog, pixbuf);
+   g_object_unref(pixbuf);
+ 
+@@ -2064,11 +2065,10 @@
+ 
+   init_common(GTK_WINDOW(dialog));
+ 
+-  gtk_dialog_set_has_separator(GTK_DIALOG(dialog), FALSE);
+-
+-  dialog->vbox = gtk_vbox_new (FALSE, 10);
++  dialog->vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10);
+   gtk_container_set_border_width (GTK_CONTAINER (dialog), 10);
+-  gtk_container_add (GTK_CONTAINER (GTK_DIALOG(dialog)->vbox), dialog->vbox);
++  gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area
++                                    (GTK_DIALOG(dialog))), dialog->vbox);
+   gtk_widget_show (dialog->vbox);
+ 
+   /* make the data set title thingie */
+@@ -2197,10 +2197,10 @@
+ 
+   dialog->thresholds = NULL;
+ 
+-  gtk_dialog_set_has_separator(GTK_DIALOG(dialog), FALSE);
+-  main_vbox = gtk_vbox_new (FALSE, 10);
++  main_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10);
+   gtk_container_set_border_width (GTK_CONTAINER (dialog), 10);
+-  gtk_container_add (GTK_CONTAINER (GTK_DIALOG(dialog)->vbox), main_vbox);
++  gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area
++                                    (GTK_DIALOG(dialog))), main_vbox);
+   gtk_widget_show (main_vbox);
+ 
+   dialog->notebook = gtk_notebook_new();
+--- amide.orig/amide-current/src/amitk_tree_view.c
++++ amide/amide-current/src/amitk_tree_view.c
+@@ -93,11 +93,11 @@
+ 
+ static void tree_view_class_init (AmitkTreeViewClass *klass);
+ static void tree_view_init (AmitkTreeView *tree_view);
+-static void tree_view_destroy (GtkObject *object);
++static void tree_view_destroy (GtkWidget *object);
+ static void tree_view_set_view_mode(AmitkTreeView * tree_view, AmitkViewMode view_mode);
+ static void tree_view_add_roi_cb(GtkWidget * widget, gpointer data);
+ static void tree_view_popup_roi_menu(AmitkTreeView * tree_view, AmitkObject * parent_object, 
+-				     guint button, guint32 activate_time);
++				     GdkEventButton * event);
+ static gboolean tree_view_button_press_event(GtkWidget *tree_view,GdkEventButton *event);
+ static gboolean tree_view_button_release_event(GtkWidget *tree_view, GdkEventButton *event);
+ static gboolean tree_view_key_press_event(GtkWidget * tree_view, GdkEventKey * event);
+@@ -188,17 +188,15 @@
+ 
+ static void tree_view_class_init (AmitkTreeViewClass *klass)
+ {
+-  GtkObjectClass *gtkobject_class;
+   /*  GtkTreeViewClass *tree_view_class; */
+   GtkWidgetClass *widget_class;
+ 
+-  gtkobject_class = (GtkObjectClass*) klass;
+   widget_class    = (GtkWidgetClass*) klass;
+   /*  tree_view_class    = (GtkTreeViewClass*) klass; */
+ 
+   parent_class = g_type_class_peek_parent(klass);
+ 
+-  gtkobject_class->destroy = tree_view_destroy;
++  widget_class->destroy = tree_view_destroy;
+ 
+   widget_class->button_press_event = tree_view_button_press_event;
+   widget_class->button_release_event = tree_view_button_release_event;
+@@ -301,7 +299,7 @@
+   
+ }
+ 
+-static void tree_view_destroy (GtkObject * object) {
++static void tree_view_destroy (GtkWidget * object) {
+ 
+   AmitkTreeView * tree_view;
+ 
+@@ -339,8 +337,8 @@
+     tree_view->drag_list = NULL;
+   }
+ 
+-  if (GTK_OBJECT_CLASS (parent_class)->destroy)
+-    (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
++  if (GTK_WIDGET_CLASS (parent_class)->destroy)
++    (* GTK_WIDGET_CLASS (parent_class)->destroy) (object);
+ }
+ 
+ 
+@@ -387,7 +385,7 @@
+ 
+ 
+ static void tree_view_popup_roi_menu(AmitkTreeView * tree_view, AmitkObject * parent_object, 
+-				     guint button, guint32 activate_time) {
++				     GdkEventButton * event) {
+   GtkWidget * menu;
+   GtkWidget * menuitem;
+   AmitkRoiType i_roi_type;
+@@ -404,7 +402,7 @@
+   }
+   gtk_widget_show(menu);
+   
+-  gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL, button, activate_time);
++  gtk_menu_popup_at_pointer(GTK_MENU(menu), (GdkEvent *) event);
+   return;
+ }
+ 
+@@ -461,7 +459,7 @@
+     amitk_tree_view_set_active_object(tree_view, tree_view->active_object);
+     
+     if ((event->button == 3) && !valid_row)
+-      tree_view_popup_roi_menu(tree_view, NULL, event->button, event->time);
++      tree_view_popup_roi_menu(tree_view, NULL, event);
+     break;
+ 
+   default:
+@@ -603,7 +601,7 @@
+ 	  g_signal_emit(G_OBJECT(tree_view),  tree_view_signals[ADD_OBJECT], 0, object, add_type, 0);
+       
+ 	if ((add_object) && (add_type==AMITK_OBJECT_TYPE_ROI))
+-	  tree_view_popup_roi_menu(tree_view, object, event->button, event->time);
++	  tree_view_popup_roi_menu(tree_view, object, event);
+ 	break;
+ 
+       case AMITK_TREE_VIEW_MODE_SINGLE_SELECTION:
+@@ -676,7 +674,7 @@
+ 	gtk_tree_path_free(path);
+ 	gtk_tree_model_get(model, &iter, COLUMN_OBJECT, &object, -1);
+ 	
+-	if ((event->keyval == GDK_x) || (event->keyval == GDK_X))
++	if ((event->keyval == GDK_KEY_x) || (event->keyval == GDK_KEY_X))
+ 	  if (!AMITK_IS_STUDY(object))
+ 	    g_signal_emit(G_OBJECT(tree_view), tree_view_signals[DELETE_OBJECT], 0, object);
+       }
+@@ -799,29 +797,31 @@
+ static GdkPixbuf * tree_view_get_object_pixbuf(AmitkTreeView * tree_view, AmitkObject * object) {
+ 
+   GdkPixbuf * pixbuf=NULL;
++  GtkIconTheme * theme = gtk_icon_theme_get_default();
++  GtkIconLookupFlags flags = GTK_ICON_LOOKUP_FORCE_SIZE;
+ 
+   if (AMITK_IS_ROI(object)) {
+     switch (AMITK_ROI_TYPE(object)) {
+     case AMITK_ROI_TYPE_ELLIPSOID:
+-      pixbuf = gtk_widget_render_icon(GTK_WIDGET(tree_view), "amide_icon_roi_ellipsoid", GTK_ICON_SIZE_LARGE_TOOLBAR, 0);
++      pixbuf = gtk_icon_theme_load_icon(theme, "amide_icon_roi_ellipsoid", 24, flags, NULL);
+       break;
+     case AMITK_ROI_TYPE_CYLINDER:
+-      pixbuf = gtk_widget_render_icon(GTK_WIDGET(tree_view), "amide_icon_roi_cylinder", GTK_ICON_SIZE_LARGE_TOOLBAR, 0);
++      pixbuf = gtk_icon_theme_load_icon(theme, "amide_icon_roi_cylinder", 24, flags, NULL);
+       break;
+     case AMITK_ROI_TYPE_BOX:
+-      pixbuf = gtk_widget_render_icon(GTK_WIDGET(tree_view), "amide_icon_roi_box", GTK_ICON_SIZE_LARGE_TOOLBAR, 0);
++      pixbuf = gtk_icon_theme_load_icon(theme, "amide_icon_roi_box", 24, flags, NULL);
+       break;
+     case AMITK_ROI_TYPE_ISOCONTOUR_2D:
+-      pixbuf = gtk_widget_render_icon(GTK_WIDGET(tree_view), "amide_icon_roi_isocontour_2d", GTK_ICON_SIZE_LARGE_TOOLBAR, 0);
++      pixbuf = gtk_icon_theme_load_icon(theme, "amide_icon_roi_isocontour_2d", 24, flags, NULL);
+       break;
+     case AMITK_ROI_TYPE_ISOCONTOUR_3D:
+-      pixbuf = gtk_widget_render_icon(GTK_WIDGET(tree_view), "amide_icon_roi_isocontour_3d", GTK_ICON_SIZE_LARGE_TOOLBAR, 0);
++      pixbuf = gtk_icon_theme_load_icon(theme, "amide_icon_roi_isocontour_3d", 24, flags, NULL);
+       break;
+     case AMITK_ROI_TYPE_FREEHAND_2D:
+-      pixbuf = gtk_widget_render_icon(GTK_WIDGET(tree_view), "amide_icon_roi_freehand_2d", GTK_ICON_SIZE_LARGE_TOOLBAR, 0);
++      pixbuf = gtk_icon_theme_load_icon(theme, "amide_icon_roi_freehand_2d", 24, flags, NULL);
+       break;
+     case AMITK_ROI_TYPE_FREEHAND_3D:
+-      pixbuf = gtk_widget_render_icon(GTK_WIDGET(tree_view), "amide_icon_roi_freehand_3d", GTK_ICON_SIZE_LARGE_TOOLBAR, 0);
++      pixbuf = gtk_icon_theme_load_icon(theme, "amide_icon_roi_freehand_3d", 24, flags, NULL);
+       break;
+     default:
+       g_error("Unknown case in %s at %d\n", __FILE__, __LINE__);
+@@ -831,9 +831,9 @@
+   } else if (AMITK_IS_DATA_SET(object)) {
+     pixbuf = image_get_data_set_pixbuf(AMITK_DATA_SET(object));
+   } else if (AMITK_IS_STUDY(object)) {
+-    pixbuf = gtk_widget_render_icon(GTK_WIDGET(tree_view), "amide_icon_study", GTK_ICON_SIZE_LARGE_TOOLBAR, 0);
++    pixbuf = gtk_icon_theme_load_icon(theme, "amide_icon_study", 24, flags, NULL);
+   } else if (AMITK_IS_FIDUCIAL_MARK(object)) {
+-    pixbuf = gtk_widget_render_icon(GTK_WIDGET(tree_view), "amide_icon_align_pt", GTK_ICON_SIZE_LARGE_TOOLBAR, 0);
++    pixbuf = gtk_icon_theme_load_icon(theme, "amide_icon_align_pt", 24, flags, NULL);
+   } else {
+     g_error("Unknown case in %s at %d\n", __FILE__, __LINE__);
+   }
+--- amide.orig/amide-current/src/amitk_window_edit.c
++++ amide/amide-current/src/amitk_window_edit.c
+@@ -33,12 +33,12 @@
+ 
+ static void window_edit_class_init (AmitkWindowEditClass *class);
+ static void window_edit_init (AmitkWindowEdit *window_edit);
+-static void window_edit_destroy(GtkObject * object);
++static void window_edit_destroy(GtkWidget * object);
+ static void window_spin_cb(GtkWidget * widget, gpointer window_edit);
+ static void insert_window_level_cb  (GtkWidget * widget, gpointer window_edit);
+ static void window_edit_update_entries(AmitkWindowEdit * window_edit);
+ 
+-static GtkVBoxClass *parent_class;
++static GtkBoxClass *parent_class;
+ 
+ GType amitk_window_edit_get_type (void) {
+ 
+@@ -60,7 +60,7 @@
+ 	NULL /* value table */
+       };
+ 
+-      window_edit_type = g_type_register_static(GTK_TYPE_VBOX, "AmitkWindowEdit", &window_edit_info, 0);
++      window_edit_type = g_type_register_static(GTK_TYPE_BOX, "AmitkWindowEdit", &window_edit_info, 0);
+     }
+ 
+   return window_edit_type;
+@@ -68,7 +68,7 @@
+ 
+ static void window_edit_class_init (AmitkWindowEditClass *class)
+ {
+-  GtkObjectClass *gtkobject_class = GTK_OBJECT_CLASS(class);
++  GtkWidgetClass *gtkobject_class = GTK_WIDGET_CLASS(class);
+ 
+   parent_class = g_type_class_peek_parent(class);
+ 
+@@ -86,26 +86,29 @@
+ 
+   guint table_row=0;
+ 
++  gtk_orientable_set_orientation(GTK_ORIENTABLE(window_edit),
++                                 GTK_ORIENTATION_VERTICAL);
+ 
+   /* initialize some critical stuff */
+   window_edit->data_set = NULL;
+   window_edit->preferences = NULL;
+ 
+-  table = gtk_table_new(11,4, FALSE);
++  table = gtk_grid_new();
++  gtk_grid_set_row_spacing(GTK_GRID(table), Y_PADDING);
++  gtk_grid_set_column_spacing(GTK_GRID(table), X_PADDING);
+   gtk_container_add(GTK_CONTAINER(window_edit), table);
+ 
+   for (i_limit = 0; i_limit < AMITK_LIMIT_NUM; i_limit++) {
+     window_edit->limit_label[i_limit]  = gtk_label_new(NULL);
+-    gtk_table_attach(GTK_TABLE(table), window_edit->limit_label[i_limit], 1+i_limit,2+i_limit, 
+-		     table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(table), window_edit->limit_label[i_limit],
++                             1+i_limit, table_row, 1, 1);
+     gtk_widget_show(window_edit->limit_label[i_limit]);
+   }
+   table_row++;
+ 
+   for (i_window = 0; i_window < AMITK_WINDOW_NUM; i_window++) {
+     label = gtk_label_new(_(amitk_window_names[i_window]));
+-    gtk_table_attach(GTK_TABLE(table), label, 0,1, 
+-		     table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(table), label, 0, table_row, 1, 1);
+     gtk_widget_show(label);
+       
+     for (i_limit = 0; i_limit < AMITK_LIMIT_NUM; i_limit++) {
+@@ -117,14 +120,14 @@
+ 		       G_CALLBACK(amitk_spin_button_scientific_output), NULL);
+       g_signal_connect(G_OBJECT(window_edit->window_spin[i_window][i_limit]), "value_changed",
+ 		       G_CALLBACK(window_spin_cb), window_edit);
+-      gtk_table_attach(GTK_TABLE(table), window_edit->window_spin[i_window][i_limit], 1+i_limit,2+i_limit, 
+-		       table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++      gtk_grid_attach(GTK_GRID(table), window_edit->window_spin[i_window][i_limit],
++                      1+i_limit, table_row, 1, 1);
+       gtk_widget_show(window_edit->window_spin[i_window][i_limit]);
+     }
+ 
+     window_edit->insert_button[i_window] = gtk_button_new_with_label("Insert Current Thresholds");
+-    gtk_table_attach(GTK_TABLE(table), window_edit->insert_button[i_window], 3,4,
+-		     table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(table), window_edit->insert_button[i_window],
++                    3, table_row, 1, 1);
+     g_object_set_data(G_OBJECT(window_edit->insert_button[i_window]), 
+ 		      "which_window", GINT_TO_POINTER(i_window));
+     g_signal_connect(G_OBJECT(window_edit->insert_button[i_window]), "clicked", 
+@@ -137,7 +140,7 @@
+ 
+ }
+ 
+-static void window_edit_destroy (GtkObject * gtkobject) {
++static void window_edit_destroy (GtkWidget * gtkobject) {
+ 
+   AmitkWindowEdit * window_edit;
+ 
+@@ -160,8 +163,8 @@
+     window_edit->preferences = NULL;
+   }
+ 
+-  if (GTK_OBJECT_CLASS (parent_class)->destroy)
+-    (* GTK_OBJECT_CLASS (parent_class)->destroy) (gtkobject);
++  if (GTK_WIDGET_CLASS (parent_class)->destroy)
++    (* GTK_WIDGET_CLASS (parent_class)->destroy) (gtkobject);
+ }
+ 
+ 
+--- amide.orig/amide-current/pixmaps/Makefile.am
++++ amide/amide-current/pixmaps/Makefile.am
+@@ -6,57 +6,58 @@
+ 	amide_logo.png \
+ 	amide_file_logo.png
+ 
+-EXTRA_DIST  = $(pixmap_DATA) 
++EXTRA_DIST = $(pixmap_DATA) \
++	     icons.xml \
++	     align_pt.png \
++	     amide_logo.png \
++	     fuse_type_blend.png \
++	     fuse_type_overlay.png \
++	     interpolation_nearest_neighbor.png \
++	     interpolation_trilinear.png \
++	     layout_linear.png \
++	     layout_orthogonal.png \
++	     panels_linear_x.png \
++	     panels_linear_y.png \
++	     panels_mixed.png \
++	     roi_box.png \
++	     roi_cylinder.png \
++	     roi_ellipsoid.png \
++	     roi_isocontour_2d.png \
++	     roi_isocontour_3d.png \
++	     roi_freehand_2d.png \
++	     roi_freehand_3d.png \
++	     study.png \
++	     target.png \
++	     threshold_style_min_max.png \
++	     threshold_style_center_width.png \
++	     thresholding.png \
++	     thresholding_per_slice.png \
++	     thresholding_per_frame.png \
++	     thresholding_interpolate_frames.png \
++	     thresholding_global.png \
++	     three_compartment.png \
++	     transfer_function.png \
++	     two_compartment.png \
++	     view_transverse.png \
++	     view_coronal.png \
++	     view_sagittal.png \
++	     view_single.png \
++	     view_linked.png \
++	     view_linked3.png \
++	     window_abdomen.png \
++	     window_brain.png \
++	     window_extremities.png \
++	     window_liver.png \
++	     window_lung.png \
++	     window_pelvis_soft_tissue.png \
++	     window_skull_base.png \
++	     window_spine_a.png \
++	     window_spine_b.png \
++	     window_thorax_soft_tissue.png
+ 
+ 
+-pixbuf_csource=$(GDK_PIXBUF_CSOURCE)
+-BUILT_SOURCES = \
+-	align_pt.h \
+-	amide_logo.h \
+-	fuse_type_blend.h \
+-	fuse_type_overlay.h \
+-	interpolation_nearest_neighbor.h \
+-	interpolation_trilinear.h \
+-	layout_linear.h \
+-	layout_orthogonal.h \
+-	panels_linear_x.h \
+-	panels_linear_y.h \
+-	panels_mixed.h \
+-	roi_box.h \
+-	roi_cylinder.h \
+-	roi_ellipsoid.h \
+-	roi_isocontour_2d.h \
+-	roi_isocontour_3d.h \
+-	roi_freehand_2d.h \
+-	roi_freehand_3d.h \
+-	study.h \
+-	target.h \
+-	threshold_style_min_max.h \
+-	threshold_style_center_width.h \
+-	thresholding.h \
+-	thresholding_per_slice.h \
+-	thresholding_per_frame.h \
+-	thresholding_interpolate_frames.h \
+-	thresholding_global.h \
+-	three_compartment.h \
+-	transfer_function.h \
+-	two_compartment.h \
+-	view_transverse.h \
+-	view_coronal.h \
+-	view_sagittal.h \
+-	view_single.h \
+-	view_linked.h \
+-	view_linked3.h \
+-	window_abdomen.h \
+-	window_brain.h \
+-	window_extremities.h \
+-	window_liver.h \
+-	window_lung.h \
+-	window_pelvis_soft_tissue.h \
+-	window_skull_base.h \
+-	window_spine_a.h \
+-	window_spine_b.h \
+-	window_thorax_soft_tissue.h
++compile_resources = $(GLIB_COMPILE_RESOURCES)
++BUILT_SOURCES = icons.c
+ 
+ ##	window_bone_icon.h \
+ ##	window_soft_tissue_icon.h \
+@@ -64,8 +65,8 @@
+ 
+ 
+ 
+-.png.h:
+-	$(pixbuf_csource) --raw --extern --name=$(subst .png,,$<) $< > $@
++icons.c: icons.xml
++	$(compile_resources) --generate-source $<
+ 
+ CLEANFILES = $(BUILT_SOURCES)
+ DISTCLEANFILES = *~
+--- amide.orig/amide-current/src/dcmtk_interface.cc
++++ amide/amide-current/src/dcmtk_interface.cc
+@@ -36,6 +36,7 @@
+ #include <sys/stat.h>
+ #include "amitk_data_set_DOUBLE_0D_SCALING.h"
+ #include <glib/gstdio.h> /* make sure we get g_mkdir on mingw32 */
++#include "amide.h"
+ 
+ /* dcmtk redefines a lot of things that they shouldn't... */
+ #undef PACKAGE_BUGREPORT
+@@ -1996,7 +1997,7 @@
+ 					 GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE,
+ 					 _("For series: %s\n\nListed in DICOMDIR: %s\n\nCould not read DICOM file: %s"),
+ 					 object_name, filename, image_name2);
+-		gtk_dialog_add_button(GTK_DIALOG(question), GTK_STOCK_OK, GTK_RESPONSE_OK);
++		gtk_dialog_add_button(GTK_DIALOG(question), _("_OK"), GTK_RESPONSE_OK);
+ 		gtk_dialog_add_button(GTK_DIALOG(question), 
+ 				      _("OK, ignore similar errors"),1);
+ 		return_val = gtk_dialog_run(GTK_DIALOG(question));
+@@ -2008,7 +2009,7 @@
+ 					 GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE,
+ 					 _("For series: %s\n\nListed in DICOMDIR: %s\n\nCould not read DICOM file: %s\n\nFound possible alternative file: %s"),
+ 					 object_name, filename, image_name2, lowercase_image_name2);
+-		gtk_dialog_add_button(GTK_DIALOG(question), GTK_STOCK_OK, GTK_RESPONSE_OK);
++		gtk_dialog_add_button(GTK_DIALOG(question), _("_OK"), GTK_RESPONSE_OK);
+ 		gtk_dialog_add_button(GTK_DIALOG(question), 
+ 				      _("OK, ignore similar errors"), 1);
+ 		gtk_dialog_add_button(GTK_DIALOG(question), 
+--- amide.orig/amide-current/src/pixmaps.c
++++ amide/amide-current/src/pixmaps.c
+@@ -26,118 +26,7 @@
+ #include "amitk_data_set.h"
+ #include "amitk_study.h"
+ 
+-#include "../pixmaps/amide_logo.h"
+-
+-#include "../pixmaps/interpolation_nearest_neighbor.h"
+-#include "../pixmaps/interpolation_trilinear.h"
+-#include "../pixmaps/transfer_function.h"
+-
+-
+-#include "../pixmaps/fuse_type_blend.h"
+-#include "../pixmaps/fuse_type_overlay.h"
+-
+-#include "../pixmaps/target.h"
+-
+-#include "../pixmaps/view_transverse.h"
+-#include "../pixmaps/view_coronal.h"
+-#include "../pixmaps/view_sagittal.h"
+-
+-#include "../pixmaps/view_single.h"
+-#include "../pixmaps/view_linked.h"
+-#include "../pixmaps/view_linked3.h"
+-
+-#include "../pixmaps/thresholding.h"
+-#include "../pixmaps/thresholding_per_slice.h"
+-#include "../pixmaps/thresholding_per_frame.h"
+-#include "../pixmaps/thresholding_interpolate_frames.h"
+-#include "../pixmaps/thresholding_global.h"
+-
+-#include "../pixmaps/threshold_style_min_max.h"
+-#include "../pixmaps/threshold_style_center_width.h"
+-
+-/* #include "../pixmaps/window_bone_icon.h" */
+-/* #include "../pixmaps/window_soft_tissue_icon.h" */
+-#include "../pixmaps/window_abdomen.h"
+-#include "../pixmaps/window_brain.h"
+-#include "../pixmaps/window_extremities.h"
+-#include "../pixmaps/window_liver.h"
+-#include "../pixmaps/window_lung.h"
+-#include "../pixmaps/window_pelvis_soft_tissue.h"
+-#include "../pixmaps/window_skull_base.h"
+-#include "../pixmaps/window_spine_a.h"
+-#include "../pixmaps/window_spine_b.h"
+-#include "../pixmaps/window_thorax_soft_tissue.h"
+-
+-
+-#include "../pixmaps/roi_box.h"
+-#include "../pixmaps/roi_cylinder.h"
+-#include "../pixmaps/roi_ellipsoid.h"
+-#include "../pixmaps/roi_isocontour_2d.h"
+-#include "../pixmaps/roi_isocontour_3d.h"
+-#include "../pixmaps/roi_freehand_2d.h"
+-#include "../pixmaps/roi_freehand_3d.h"
+-#include "../pixmaps/align_pt.h"
+-#include "../pixmaps/study.h"
+-
+-#include "../pixmaps/layout_linear.h"
+-#include "../pixmaps/layout_orthogonal.h"
+-
+-#include "../pixmaps/panels_mixed.h"
+-#include "../pixmaps/panels_linear_x.h"
+-#include "../pixmaps/panels_linear_y.h"
+-
+-
+-static gboolean icons_initialized=FALSE;
+-
+-static struct {
+-  const guint8 * pixbuf_inline;
+-  const gchar * icon_id;
+-} amide_icons[] = {
+-  { amide_logo, "amide_icon_logo" },
+-  { align_pt, "amide_icon_align_pt" },
+-  { fuse_type_blend, "amide_icon_fuse_type_blend" },
+-  { fuse_type_overlay, "amide_icon_fuse_type_overlay" },
+-  { interpolation_nearest_neighbor, "amide_icon_interpolation_nearest_neighbor" },
+-  { interpolation_trilinear, "amide_icon_interpolation_trilinear" },
+-  { layout_linear, "amide_icon_layout_linear" },
+-  { layout_orthogonal, "amide_icon_layout_orthogonal" },
+-  { panels_mixed, "amide_icon_panels_mixed" },
+-  { panels_linear_x, "amide_icon_panels_linear_x" },
+-  { panels_linear_y, "amide_icon_panels_linear_y" },
+-  { roi_box, "amide_icon_roi_box" },
+-  { roi_cylinder, "amide_icon_roi_cylinder" },
+-  { roi_ellipsoid, "amide_icon_roi_ellipsoid" },
+-  { roi_isocontour_2d, "amide_icon_roi_isocontour_2d"},
+-  { roi_isocontour_3d, "amide_icon_roi_isocontour_3d"},
+-  { roi_freehand_2d, "amide_icon_roi_freehand_2d"},
+-  { roi_freehand_3d, "amide_icon_roi_freehand_3d"},
+-  { study, "amide_icon_study"},
+-  { target, "amide_icon_canvas_target" },
+-  { transfer_function, "amide_icon_transfer_function" },
+-  { threshold_style_min_max, "amide_icon_threshold_style_min_max" },
+-  { threshold_style_center_width, "amide_icon_threshold_style_center_width" },
+-  { thresholding, "amide_icon_thresholding" },  
+-  { thresholding_per_slice, "amide_icon_thresholding_per_slice" },
+-  { thresholding_per_frame, "amide_icon_thresholding_per_frame" },
+-  { thresholding_interpolate_frames, "amide_icon_thresholding_interpolate_frames" },
+-  { thresholding_global, "amide_icon_thresholding_global" },
+-  { view_transverse, "amide_icon_view_transverse" },
+-  { view_coronal, "amide_icon_view_coronal" },
+-  { view_sagittal, "amide_icon_view_sagittal" },
+-  { view_single, "amide_icon_view_mode_single" },
+-  { view_linked, "amide_icon_view_mode_linked_2way" },
+-  { view_linked3, "amide_icon_view_mode_linked_3way" },
+-  { window_abdomen, "amide_icon_window_abdomen" },
+-  { window_brain, "amide_icon_window_brain" },
+-  { window_extremities,"amide_icon_window_extremities" },
+-  { window_liver,"amide_icon_window_window_liver" },
+-  { window_lung,"amide_icon_window_lung" },
+-  { window_pelvis_soft_tissue,"amide_icon_window_pelvis_soft_tissue" },
+-  { window_skull_base,"amide_icon_window_skull_base"},
+-  { window_spine_a,"amide_icon_window_spine_a"},
+-  { window_spine_b,"amide_icon_window_spine_b"},
+-  { window_thorax_soft_tissue,"amide_icon_window_soft_tissue"},
+-};
++#include "../pixmaps/icons.c"
+ 
+ const gchar * windowing_icons[AMITK_WINDOW_NUM] = {
+   "amide_icon_window_abdomen",
+@@ -154,32 +43,3 @@
+   //  amide_icon_window_bone,
+   //  amide_icon_window_soft_tissue_icon
+ 
+-void pixmaps_initialize_icons() {
+-
+-  GtkIconFactory *icon_factory;
+-  GtkIconSet *icon_set; 
+-  GdkPixbuf * pixbuf;
+-  gint i;
+-
+-  if (icons_initialized) return;
+-
+-  /* create amide's group of icons */
+-  icon_factory = gtk_icon_factory_new();
+-
+-  for (i=0; i < G_N_ELEMENTS(amide_icons); i++) {
+-    pixbuf = gdk_pixbuf_new_from_inline(-1, amide_icons[i].pixbuf_inline, FALSE, NULL);
+-    icon_set = gtk_icon_set_new_from_pixbuf(pixbuf);
+-    g_object_unref(pixbuf);
+-
+-    gtk_icon_factory_add (icon_factory, amide_icons[i].icon_id, icon_set);
+-    gtk_icon_set_unref (icon_set);
+-  }
+-
+-
+-  /* add this group of icon's to the list of icon's GTK will search for AMIDE */
+-  gtk_icon_factory_add_default (icon_factory); 
+-  g_object_unref (icon_factory);
+-
+-  icons_initialized=TRUE;
+-  return;
+-}
+--- amide.orig/amide-current/src/fads.c
++++ amide/amide-current/src/fads.c
+@@ -31,6 +31,7 @@
+ #include <gsl/gsl_multimin.h>
+ #include "fads.h"
+ #include "amitk_data_set_FLOAT_0D_SCALING.h"
++#include "amide.h"
+ 
+ 
+ #define FINAL_MU 1e-07
+@@ -63,14 +64,6 @@
+ 
+ };
+ 
+-#include "../pixmaps/two_compartment.h"
+-
+-const guint8 * fads_type_icon[NUM_FADS_TYPES] = {
+-  NULL,
+-  NULL,
+-  two_compartment
+-};
+-
+ 
+ static gint perform_svd(gsl_matrix * a, gsl_matrix * v, gsl_vector * s) {
+ 
+--- amide.orig/amide-current/src/fads.h
++++ amide/amide-current/src/fads.h
+@@ -50,7 +50,6 @@
+ extern gchar * fads_minimizer_algorithm_name[];
+ extern gchar * fads_type_name[];
+ extern gchar * fads_type_explanation[];
+-extern const guint8 * fads_type_icon[];
+ 
+ void fads_svd_factors(AmitkDataSet * data_set, 
+ 		      gint * pnum_factors,
+--- amide.orig/amide-current/src/raw_data_import.c
++++ amide/amide-current/src/raw_data_import.c
+@@ -352,22 +352,21 @@
+   g_free(temp_string);
+ 
+   raw_data_info->ok_button = gtk_dialog_add_button(GTK_DIALOG(dialog), 
+-						   GTK_STOCK_OK, GTK_RESPONSE_YES);
++						   _("_OK"), GTK_RESPONSE_YES);
+   gtk_dialog_add_button(GTK_DIALOG(dialog),
+-			GTK_STOCK_CANCEL, GTK_RESPONSE_CLOSE);
++			_("_Cancel"), GTK_RESPONSE_CLOSE);
+ 
+   /* make the packing table */
+-  packing_table = gtk_table_new(10,6,FALSE);
+-  gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox),packing_table);
++  packing_table = gtk_grid_new();
++  gtk_grid_set_row_spacing(GTK_GRID(packing_table), Y_PADDING);
++  gtk_grid_set_column_spacing(GTK_GRID(packing_table), X_PADDING);
++  gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area
++                                  (GTK_DIALOG(dialog))), packing_table);
+ 
+   /* widgets to change the roi's name */
+   label = gtk_label_new(_("name:"));
+-  gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
+-  gtk_table_attach(GTK_TABLE(packing_table),
+-		   GTK_WIDGET(label), 0,1,
+-		   table_row, table_row+1,
+- 		   GTK_FILL|GTK_EXPAND, 0,
+-		   X_PADDING, Y_PADDING);
++  gtk_label_set_xalign(GTK_LABEL(label), 1.0);
++  gtk_grid_attach(GTK_GRID(packing_table), label, 0, table_row, 1, 1);
+ 
+   /* figure out an initial name for the data */
+   temp_string = g_path_get_basename(raw_data_info->filename);
+@@ -387,11 +386,7 @@
+ 
+   gtk_editable_set_editable(GTK_EDITABLE(entry), TRUE);
+   g_signal_connect(G_OBJECT(entry), "changed", G_CALLBACK(change_name_cb), raw_data_info);
+-  gtk_table_attach(GTK_TABLE(packing_table),
+- 		   GTK_WIDGET(entry),1,3,
+-		   table_row, table_row+1,
+- 		   GTK_FILL | GTK_EXPAND, 0,
+-		   X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), entry, 1, table_row, 2, 1);
+  
+   table_row++;
+ 
+@@ -400,70 +395,52 @@
+ 
+   /* widgets to change the object's modality */
+   label = gtk_label_new(_("modality:"));
+-   gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
+-  gtk_table_attach(GTK_TABLE(packing_table),
+-  		   GTK_WIDGET(label), 0,1,
+-  		   table_row, table_row+1,
+-   		   GTK_FILL|GTK_EXPAND, 0,
+-  		   X_PADDING, Y_PADDING);
++  gtk_label_set_xalign(GTK_LABEL(label), 1.0);
++  gtk_grid_attach(GTK_GRID(packing_table), label, 0, table_row, 1, 1);
+ 
+ 
+-  menu = gtk_combo_box_new_text();
++  menu = gtk_combo_box_text_new();
+   for (i_modality=0; i_modality<AMITK_MODALITY_NUM; i_modality++) 
+-    gtk_combo_box_append_text(GTK_COMBO_BOX(menu),
++    gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(menu),
+ 			      amitk_modality_get_name(i_modality));
+   gtk_combo_box_set_active(GTK_COMBO_BOX(menu), raw_data_info->modality);
+   g_signal_connect(G_OBJECT(menu), "changed", G_CALLBACK(change_modality_cb), raw_data_info);
+-  gtk_table_attach(GTK_TABLE(packing_table), 
+-		   GTK_WIDGET(menu), 1,3, 
+-		   table_row,table_row+1,
+-		   X_PACKING_OPTIONS | GTK_FILL, 0, 
+-		   X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), menu, 1, table_row, 2, 1);
+   table_row++;
+ 
+ 
+   /* widgets to change the raw data file's  data format */
+   label = gtk_label_new(_("data format:"));
+-  gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
+-  gtk_table_attach(GTK_TABLE(packing_table),
+-		   GTK_WIDGET(label), 0,1,
+-		   table_row, table_row+1,
+- 		   GTK_FILL|GTK_EXPAND, 0,
+-		   X_PADDING, Y_PADDING);
+-  menu = gtk_combo_box_new_text();
++  gtk_label_set_xalign(GTK_LABEL(label), 1.0);
++  gtk_grid_attach(GTK_GRID(packing_table), label, 0, table_row, 1, 1);
++  menu = gtk_combo_box_text_new();
+   for (i_raw_format=0; i_raw_format<AMITK_RAW_FORMAT_NUM; i_raw_format++) 
+-    gtk_combo_box_append_text(GTK_COMBO_BOX(menu),
++    gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(menu),
+ 			      amitk_raw_format_names[i_raw_format]);
+   gtk_combo_box_set_active(GTK_COMBO_BOX(menu), raw_data_info->raw_format);
+   g_signal_connect(G_OBJECT(menu), "changed", 
+ 		   G_CALLBACK(change_raw_format_cb), raw_data_info);
+-  gtk_table_attach(GTK_TABLE(packing_table), 
+-		   GTK_WIDGET(menu), 1,3, 
+-		   table_row,table_row+1,
+-		   X_PACKING_OPTIONS | GTK_FILL, 0, 
+-		   X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), menu, 1, table_row, 2, 1);
+ 
+   /* how many bytes we can read from the file */
+   label = gtk_label_new(_("file size (bytes):"));
+-  gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
+-  gtk_table_attach(GTK_TABLE(packing_table), GTK_WIDGET(label), 3,5,
+- 		   table_row, table_row+1, GTK_FILL | GTK_EXPAND, 0, X_PADDING, Y_PADDING);
++  gtk_label_set_xalign(GTK_LABEL(label), 1.0);
++  gtk_grid_attach(GTK_GRID(packing_table), label, 3, table_row, 2, 1);
+   /* how many bytes we're currently reading from the file */
+   temp_string = g_strdup_printf("%lu", raw_data_info->total_file_size);
+   label = gtk_label_new(temp_string);
+-  gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
++  gtk_label_set_xalign(GTK_LABEL(label), 0.0);
+   g_free(temp_string);
+-  gtk_table_attach(GTK_TABLE(packing_table), GTK_WIDGET(label), 5,6,
+-		   table_row, table_row+1, GTK_FILL | GTK_EXPAND, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), label, 5, table_row, 1, 1);
+   table_row++;
+ 
+ 
+   /* what offset in the raw_data file we should start reading at */
+   raw_data_info->read_offset_label = gtk_label_new("");
+-  gtk_misc_set_alignment(GTK_MISC(raw_data_info->read_offset_label), 1.0, 0.5);
++  gtk_label_set_xalign(GTK_LABEL(raw_data_info->read_offset_label), 1.0);
+   update_offset_label(raw_data_info);
+-  gtk_table_attach(GTK_TABLE(packing_table), GTK_WIDGET(raw_data_info->read_offset_label), 0,1,
+- 		   table_row, table_row+1, GTK_FILL | GTK_EXPAND, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), raw_data_info->read_offset_label,
++                  0, table_row, 1, 1);
+ 
+   entry = gtk_entry_new();
+   temp_string = g_strdup_printf("%d", raw_data_info->offset);
+@@ -472,19 +449,18 @@
+   gtk_editable_set_editable(GTK_EDITABLE(entry), TRUE);
+   g_object_set_data(G_OBJECT(entry), "type", GINT_TO_POINTER(AMITK_DIM_NUM+AMITK_AXIS_NUM));
+   g_signal_connect(G_OBJECT(entry), "changed", G_CALLBACK(change_entry_cb),  raw_data_info);
+-  gtk_table_attach(GTK_TABLE(packing_table), GTK_WIDGET(entry),1,3,
+- 		   table_row, table_row+1, GTK_FILL | GTK_EXPAND, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), entry, 1, table_row, 2, 1);
+ 
+ 
+   /* how many bytes we're currently reading from the file */
+   raw_data_info->num_bytes_label1 = gtk_label_new("");
+   raw_data_info->num_bytes_label2 = gtk_label_new("");
+-  gtk_misc_set_alignment(GTK_MISC(raw_data_info->num_bytes_label1), 1.0, 0.5);
+-  gtk_misc_set_alignment(GTK_MISC(raw_data_info->num_bytes_label2), 0.0, 0.5);
+-  gtk_table_attach(GTK_TABLE(packing_table), GTK_WIDGET(raw_data_info->num_bytes_label1), 
+- 		   3,5, table_row, table_row+1, GTK_FILL|GTK_EXPAND, 0, X_PADDING, Y_PADDING);
+-  gtk_table_attach(GTK_TABLE(packing_table), GTK_WIDGET(raw_data_info->num_bytes_label2), 
+- 		   5,6, table_row, table_row+1, GTK_FILL|GTK_EXPAND, 0, X_PADDING, Y_PADDING);
++  gtk_label_set_xalign(GTK_LABEL(raw_data_info->num_bytes_label1), 1.0);
++  gtk_label_set_xalign(GTK_LABEL(raw_data_info->num_bytes_label2), 0.0);
++  gtk_grid_attach(GTK_GRID(packing_table), raw_data_info->num_bytes_label1,
++                  3, table_row, 2, 1);
++  gtk_grid_attach(GTK_GRID(packing_table), raw_data_info->num_bytes_label2,
++                  5, table_row, 1, 1);
+   update_num_bytes(raw_data_info); /* put something sensible into the label */
+   table_row++;
+ 
+@@ -492,28 +468,22 @@
+ 
+   /* labels for the x, y, and z components */
+   label = gtk_label_new(_("x"));
+-  gtk_table_attach(GTK_TABLE(packing_table), GTK_WIDGET(label), 1,2,
+-		   table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), label, 1, table_row, 1, 1);
+   label = gtk_label_new(_("y"));
+-  gtk_table_attach(GTK_TABLE(packing_table), GTK_WIDGET(label), 2,3,
+-		   table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), label, 2, table_row, 1, 1);
+   label = gtk_label_new(_("z"));
+-  gtk_table_attach(GTK_TABLE(packing_table), GTK_WIDGET(label), 3,4,
+-		   table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), label, 3, table_row, 1, 1);
+   label = gtk_label_new(_("gates"));
+-  gtk_table_attach(GTK_TABLE(packing_table), GTK_WIDGET(label), 4,5,
+-		   table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), label, 4, table_row, 1, 1);
+   label = gtk_label_new(_("frames"));
+-  gtk_table_attach(GTK_TABLE(packing_table), GTK_WIDGET(label), 5,6,
+-		   table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), label, 5, table_row, 1, 1);
+   table_row++;
+ 
+ 
+   /* widgets to change the dimensions of the data set */
+   label = gtk_label_new(_("dimensions (# voxels)"));
+-  gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
+-  gtk_table_attach(GTK_TABLE(packing_table), GTK_WIDGET(label), 0,1,
+- 		   table_row, table_row+1, GTK_FILL|GTK_EXPAND, 0, X_PADDING, Y_PADDING);
++  gtk_label_set_xalign(GTK_LABEL(label), 1.0);
++  gtk_grid_attach(GTK_GRID(packing_table), label, 0, table_row, 1, 1);
+ 
+ 
+   for (i_dim=0; i_dim<AMITK_DIM_NUM; i_dim++) {
+@@ -525,16 +495,14 @@
+     gtk_editable_set_editable(GTK_EDITABLE(entry), TRUE);
+     g_object_set_data(G_OBJECT(entry), "type", GINT_TO_POINTER(i_dim));
+     g_signal_connect(G_OBJECT(entry), "changed", G_CALLBACK(change_entry_cb), raw_data_info);
+-    gtk_table_attach(GTK_TABLE(packing_table), GTK_WIDGET(entry),i_dim+1,i_dim+2,
+-		     table_row, table_row+1, X_PACKING_OPTIONS, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(packing_table), entry, i_dim+1, table_row, 1, 1);
+   }
+   table_row++;
+ 
+   /* widgets to change the voxel size of the data set */
+   label = gtk_label_new(_("voxel size (mm)"));
+-  gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
+-  gtk_table_attach(GTK_TABLE(packing_table), GTK_WIDGET(label), 0,1,
+- 		   table_row, table_row+1, GTK_FILL|GTK_EXPAND, 0, X_PADDING, Y_PADDING);
++  gtk_label_set_xalign(GTK_LABEL(label), 1.0);
++  gtk_grid_attach(GTK_GRID(packing_table), label, 0, table_row, 1, 1);
+ 
+ 
+   for (i_axis=0; i_axis<AMITK_AXIS_NUM; i_axis++) {
+@@ -547,17 +515,15 @@
+     g_object_set_data(G_OBJECT(entry), "type", GINT_TO_POINTER(i_axis+AMITK_DIM_NUM));
+     g_signal_connect(G_OBJECT(entry), "changed", G_CALLBACK(change_entry_cb), 
+ 		       raw_data_info);
+-    gtk_table_attach(GTK_TABLE(packing_table), GTK_WIDGET(entry),i_axis+1,i_axis+2,
+-		     table_row, table_row+1, X_PACKING_OPTIONS, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(packing_table), entry, i_axis+1, table_row, 1, 1);
+   }
+   table_row++;
+ 
+ 
+   /* scale factor to apply to the data */
+   label = gtk_label_new(_("scale factor"));
+-  gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);
+-  gtk_table_attach(GTK_TABLE(packing_table), GTK_WIDGET(label), 0,1,
+- 		   table_row, table_row+1, GTK_FILL|GTK_EXPAND, 0, X_PADDING, Y_PADDING);
++  gtk_label_set_xalign(GTK_LABEL(label), 1.0);
++  gtk_grid_attach(GTK_GRID(packing_table), label, 0, table_row, 1, 1);
+ 
+ 
+   entry = gtk_entry_new();
+@@ -567,8 +533,7 @@
+   g_free(temp_string);
+   gtk_editable_set_editable(GTK_EDITABLE(entry), TRUE);
+   g_signal_connect(G_OBJECT(entry), "changed", G_CALLBACK(change_scaling_cb), raw_data_info);
+-  gtk_table_attach(GTK_TABLE(packing_table), GTK_WIDGET(entry),1,2,
+-		   table_row, table_row+1, X_PACKING_OPTIONS, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), entry, 1, table_row, 1, 1);
+   table_row++;
+ 
+   gtk_widget_show_all(dialog);
+--- amide.orig/amide-current/src/tb_alignment.c
++++ amide/amide-current/src/tb_alignment.c
+@@ -459,7 +459,8 @@
+   GtkWidget * rb[NUM_ALIGNMENT_TYPES];
+   which_alignment_t i_alignment;
+ 
+-  vbox = gtk_vbox_new (TRUE, 2);
++  vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2);
++  gtk_box_set_homogeneous (GTK_BOX (vbox), TRUE);
+   for (i_alignment = 0; i_alignment < NUM_ALIGNMENT_TYPES; i_alignment ++) {
+     if (i_alignment == 0)
+       rb[i_alignment] =  gtk_radio_button_new_with_label(NULL, alignment_names[i_alignment]);
+@@ -487,7 +488,9 @@
+   GtkTreeSelection *selection;
+   GtkWidget * vseparator;
+ 
+-  table = gtk_table_new(3,3,FALSE);
++  table = gtk_grid_new();
++  gtk_grid_set_row_spacing(GTK_GRID(table), Y_PADDING);
++  gtk_grid_set_column_spacing(GTK_GRID(table), X_PADDING);
+     
+   /* the moving data set */
+   store = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_POINTER);
+@@ -505,12 +508,13 @@
+   g_signal_connect(G_OBJECT(selection), "changed",
+ 		   G_CALLBACK(data_set_selection_changed_cb), tb_alignment);
+ 
+-  gtk_table_attach(GTK_TABLE(table),tb_alignment->list_moving_ds, 0,1,0,1,
+-		   GTK_FILL|GTK_EXPAND, GTK_FILL | GTK_EXPAND,X_PADDING, Y_PADDING);
++  gtk_widget_set_hexpand(tb_alignment->list_moving_ds, TRUE);
++  gtk_widget_set_vexpand(tb_alignment->list_moving_ds, TRUE);
++  gtk_grid_attach(GTK_GRID(table), tb_alignment->list_moving_ds, 0, 0, 1, 1);
+ 
+ 
+-  vseparator = gtk_vseparator_new();
+-  gtk_table_attach(GTK_TABLE(table), vseparator, 1,2,0,2, 0, GTK_FILL, X_PADDING, Y_PADDING);
++  vseparator = gtk_separator_new(GTK_ORIENTATION_VERTICAL);
++  gtk_grid_attach(GTK_GRID(table), vseparator, 1, 0, 1, 2);
+   
+   /* the fixed data set */
+   store = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_POINTER);
+@@ -528,8 +532,9 @@
+   g_signal_connect(G_OBJECT(selection), "changed",
+ 		   G_CALLBACK(data_set_selection_changed_cb), tb_alignment);
+ 
+-  gtk_table_attach(GTK_TABLE(table),tb_alignment->list_fixed_ds, 2,3,0,1,
+-		   GTK_FILL|GTK_EXPAND, GTK_FILL | GTK_EXPAND,X_PADDING, Y_PADDING);
++  gtk_widget_set_hexpand(tb_alignment->list_fixed_ds, TRUE);
++  gtk_widget_set_vexpand(tb_alignment->list_fixed_ds, TRUE);
++  gtk_grid_attach(GTK_GRID(table), tb_alignment->list_fixed_ds, 2, 0, 1, 1);
+ 
+   return table;
+ }
+@@ -542,7 +547,9 @@
+   GtkTreeViewColumn *column;
+   GtkTreeSelection *selection;
+   
+-  table = gtk_table_new(2,2,FALSE);
++  table = gtk_grid_new();
++  gtk_grid_set_row_spacing(GTK_GRID(table), Y_PADDING);
++  gtk_grid_set_column_spacing(GTK_GRID(table), X_PADDING);
+ 
+   store = gtk_list_store_new(3, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_POINTER);
+   tb_alignment->list_points = gtk_tree_view_new_with_model (GTK_TREE_MODEL (store));
+@@ -563,8 +570,9 @@
+ 
+   selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tb_alignment->list_points));
+   gtk_tree_selection_set_mode (selection, GTK_SELECTION_NONE);
+-  gtk_table_attach(GTK_TABLE(table),tb_alignment->list_points, 0,1,0,1,
+-		   GTK_FILL|GTK_EXPAND, GTK_FILL | GTK_EXPAND,X_PADDING, Y_PADDING);
++  gtk_widget_set_hexpand(tb_alignment->list_points, TRUE);
++  gtk_widget_set_vexpand(tb_alignment->list_points, TRUE);
++  gtk_grid_attach(GTK_GRID(table), tb_alignment->list_points, 0, 0, 1, 1);
+ 
+   return table;
+ }
+@@ -670,7 +678,6 @@
+ void tb_alignment(AmitkStudy * study, GtkWindow * parent) {
+ 
+   tb_alignment_t * tb_alignment;
+-  GdkPixbuf * logo;
+   guint count;
+   gint i;
+   
+@@ -749,12 +756,9 @@
+ 			      GTK_ASSISTANT_PAGE_CONFIRM);
+ 
+   /* things for all page */
+-  logo = gtk_widget_render_icon(GTK_WIDGET(tb_alignment->dialog), "amide_icon_logo", GTK_ICON_SIZE_DIALOG, 0);
+   for (i=0; i<NUM_PAGES; i++) {
+-    gtk_assistant_set_page_header_image(GTK_ASSISTANT(tb_alignment->dialog), tb_alignment->page[i], logo);
+     g_object_set_data(G_OBJECT(tb_alignment->page[i]),"which_page", GINT_TO_POINTER(i));
+   }
+-  g_object_unref(logo);
+ 
+   gtk_widget_show_all(tb_alignment->dialog);
+ 
+--- amide.orig/amide-current/src/tb_crop.c
++++ amide/amide-current/src/tb_crop.c
+@@ -76,10 +76,10 @@
+   AmitkDataSet * data_set;
+   AmitkDataSet * projections[AMITK_VIEW_NUM];
+   GtkWidget * canvas[AMITK_VIEW_NUM];
+-  GnomeCanvasItem * image[AMITK_VIEW_NUM];
++  GooCanvasItem * image[AMITK_VIEW_NUM];
+   gint canvas_width[AMITK_VIEW_NUM];
+   gint canvas_height[AMITK_VIEW_NUM];
+-  GnomeCanvasItem * line[AMITK_VIEW_NUM][2][NUM_RANGES];
++  GooCanvasItem * line[AMITK_VIEW_NUM][2][NUM_RANGES];
+   GtkWidget * threshold[AMITK_VIEW_NUM];
+ 
+   GList * update_view;
+@@ -186,16 +186,16 @@
+   GtkWidget * vseparator;
+   GtkWidget * middle_table;
+ 
+-  table = gtk_table_new(NUM_ROWS,5,FALSE);
++  table = gtk_grid_new();
++  gtk_grid_set_row_spacing(GTK_GRID(table), Y_PADDING);
++  gtk_grid_set_column_spacing(GTK_GRID(table), X_PADDING);
+       
+   table_row=0;
+   table_column=0;
+       
+   /* the zoom selection */
+   label = gtk_label_new(_("zoom"));
+-  gtk_table_attach(GTK_TABLE(table), label, 
+-		   table_column,table_column+1, table_row,table_row+1,
+-		   FALSE,FALSE, X_PADDING, 0);
++  gtk_grid_attach(GTK_GRID(table), label, table_column, table_row, 1, 1);
+ 
+   spin_button =  gtk_spin_button_new_with_range(0.2,5.0,0.2);
+   gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(spin_button), FALSE);
+@@ -204,18 +204,16 @@
+   g_object_set_data(G_OBJECT(spin_button), "which_view", GINT_TO_POINTER(view));
+   g_signal_connect(G_OBJECT(spin_button), "value_changed",  
+ 		   G_CALLBACK(zoom_spinner_cb), tb_crop);
+-  gtk_table_attach(GTK_TABLE(table), spin_button, 
+-		   table_column+1,table_column+2, table_row,table_row+1,
+-		   FALSE,FALSE, X_PADDING, 0);
++  gtk_widget_set_valign(spin_button, GTK_ALIGN_CENTER);
++  gtk_grid_attach(GTK_GRID(table), spin_button,
++                table_column+1, table_row, 1, 1);
+   tb_crop->zoom_spinner[view] = spin_button;
+   table_row++;
+       
+   /* the gate selection */
+   if (AMITK_DATA_SET_NUM_GATES(tb_crop->data_set) > 1) {
+     label = gtk_label_new(_("gate"));
+-    gtk_table_attach(GTK_TABLE(table), label, 
+-		     table_column,table_column+1, table_row,table_row+1,
+-		     FALSE,FALSE, X_PADDING, 0);
++    gtk_grid_attach(GTK_GRID(table), label, table_column, table_row, 1, 1);
+     
+     spin_button =  
+       gtk_spin_button_new_with_range(0,AMITK_DATA_SET_NUM_GATES(tb_crop->data_set)-1,1);
+@@ -224,9 +222,9 @@
+     g_object_set_data(G_OBJECT(spin_button), "which_view", GINT_TO_POINTER(view));
+     g_signal_connect(G_OBJECT(spin_button), "value_changed",  
+ 		     G_CALLBACK(gate_spinner_cb), tb_crop);
+-    gtk_table_attach(GTK_TABLE(table), spin_button, 
+-		     table_column+1,table_column+2, table_row,table_row+1,
+-		     FALSE,FALSE, X_PADDING, 0);
++    gtk_widget_set_valign(spin_button, GTK_ALIGN_CENTER);
++    gtk_grid_attach(GTK_GRID(table), spin_button,
++                    table_column+1, table_row, 1, 1);
+     tb_crop->gate_spinner[view] = spin_button;
+     table_row++;
+   }
+@@ -234,9 +232,7 @@
+   /* the frame selection */
+   if (AMITK_DATA_SET_NUM_FRAMES(tb_crop->data_set) > 1) {
+     label = gtk_label_new(_("frame"));
+-    gtk_table_attach(GTK_TABLE(table), label, 
+-		     table_column,table_column+1, table_row,table_row+1,
+-		     FALSE,FALSE, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(table), label, table_column, table_row, 1, 1);
+     
+     spin_button =  
+       gtk_spin_button_new_with_range(0,AMITK_DATA_SET_NUM_FRAMES(tb_crop->data_set)-1,1);
+@@ -245,22 +241,17 @@
+     g_object_set_data(G_OBJECT(spin_button), "which_view", GINT_TO_POINTER(view));
+     g_signal_connect(G_OBJECT(spin_button), "value_changed",  
+ 		     G_CALLBACK(frame_spinner_cb), tb_crop);
+-    gtk_table_attach(GTK_TABLE(table), spin_button, 
+-		     table_column+1,table_column+2, table_row,table_row+1,
+-		     FALSE,FALSE, X_PADDING, Y_PADDING);
++    gtk_widget_set_valign(spin_button, GTK_ALIGN_CENTER);
++    gtk_grid_attach(GTK_GRID(table), spin_button,
++                    table_column+1, table_row, 1, 1);
+     tb_crop->frame_spinner[view] = spin_button;
+     table_row++;
+   }
+       
+   /* the projection */
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+-  tb_crop->canvas[view] = gnome_canvas_new_aa();
+-#else
+-  tb_crop->canvas[view] = gnome_canvas_new();
+-#endif
+-  gtk_table_attach(GTK_TABLE(table), tb_crop->canvas[view], 
+-		   table_column,table_column+2,table_row,NUM_ROWS, 
+-		   FALSE,FALSE, X_PADDING, Y_PADDING);
++  tb_crop->canvas[view] = goo_canvas_new();
++  gtk_grid_attach(GTK_GRID(table), tb_crop->canvas[view],
++                  table_column, table_row, 2, NUM_ROWS - table_row);
+   add_canvas_update(tb_crop, view);
+   /* wait for canvas to update, this allows the projection to get made */
+   while (tb_crop->idle_handler_id != 0) gtk_main_iteration();
+@@ -269,19 +260,19 @@
+   table_column += 2;
+       
+   /* a separator for clarity */
+-  vseparator = gtk_vseparator_new();
+-  gtk_table_attach(GTK_TABLE(table), vseparator,
+-		   table_column, table_column+1, table_row, NUM_ROWS, 
+-		   0, GTK_FILL, X_PADDING, Y_PADDING);
++  vseparator = gtk_separator_new(GTK_ORIENTATION_VERTICAL);
++  gtk_grid_attach(GTK_GRID(table), vseparator, table_column, table_row,
++                  1, NUM_ROWS - table_row);
+   
+   table_row=0;
+   table_column += 1;
+ 
+   /* the middle table */
+-  middle_table = gtk_table_new(9, 3, FALSE);
+-  gtk_table_attach(GTK_TABLE(table), middle_table,
+-		   table_column, table_column+1, table_row, NUM_ROWS, 
+-		   0, GTK_FILL, X_PADDING, Y_PADDING);
++  middle_table = gtk_grid_new();
++  gtk_grid_set_row_spacing(GTK_GRID(middle_table), Y_PADDING);
++  gtk_grid_set_column_spacing(GTK_GRID(middle_table), X_PADDING);
++  gtk_grid_attach(GTK_GRID(table), middle_table, table_column, table_row,
++                  1, NUM_ROWS - table_row);
+   m_table_row=0;
+   /* the range selectors */
+   for (i_dim=0; i_dim<AMITK_DIM_NUM; i_dim++) {
+@@ -290,11 +281,9 @@
+       
+       temp_string = g_strdup_printf(_("%s range:"), amitk_dim_get_name(i_dim));
+       label = gtk_label_new(temp_string);
+-      gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
++      gtk_label_set_xalign(GTK_LABEL(label), 1.0);
+       g_free(temp_string);
+-      gtk_table_attach(GTK_TABLE(middle_table), label, 
+-		       0,1, m_table_row,m_table_row+1,
+-		       GTK_FILL|GTK_EXPAND,FALSE, X_PADDING, 0);
++      gtk_grid_attach(GTK_GRID(middle_table), label, 0, m_table_row, 1, 1);
+ 	  
+       for (i_range=0; i_range<NUM_RANGES; i_range++) {
+ 	spin_button =  
+@@ -308,26 +297,23 @@
+ 	g_object_set_data(G_OBJECT(spin_button), "which_range", GINT_TO_POINTER(i_range));
+ 	g_signal_connect(G_OBJECT(spin_button), "value_changed",  
+ 			 G_CALLBACK(spinner_cb), tb_crop);
+-	gtk_table_attach(GTK_TABLE(middle_table), spin_button, 
+-			 1+i_range,2+i_range, m_table_row,m_table_row+1,
+-			 FALSE,FALSE, X_PADDING, 0);
++	gtk_grid_attach(GTK_GRID(middle_table), spin_button,
++			1+i_range, m_table_row, 1, 1);
+ 	tb_crop->spinner[view][i_dim][i_range] = spin_button;
+       }
+       m_table_row++;
+       
+       if (i_dim <= AMITK_DIM_Z) {
+ 	label = gtk_label_new(_("(mm)"));
+-	gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
+-	gtk_table_attach(GTK_TABLE(middle_table), label, 
+-			 0,1, m_table_row,m_table_row+1,
+-			 GTK_FILL|GTK_EXPAND,FALSE, X_PADDING, 0);
++	gtk_label_set_xalign(GTK_LABEL(label), 1.0);
++	gtk_grid_attach(GTK_GRID(middle_table), label, 0, m_table_row, 1, 1);
+ 	
+ 	for (i_range=0; i_range<NUM_RANGES; i_range++) {
+ 	  g_assert(i_dim <= AMITK_DIM_Z);
+ 	  tb_crop->mm_label[view][i_dim][i_range] = gtk_label_new("");
+-	  gtk_table_attach(GTK_TABLE(middle_table), tb_crop->mm_label[view][i_dim][i_range],
+-			   1+i_range,2+i_range, m_table_row,m_table_row+1,
+-			   FALSE,FALSE, X_PADDING, 0);
++	  gtk_grid_attach(GTK_GRID(middle_table),
++			  tb_crop->mm_label[view][i_dim][i_range],
++			  1+i_range, m_table_row, 1, 1);
+ 	}
+ 	m_table_row++;
+       }
+@@ -335,28 +321,21 @@
+   }
+ 
+   /* the axis display */
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+-  axis_canvas = gnome_canvas_new_aa();
+-#else
+-  axis_canvas = gnome_canvas_new();
+-#endif
+-  ui_common_draw_view_axis(GNOME_CANVAS(axis_canvas), 0, 0, view, 
++  axis_canvas = goo_canvas_new();
++  ui_common_draw_view_axis(GOO_CANVAS(axis_canvas), 0, 0, view,
+ 			   AMITK_LAYOUT_LINEAR, AXIS_WIDTH, AXIS_HEIGHT);
+   gtk_widget_set_size_request(axis_canvas, AXIS_WIDTH, AXIS_HEIGHT);
+-  gnome_canvas_set_scroll_region(GNOME_CANVAS(axis_canvas), 0.0, 0.0, 
++  goo_canvas_set_bounds(GOO_CANVAS(axis_canvas), 0.0, 0.0,
+ 				 3.0*AXIS_WIDTH, AXIS_HEIGHT);
+-  gtk_table_attach(GTK_TABLE(middle_table), axis_canvas, 
+-		   0,3,m_table_row,m_table_row+1,
+-		   FALSE,FALSE, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(middle_table), axis_canvas, 0, m_table_row, 3, 1);
+ 
+   table_row=0;
+   table_column+=1;
+       
+   /* a separator for clarity */
+-  vseparator = gtk_vseparator_new();
+-  gtk_table_attach(GTK_TABLE(table), vseparator,
+-		   table_column, table_column+1, table_row, NUM_ROWS, 
+-		   0, GTK_FILL, X_PADDING, Y_PADDING);
++  vseparator = gtk_separator_new(GTK_ORIENTATION_VERTICAL);
++  gtk_grid_attach(GTK_GRID(table), vseparator, table_column, table_row,
++                  1, NUM_ROWS - table_row);
+     
+   table_row=0;
+   table_column += 1;
+@@ -364,9 +343,8 @@
+   tb_crop->threshold[view] = amitk_threshold_new(tb_crop->projections[view], 
+ 						 AMITK_THRESHOLD_LINEAR_LAYOUT,
+ 						 GTK_WINDOW(tb_crop->dialog), TRUE);
+-  gtk_table_attach(GTK_TABLE(table), tb_crop->threshold[view],
+-		   table_column,table_column+1,table_row,NUM_ROWS, 
+-		   FALSE,FALSE, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), tb_crop->threshold[view],
++                  table_column, table_row, 1, NUM_ROWS - table_row);
+   gtk_widget_show_all(table);
+   
+   return table;
+@@ -383,66 +361,58 @@
+   GtkWidget * menu;
+   GtkWidget * hseparator;
+ 
+-  table = gtk_table_new(3,3,FALSE);
++  table = gtk_grid_new();
++  gtk_grid_set_row_spacing(GTK_GRID(table), Y_PADDING);
++  gtk_grid_set_column_spacing(GTK_GRID(table), X_PADDING);
+   table_row = 0;
+   
+   /* widget to tell you the internal data format */
+   label = gtk_label_new(_("Current Data Format:"));
+-  gtk_table_attach(GTK_TABLE(table), label, 0,1,
+-		   table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), label, 0, table_row, 1, 1);
+   
+   entry = gtk_entry_new();
+   gtk_entry_set_text(GTK_ENTRY(entry), 
+ 		     amitk_format_names[AMITK_DATA_SET_FORMAT(tb_crop->data_set)]);
+   gtk_editable_set_editable(GTK_EDITABLE(entry), FALSE);
+-  gtk_table_attach(GTK_TABLE(table), entry,
+-		   1,2, table_row, table_row+1, 
+-		   GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), entry, 1, table_row, 1, 1);
+   
+   /* widget to tell you the scaling format */
+   label = gtk_label_new(_("Current Scale Format:"));
+-  gtk_table_attach(GTK_TABLE(table), label, 3,4,
+-		   table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), label, 3, table_row, 1, 1);
+   
+   entry = gtk_entry_new();
+   gtk_entry_set_text(GTK_ENTRY(entry), 
+ 		     amitk_scaling_menu_names[AMITK_DATA_SET_SCALING_TYPE(tb_crop->data_set)]);
+   gtk_editable_set_editable(GTK_EDITABLE(entry), FALSE);
+-  gtk_table_attach(GTK_TABLE(table), entry, 4,5, 
+-		   table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), entry, 4, table_row, 1, 1);
+   table_row++;
+   
+   /* a separator for clarity */
+-  hseparator = gtk_hseparator_new();
+-  gtk_table_attach(GTK_TABLE(table), hseparator,0,5,
+-		   table_row, table_row+1, GTK_FILL, GTK_FILL, X_PADDING, Y_PADDING);
++  hseparator = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
++  gtk_grid_attach(GTK_GRID(table), hseparator, 0, table_row, 5, 1);
+   table_row++;
+   
+   /* widget to tell you the internal data format */
+   label = gtk_label_new(_("Output Data Format:"));
+-  gtk_table_attach(GTK_TABLE(table), label, 0,1,
+-		   table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), label, 0, table_row, 1, 1);
+   
+-  menu = gtk_combo_box_new_text();
++  menu = gtk_combo_box_text_new();
+   for (i_format=0; i_format<AMITK_FORMAT_NUM; i_format++) 
+-    gtk_combo_box_append_text(GTK_COMBO_BOX(menu), amitk_format_names[i_format]);
++    gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(menu), amitk_format_names[i_format]);
+   gtk_combo_box_set_active(GTK_COMBO_BOX(menu), tb_crop->format);
+   g_signal_connect(G_OBJECT(menu), "changed", G_CALLBACK(change_format_cb), tb_crop);
+-  gtk_table_attach(GTK_TABLE(table), menu,
+-		   1,2, table_row,table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), menu, 1, table_row, 1, 1);
+   
+   /* widget to tell you the scaling format */
+   label = gtk_label_new(_("Output Scale Format:"));
+-  gtk_table_attach(GTK_TABLE(table), label, 3,4,
+-		   table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), label, 3, table_row, 1, 1);
+   
+-  menu = gtk_combo_box_new_text();
++  menu = gtk_combo_box_text_new();
+   for (i_scaling_type=0; i_scaling_type<AMITK_SCALING_TYPE_NUM; i_scaling_type++) 
+-    gtk_combo_box_append_text(GTK_COMBO_BOX(menu), amitk_scaling_menu_names[i_scaling_type]);
++    gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(menu), amitk_scaling_menu_names[i_scaling_type]);
+   gtk_combo_box_set_active(GTK_COMBO_BOX(menu), tb_crop->scaling_type);
+   g_signal_connect(G_OBJECT(menu), "changed", G_CALLBACK(change_scaling_type_cb), tb_crop);
+-  gtk_table_attach(GTK_TABLE(table), menu,
+-		   4,5, table_row,table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), menu, 4, table_row, 1, 1);
+   
+   gtk_widget_show_all(table);
+ 
+@@ -506,8 +476,7 @@
+       }
+     }
+ 
+-    gnome_canvas_set_pixels_per_unit(GNOME_CANVAS(tb_crop->canvas[view]), 
+-				     tb_crop->zoom);
++    goo_canvas_set_scale(GOO_CANVAS(tb_crop->canvas[view]), tb_crop->zoom);
+     gtk_widget_set_size_request(tb_crop->canvas[view], 
+ 				tb_crop->zoom*tb_crop->canvas_width[view],
+ 				tb_crop->zoom*tb_crop->canvas_height[view]);
+@@ -546,7 +515,7 @@
+   else
+     tb_crop->zoom = value;
+   
+-  gnome_canvas_set_pixels_per_unit(GNOME_CANVAS(tb_crop->canvas[view]), tb_crop->zoom);
++  goo_canvas_set_scale(GOO_CANVAS(tb_crop->canvas[view]), tb_crop->zoom);
+   gtk_widget_set_size_request(tb_crop->canvas[view], 
+ 			      tb_crop->zoom*tb_crop->canvas_width[view],
+ 			      tb_crop->zoom*tb_crop->canvas_height[view]);
+@@ -746,7 +715,8 @@
+ 
+ static void update_crop_lines(tb_crop_t * tb_crop, AmitkView view) {
+ 
+-  GnomeCanvasPoints * points;
++  GooCanvasPoints * points;
++  GooCanvasItem * root;
+   range_t i_range;
+   rgba_t outline_color;
+   gint j;
+@@ -755,7 +725,7 @@
+ 
+   if (tb_crop->canvas[view] == NULL) return;
+ 
+-  points = gnome_canvas_points_new(2);
++  points = goo_canvas_points_new(2);
+   outline_color = 
+     amitk_color_table_outline_color(AMITK_DATA_SET_COLOR_TABLE(tb_crop->projections[view], AMITK_VIEW_MODE_SINGLE), FALSE);
+ 
+@@ -820,22 +790,21 @@
+       }
+       
+       if (tb_crop->line[view][j][i_range] == NULL) {
++	root = goo_canvas_get_root_item(GOO_CANVAS(tb_crop->canvas[view]));
+ 	tb_crop->line[view][j][i_range] = 
+-	  gnome_canvas_item_new(gnome_canvas_root(GNOME_CANVAS(tb_crop->canvas[view])), 
+-				gnome_canvas_line_get_type(),
+-				"points", points, 
+-				"fill_color_rgba", amitk_color_table_rgba_to_uint32(outline_color),
+-				"width_units", 1.0,
+-				"cap_style", GDK_CAP_PROJECTING,
+-				NULL);
++          goo_canvas_polyline_new(root, FALSE, 0, "points", points,
++                                  "stroke-color-rgba",
++                                  amitk_color_table_rgba_to_uint32(outline_color),
++                                  "line-width", 1.0,
++                                  "line-cap", CAIRO_LINE_CAP_SQUARE, NULL);
+       } else {
+-	gnome_canvas_item_set(tb_crop->line[view][j][i_range], "points", points, 
+-			      "fill_color_rgba", amitk_color_table_rgba_to_uint32(outline_color),NULL);
++	g_object_set(tb_crop->line[view][j][i_range], "points", points,
++                     "stroke-color-rgba", amitk_color_table_rgba_to_uint32(outline_color),NULL);
+       }
+     }
+   }
+ 
+-  gnome_canvas_points_unref(points);
++  goo_canvas_points_unref(points);
+ 
+   return;
+ }
+@@ -895,23 +864,20 @@
+       pixbuf = image_from_projection(tb_crop->projections[view]);
+       
+       if (tb_crop->image[view] == NULL) {/* create the canvas image if we don't have it */
+-	tb_crop->image[view] = gnome_canvas_item_new(gnome_canvas_root(GNOME_CANVAS(tb_crop->canvas[view])),
+-						     gnome_canvas_pixbuf_get_type(),
+-						     "pixbuf", pixbuf, 
+-						     "x", (gdouble) CURSOR_SIZE, 
+-						     "y", (gdouble) CURSOR_SIZE, 
+-						     NULL);
++        tb_crop->image[view] = goo_canvas_image_new(goo_canvas_get_root_item(GOO_CANVAS(tb_crop->canvas[view])),
++                                                    pixbuf, (gdouble) CURSOR_SIZE,
++                                                    (gdouble) CURSOR_SIZE, NULL);
+ 	tb_crop->canvas_width[view] =gdk_pixbuf_get_width(pixbuf)+2*CURSOR_SIZE;
+ 	tb_crop->canvas_height[view] = gdk_pixbuf_get_height(pixbuf)+2*CURSOR_SIZE;
+ 	gtk_widget_set_size_request(tb_crop->canvas[view], 
+ 				    tb_crop->canvas_width[view],
+ 				    tb_crop->canvas_height[view]);
+ 	
+-	gnome_canvas_set_scroll_region(GNOME_CANVAS(tb_crop->canvas[view]), 0,0,
++	goo_canvas_set_bounds(GOO_CANVAS(tb_crop->canvas[view]), 0,0,
+ 				       tb_crop->canvas_width[view],
+ 				       tb_crop->canvas_height[view]);
+       } else {
+-	gnome_canvas_item_set(tb_crop->image[view], "pixbuf", pixbuf, NULL);
++	g_object_set(tb_crop->image[view], "pixbuf", pixbuf, NULL);
+       }
+       g_object_unref(pixbuf);
+     }
+@@ -1027,7 +993,6 @@
+ void tb_crop(AmitkStudy * study, AmitkDataSet * active_ds, GtkWindow * parent) {
+ 
+   tb_crop_t * tb_crop;
+-  GdkPixbuf * logo;
+   AmitkView i_view;
+   gint i;
+ 
+@@ -1073,17 +1038,13 @@
+ 
+ 
+   /* set the title, icon, and other info */
+-  logo = gtk_widget_render_icon(GTK_WIDGET(tb_crop->dialog), "amide_icon_logo", GTK_ICON_SIZE_DIALOG, 0);
+   for (i=0; i<NUM_PAGES; i++) {
+     gtk_assistant_set_page_title(GTK_ASSISTANT(tb_crop->dialog), tb_crop->page[i], _("Data Set Cropping Wizard"));
+-    gtk_assistant_set_page_header_image(GTK_ASSISTANT(tb_crop->dialog), tb_crop->page[i], logo);
+     g_object_set_data(G_OBJECT(tb_crop->page[i]),"which_page", GINT_TO_POINTER(i));
+ 
+     /* by default, everything's finished in this wizard */
+     gtk_assistant_set_page_complete(GTK_ASSISTANT(tb_crop->dialog), tb_crop->page[i], TRUE);
+   }
+-    
+-  g_object_unref(logo);
+ 
+   gtk_widget_show_all(tb_crop->dialog);
+ 
+--- amide.orig/amide-current/src/tb_distance.c
++++ amide/amide-current/src/tb_distance.c
+@@ -59,7 +59,7 @@
+ static void update_result_text(tb_distance_t * tb_distance);
+ static void update_objects(tb_distance_t * tb_distance);
+ static void tree_view_activate_object(GtkWidget * tree_view, AmitkObject * object, gpointer data);
+-static void destroy_cb(GtkObject * object, gpointer data);
++static void destroy_cb(GtkWidget * object, gpointer data);
+ static void response_cb (GtkDialog * dialog, gint response_id, gpointer data);
+ 
+ static tb_distance_t * tb_distance_free(tb_distance_t * tb_distance) {
+@@ -216,7 +216,7 @@
+   update_objects(tb_distance);
+ }
+ 
+-static void destroy_cb(GtkObject * object, gpointer data) {
++static void destroy_cb(GtkWidget * object, gpointer data) {
+   tb_distance_t * tb_distance = data;
+   tb_distance = tb_distance_free(tb_distance);
+   return;
+@@ -250,8 +250,8 @@
+   tb_distance = tb_distance_init();
+ 
+   tb_distance->dialog = gtk_dialog_new_with_buttons(_("Distance Measurement Tool"), parent_window,
+-				       GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR,
+-				       GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
++				       GTK_DIALOG_DESTROY_WITH_PARENT,
++				       _("_Cancel"), GTK_RESPONSE_CANCEL,
+ 				       NULL);
+   
+ 
+@@ -260,16 +260,17 @@
+   gtk_window_set_resizable(GTK_WINDOW(tb_distance->dialog), TRUE);
+ 
+   /* make the widgets for this dialog box */
+-  table = gtk_table_new(2,3,FALSE);
+-  gtk_container_add (GTK_CONTAINER (GTK_DIALOG(tb_distance->dialog)->vbox), table);
++  table = gtk_grid_new();
++  gtk_grid_set_row_spacing(GTK_GRID(table), Y_PADDING);
++  gtk_grid_set_column_spacing(GTK_GRID(table), X_PADDING);
++  gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area
++                                    (GTK_DIALOG(tb_distance->dialog))), table);
+ 
+ 
+   label = gtk_label_new(_("Starting Point"));
+-  gtk_table_attach(GTK_TABLE(table), label, 0,1, table_row,table_row+1,
+-		   X_PACKING_OPTIONS | GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), label, 0, table_row, 1, 1);
+   label = gtk_label_new(_("Ending Point"));
+-  gtk_table_attach(GTK_TABLE(table), label, 1,2, table_row,table_row+1,
+-		   X_PACKING_OPTIONS | GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), label, 1, table_row, 1, 1);
+   table_row++;
+ 
+ 
+@@ -283,8 +284,8 @@
+   scrolled = gtk_scrolled_window_new(NULL,NULL);  
+   gtk_widget_set_size_request(scrolled,250,250);
+   gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+-  gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrolled), tb_distance->tree_view1);
+-  gtk_table_attach(GTK_TABLE(table), scrolled, 0,1, table_row, table_row+1,GTK_FILL, GTK_FILL | GTK_EXPAND, X_PADDING, Y_PADDING);
++  gtk_container_add(GTK_CONTAINER(scrolled), tb_distance->tree_view1);
++  gtk_grid_attach(GTK_GRID(table), scrolled, 0, table_row, 1, 1);
+ 
+ 
+   /* and make the ending point tree view */
+@@ -297,8 +298,8 @@
+   scrolled = gtk_scrolled_window_new(NULL,NULL);  
+   gtk_widget_set_size_request(scrolled,250,250);
+   gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+-  gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrolled), tb_distance->tree_view2);
+-  gtk_table_attach(GTK_TABLE(table), scrolled, 1,2, table_row, table_row+1,GTK_FILL, GTK_FILL | GTK_EXPAND, X_PADDING, Y_PADDING);
++  gtk_container_add(GTK_CONTAINER(scrolled), tb_distance->tree_view2);
++  gtk_grid_attach(GTK_GRID(table), scrolled, 1, table_row, 1, 1);
+ 
+   table_row++;
+ 
+@@ -308,7 +309,7 @@
+   tb_distance->result_text_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text_view));
+   update_result_text(tb_distance);
+ 
+-  gtk_table_attach(GTK_TABLE(table), text_view, 0,2, table_row,table_row+1, FALSE,FALSE, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), text_view, 0, table_row, 2, 1);
+   gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(text_view), GTK_WRAP_WORD);
+   gtk_text_view_set_editable(GTK_TEXT_VIEW(text_view), FALSE);
+   gtk_widget_set_size_request(text_view,400,-1);
+--- amide.orig/amide-current/src/tb_export_data_set.c
++++ amide/amide-current/src/tb_export_data_set.c
+@@ -123,7 +123,7 @@
+ }
+ 
+ 
+-static void destroy_cb(GtkObject * object, gpointer data) {
++static void destroy_cb(GtkWidget * object, gpointer data) {
+   tb_export_t * tb_export = data;
+   tb_export = tb_export_unref(tb_export); /* free the associated data structure */
+ }
+@@ -249,8 +249,8 @@
+     file_chooser = gtk_file_chooser_dialog_new(_("Export to File"),
+ 					       GTK_WINDOW(main_dialog), /* parent window */
+ 					       GTK_FILE_CHOOSER_ACTION_SAVE,
+-					       GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+-					       GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
++					       _("_Cancel"), GTK_RESPONSE_CANCEL,
++					       _("_Save"), GTK_RESPONSE_ACCEPT,
+ 					       NULL);
+     gtk_file_chooser_set_local_only(GTK_FILE_CHOOSER(file_chooser), TRUE);
+     amitk_preferences_set_file_chooser_directory(tb_export->preferences, file_chooser); /* set the default directory if applicable */
+@@ -535,8 +535,8 @@
+   temp_string = g_strdup_printf(_("%s: Export Data Set Dialog"), PACKAGE);
+   tb_export->dialog = gtk_dialog_new_with_buttons (temp_string,  parent,
+ 						   GTK_DIALOG_DESTROY_WITH_PARENT,
+-						   GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, 
+-						   GTK_STOCK_EXECUTE, AMITK_RESPONSE_EXECUTE,
++						   _("_Cancel"), GTK_RESPONSE_CANCEL,
++						   _("_Execute"), AMITK_RESPONSE_EXECUTE,
+ 						   NULL);
+   gtk_window_set_title(GTK_WINDOW(tb_export->dialog), temp_string);
+   g_free(temp_string);
+@@ -557,21 +557,22 @@
+ 				 _("Exporting Data Sets"));
+ 
+   /* start making the widgets for this dialog box */
+-  table = gtk_table_new(5,4,FALSE);
++  table = gtk_grid_new();
++  gtk_grid_set_row_spacing(GTK_GRID(table), Y_PADDING);
++  gtk_grid_set_column_spacing(GTK_GRID(table), X_PADDING);
+   table_row=0;
+-  gtk_container_add(GTK_CONTAINER(GTK_DIALOG(tb_export->dialog)->vbox), table);
++  gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area
++                                  (GTK_DIALOG(tb_export->dialog))), table);
+ 
+   label = gtk_label_new(_("Export:"));
+-  gtk_table_attach(GTK_TABLE(table), label, 0,1, 
+-		   table_row, table_row+1, X_PACKING_OPTIONS, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), label, 0, table_row, 1, 1);
+ 
+   // tooltip N_("Export the data set in its original orientation (unresliced)")
+   temp_string = g_strdup_printf(_("Original Orientation - %s"), AMITK_OBJECT_NAME(tb_export->active_ds));
+   radio_button[0] = gtk_radio_button_new_with_label(NULL, temp_string);
+   g_free(temp_string);
+ 						    
+-  gtk_table_attach(GTK_TABLE(table), radio_button[0], 1,4, 
+-		   table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), radio_button[0], 1, table_row, 3, 1);
+   g_object_set_data(G_OBJECT(radio_button[0]), "resliced", GINT_TO_POINTER(FALSE));
+   g_object_set_data(G_OBJECT(radio_button[0]), "all_visible", GINT_TO_POINTER(FALSE));
+   table_row++;
+@@ -581,8 +582,7 @@
+   radio_button[1] = gtk_radio_button_new_with_label(gtk_radio_button_get_group(GTK_RADIO_BUTTON(radio_button[0])),
+ 						    temp_string);
+   g_free(temp_string);
+-  gtk_table_attach(GTK_TABLE(table), radio_button[1], 1,4, 
+-		   table_row, table_row+1,  GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), radio_button[1], 1, table_row, 2, 1);
+   g_object_set_data(G_OBJECT(radio_button[1]), "resliced", GINT_TO_POINTER(TRUE));
+   g_object_set_data(G_OBJECT(radio_button[1]), "all_visible", GINT_TO_POINTER(FALSE));
+   table_row++;
+@@ -590,8 +590,7 @@
+   // tooltip N_("Export all the visible data sets into a single file")
+   radio_button[2] = gtk_radio_button_new_with_label(gtk_radio_button_get_group(GTK_RADIO_BUTTON(radio_button[0])),
+ 						    _("All Visible Data Sets (resliced)"));
+-  gtk_table_attach(GTK_TABLE(table), radio_button[2], 1,4, 
+-		   table_row, table_row+1,  GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), radio_button[2], 1, table_row, 3, 1);
+   g_object_set_data(G_OBJECT(radio_button[2]), "resliced", GINT_TO_POINTER(TRUE));
+   g_object_set_data(G_OBJECT(radio_button[2]), "all_visible", GINT_TO_POINTER(TRUE));
+   table_row++;
+@@ -608,18 +607,16 @@
+   g_signal_connect(G_OBJECT(radio_button[2]), "clicked", G_CALLBACK(reslice_radio_buttons_cb), tb_export);
+ 
+   /* a separator for clarity */
+-  hseparator = gtk_hseparator_new();
+-  gtk_table_attach(GTK_TABLE(table), hseparator, 0,4,table_row, table_row+1,
+-		   GTK_FILL, 0, X_PADDING, Y_PADDING);
++  hseparator = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
++  gtk_grid_attach(GTK_GRID(table), hseparator, 0, table_row, 4, 1);
+   table_row++;
+ 
+ 
+   label = gtk_label_new(_("export format:"));
+-  gtk_table_attach(GTK_TABLE(table), GTK_WIDGET(label), 0,1,
+-		   table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), label, 0, table_row, 1, 1);
+ 
+   /* select the export type */
+-  export_menu = gtk_combo_box_new_text();
++  export_menu = gtk_combo_box_text_new();
+ 
+   counter = 0;
+   current = 0;
+@@ -628,7 +625,7 @@
+     if (i_export_method == AMITK_EXPORT_METHOD_LIBMDC) {
+       for (i_libmdc_export=0; i_libmdc_export < LIBMDC_NUM_EXPORT_METHODS; i_libmdc_export++) {
+ 	if (libmdc_supports(libmdc_export_to_format[i_libmdc_export])) {
+-	  gtk_combo_box_append_text(GTK_COMBO_BOX(export_menu),
++	  gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(export_menu),
+ 				    libmdc_export_menu_names[i_libmdc_export]);
+ 	  // add tooltips at some point libmdc_export_menu_explanations[i_libmdc_export]
+ 	  if ((method == i_export_method) && (submethod == libmdc_export_to_format[i_libmdc_export]))
+@@ -639,7 +636,7 @@
+     } else 
+ #endif
+       {
+-	gtk_combo_box_append_text(GTK_COMBO_BOX(export_menu),
++	gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(export_menu),
+ 				  amitk_export_menu_names[i_export_method]);
+ 	// add tooltips at some point amitk_export_menu_explanations[i_export_method],
+ 	
+@@ -651,16 +648,14 @@
+ 
+   g_signal_connect(G_OBJECT(export_menu), "changed", G_CALLBACK(change_export_cb), NULL);
+   gtk_combo_box_set_active(GTK_COMBO_BOX(export_menu), current); /* done after signal attachment, in case current never got matched and is still zero */
+-  gtk_table_attach(GTK_TABLE(table), export_menu, 1,4, 
+-		   table_row,table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), export_menu, 1, table_row, 3, 1);
+   gtk_widget_show(export_menu);
+   table_row++;
+     
+ 
+   /* widgets to change the voxel size of the data set */
+   label = gtk_label_new(_("voxel size (mm) [x,y,z]:"));
+-  gtk_table_attach(GTK_TABLE(table), GTK_WIDGET(label), 0,1,
+-		   table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), label, 0, table_row, 1, 1);
+ 
+ 
+   for (i_axis=0; i_axis<AMITK_AXIS_NUM; i_axis++) {
+@@ -671,8 +666,8 @@
+     g_object_set_data(G_OBJECT(tb_export->vs_spin_button[i_axis]), "axis", GINT_TO_POINTER(i_axis));
+     g_signal_connect(G_OBJECT(tb_export->vs_spin_button[i_axis]), "value_changed", G_CALLBACK(change_voxel_size_cb), tb_export);
+ 
+-    gtk_table_attach(GTK_TABLE(table), GTK_WIDGET(tb_export->vs_spin_button[i_axis]),i_axis+1,i_axis+2,
+-		     table_row, table_row+1, X_PACKING_OPTIONS, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(table), tb_export->vs_spin_button[i_axis],
++                    i_axis+1, table_row, 1, 1);
+     gtk_widget_set_sensitive(GTK_WIDGET(tb_export->vs_spin_button[i_axis]), resliced || all_visible);
+   }
+   recommend_voxel_size(tb_export); /* updates voxel size guestimate, and updates the entry boxes */
+@@ -684,21 +679,20 @@
+ 
+ 
+   label = gtk_label_new(_("bounding box:"));
+-  gtk_table_attach(GTK_TABLE(table), GTK_WIDGET(label), 0,1,
+-		   table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), label, 0, table_row, 1, 1);
+ 
+   // tooltip N_("Export the data set in its original orientation (unresliced)")
+   tb_export->bb_radio_button[0] = gtk_radio_button_new_with_label(NULL, "tight");
+ 						    
+-  gtk_table_attach(GTK_TABLE(table), tb_export->bb_radio_button[0], 1,2, 
+-		   table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), tb_export->bb_radio_button[0],
++                  1, table_row, 1, 1);
+   g_object_set_data(G_OBJECT(tb_export->bb_radio_button[0]), "inclusive_bounding_box", GINT_TO_POINTER(FALSE));
+ 
+   // tooltip N_("Export the data set in its current orientation (resliced)")
+   tb_export->bb_radio_button[1] = gtk_radio_button_new_with_label(gtk_radio_button_get_group(GTK_RADIO_BUTTON(tb_export->bb_radio_button[0])),
+ 						    "inclusive (of all data sets)");
+-  gtk_table_attach(GTK_TABLE(table), tb_export->bb_radio_button[1], 2,4, 
+-		   table_row, table_row+1,  GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), tb_export->bb_radio_button[1],
++                  2, table_row, 2, 1);
+   g_object_set_data(G_OBJECT(tb_export->bb_radio_button[1]), "inclusive_bounding_box", GINT_TO_POINTER(TRUE));
+   table_row++;
+ 
+--- amide.orig/amide-current/src/tb_fads.c
++++ amide/amide-current/src/tb_fads.c
+@@ -183,11 +183,13 @@
+     gtk_text_buffer_set_text (tb_fads->explanation_buffer, 
+ 			      _(fads_type_explanation[tb_fads->fads_type]), -1);
+ 
+-    if (fads_type_icon[tb_fads->fads_type] != NULL) {
++    if (tb_fads->fads_type == FADS_TYPE_TWO_COMPARTMENT) {
+       gtk_text_buffer_get_end_iter(tb_fads->explanation_buffer, &iter);
+       gtk_text_buffer_insert(tb_fads->explanation_buffer, &iter, "\n", -1);
+ 
+-      pixbuf = gdk_pixbuf_new_from_inline(-1,fads_type_icon[tb_fads->fads_type] , FALSE, NULL);
++      pixbuf = gtk_icon_theme_load_icon(gtk_icon_theme_get_default(),
++                                        "amide_icon_two_compartment",
++                                        151, 0, NULL);
+       gtk_text_buffer_get_end_iter(tb_fads->explanation_buffer, &iter);
+       gtk_text_buffer_insert_pixbuf(tb_fads->explanation_buffer, &iter, pixbuf);
+       g_object_unref(pixbuf);
+@@ -250,8 +252,8 @@
+   file_chooser = gtk_file_chooser_dialog_new (_("Filename for Factor Data"),
+ 					      GTK_WINDOW(tb_fads->dialog), /* parent window */
+ 					      GTK_FILE_CHOOSER_ACTION_SAVE,
+-					      GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+-					      GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
++					      _("_Cancel"), GTK_RESPONSE_CANCEL,
++					      _("_Save"), GTK_RESPONSE_ACCEPT,
+ 					      NULL);
+   gtk_file_chooser_set_local_only(GTK_FILE_CHOOSER(file_chooser), TRUE);
+   gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (file_chooser), TRUE);
+@@ -433,8 +435,8 @@
+   file_chooser = gtk_file_chooser_dialog_new (_("Import Curve File"),
+ 					      GTK_WINDOW(tb_fads->dialog), /* parent window */
+ 					      GTK_FILE_CHOOSER_ACTION_OPEN,
+-					      GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+-					      GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
++					      _("_Cancel"), GTK_RESPONSE_CANCEL,
++					      _("_Open"), GTK_RESPONSE_ACCEPT,
+ 					      NULL);
+   gtk_file_chooser_set_local_only(GTK_FILE_CHOOSER(file_chooser), TRUE);
+   amitk_preferences_set_file_chooser_directory(tb_fads->preferences, file_chooser); 
+@@ -826,7 +828,9 @@
+   GtkWidget * hseparator;
+   GtkTextBuffer *buffer;
+ 
+-  table = gtk_table_new(8,6,FALSE);
++  table = gtk_grid_new();
++  gtk_grid_set_row_spacing(GTK_GRID(table), Y_PADDING);
++  gtk_grid_set_column_spacing(GTK_GRID(table), X_PADDING);
+   table_row=0;
+       
+   switch(i_page) {
+@@ -834,21 +838,19 @@
+     view = gtk_text_view_new ();
+     buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
+     gtk_text_buffer_set_text (buffer, _(svd_page_text), -1);
+-    gtk_table_attach(GTK_TABLE(table), view, 0,1, table_row,table_row+2,
+-		     FALSE,FALSE, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(table), view, 0, table_row, 1, 2);
+     gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(view), GTK_WRAP_WORD);
+     gtk_text_view_set_editable(GTK_TEXT_VIEW(view), FALSE);
+     gtk_widget_set_size_request(view,300,-1);
+     
+     /* a separator for clarity */
+-    vseparator = gtk_vseparator_new();
+-    gtk_table_attach(GTK_TABLE(table), vseparator, 1,2,table_row, table_row+2,0, GTK_FILL, X_PADDING, Y_PADDING);
++    vseparator = gtk_separator_new(GTK_ORIENTATION_VERTICAL);
++    gtk_grid_attach(GTK_GRID(table), vseparator, 1, table_row, 1, 2);
+ 
+     /* do I need to compute factors? */
+     button = gtk_button_new_with_label(_("Compute Singular Values?"));
+     g_signal_connect(G_OBJECT(button), "pressed", G_CALLBACK(svd_pressed_cb), tb_fads);
+-    gtk_table_attach(GTK_TABLE(table), button, 2,3, table_row,table_row+1,
+-		     FALSE,FALSE, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(table), button, 2, table_row, 1, 1);
+     table_row++;
+     
+     /* the scroll widget which the list will go into */
+@@ -857,8 +859,9 @@
+     gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled),
+ 				   GTK_POLICY_AUTOMATIC,
+ 				   GTK_POLICY_AUTOMATIC);
+-    gtk_table_attach(GTK_TABLE(table), scrolled, 2, 3, table_row, table_row+1, 
+-		     X_PACKING_OPTIONS | GTK_FILL, Y_PACKING_OPTIONS | GTK_FILL, X_PADDING, Y_PADDING);
++    gtk_widget_set_hexpand(scrolled, TRUE);
++    gtk_widget_set_vexpand(scrolled, TRUE);
++    gtk_grid_attach(GTK_GRID(table), scrolled, 2, table_row, 1, 1);
+     
+     /* the table itself */
+     store = gtk_list_store_new(2, G_TYPE_INT, G_TYPE_DOUBLE);
+@@ -882,22 +885,19 @@
+   case FACTOR_CHOICE_PAGE:
+     /* ask for the fads method to use */
+     label = gtk_label_new(_("FADS Method:"));
+-    gtk_table_attach(GTK_TABLE(table), label, 0,1, table_row,table_row+1,
+-		     FALSE,FALSE, X_PADDING, Y_PADDING);
+-    menu = gtk_combo_box_new_text();
++    gtk_grid_attach(GTK_GRID(table), label, 0, table_row, 1, 1);
++    menu = gtk_combo_box_text_new();
+     
+     for (i_fads_type = 0; i_fads_type < NUM_FADS_TYPES; i_fads_type++) 
+-      gtk_combo_box_append_text(GTK_COMBO_BOX(menu), _(fads_type_name[i_fads_type]));
++      gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(menu), _(fads_type_name[i_fads_type]));
+     gtk_combo_box_set_active(GTK_COMBO_BOX(menu), tb_fads->fads_type);
+     g_signal_connect(G_OBJECT(menu), "changed", G_CALLBACK(fads_type_cb), tb_fads);
+-    gtk_table_attach(GTK_TABLE(table), menu, 1,2, table_row,table_row+1,
+-		     FALSE,FALSE, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(table), menu, 1, table_row, 1, 1);
+     table_row++;
+     
+     
+-    hseparator = gtk_hseparator_new();
+-    gtk_table_attach(GTK_TABLE(table), hseparator, 0,2,table_row, table_row+1,
+-		     GTK_FILL, 0, X_PADDING, Y_PADDING);
++    hseparator = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
++    gtk_grid_attach(GTK_GRID(table), hseparator, 0, table_row, 2, 1);
+     table_row++;
+ 
+     /* the explanation */
+@@ -905,8 +905,7 @@
+     tb_fads->explanation_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
+     gtk_text_buffer_set_text (tb_fads->explanation_buffer, 
+ 			      _(fads_type_explanation[tb_fads->fads_type]), -1);
+-    gtk_table_attach(GTK_TABLE(table), view, 0,2, table_row,table_row+1,
+-		     FALSE,FALSE, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(table), view, 0, table_row, 2, 1);
+     gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(view), GTK_WRAP_WORD);
+     gtk_text_view_set_editable(GTK_TEXT_VIEW(view), FALSE);
+     gtk_widget_set_size_request(view,300,-1);
+@@ -916,23 +915,21 @@
+   case PARAMETERS_PAGE:
+     /* ask for the minimizer algorithm to use */
+     label = gtk_label_new(_("Minimization Algorithm:"));
+-    gtk_table_attach(GTK_TABLE(table), label, 0,1, table_row,table_row+1,
+-		     FALSE,FALSE, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(table), label, 0, table_row, 1, 1);
+     
+-    tb_fads->algorithm_menu = gtk_combo_box_new_text();
++    tb_fads->algorithm_menu = gtk_combo_box_text_new();
+     for (i_algorithm = 0; i_algorithm < NUM_FADS_MINIMIZERS; i_algorithm++) 
+-      gtk_combo_box_append_text(GTK_COMBO_BOX(tb_fads->algorithm_menu), 
++      gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(tb_fads->algorithm_menu),
+ 				_(fads_minimizer_algorithm_name[i_algorithm]));
+     gtk_combo_box_set_active(GTK_COMBO_BOX(tb_fads->algorithm_menu), tb_fads->algorithm);
+     g_signal_connect(G_OBJECT(tb_fads->algorithm_menu), "changed", G_CALLBACK(algorithm_cb), tb_fads);
+-    gtk_table_attach(GTK_TABLE(table), tb_fads->algorithm_menu, 1,2, table_row,table_row+1,
+-		     FALSE,FALSE, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(table), tb_fads->algorithm_menu,
++                    1, table_row, 1, 1);
+     table_row++;
+ 
+     /* max # of iterations */
+     label = gtk_label_new(_("Max. # of iterations:"));
+-    gtk_table_attach(GTK_TABLE(table), label, 0,1, table_row,table_row+1,
+-		     FALSE,FALSE, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(table), label, 0, table_row, 1, 1);
+     
+     tb_fads->num_iterations_spin =  gtk_spin_button_new_with_range(1, MAX_ITERATIONS, 1);
+     gtk_spin_button_set_digits(GTK_SPIN_BUTTON(tb_fads->num_iterations_spin),0);
+@@ -940,14 +937,13 @@
+     gtk_widget_set_size_request(tb_fads->num_iterations_spin, SPIN_BUTTON_X_SIZE, -1);
+     g_signal_connect(G_OBJECT(tb_fads->num_iterations_spin), "value_changed",  
+ 		     G_CALLBACK(max_iterations_spinner_cb), tb_fads);
+-    gtk_table_attach(GTK_TABLE(table), tb_fads->num_iterations_spin, 1,2, table_row,table_row+1,
+-		     FALSE,FALSE, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(table), tb_fads->num_iterations_spin,
++                    1, table_row, 1, 1);
+     table_row++;
+     
+     /* stopping criteria */
+     label = gtk_label_new(_("Stopping Criteria:"));
+-    gtk_table_attach(GTK_TABLE(table), label, 0,1, table_row,table_row+1,
+-		     FALSE,FALSE, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(table), label, 0, table_row, 1, 1);
+     
+     tb_fads->stopping_criteria_spin = gtk_spin_button_new_with_range(EPSILON, 1.0, tb_fads->stopping_criteria);
+     gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(tb_fads->stopping_criteria_spin), FALSE);
+@@ -957,29 +953,27 @@
+ 		     G_CALLBACK(stopping_criteria_spinner_cb), tb_fads);
+     g_signal_connect(G_OBJECT(tb_fads->stopping_criteria_spin), "output",
+ 		     G_CALLBACK(amitk_spin_button_scientific_output), NULL);
+-    gtk_table_attach(GTK_TABLE(table), tb_fads->stopping_criteria_spin, 1,2, table_row,table_row+1,
+-		     FALSE,FALSE, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(table), tb_fads->stopping_criteria_spin,
++                    1, table_row, 1, 1);
+     table_row++;
+ 
+     /* whether to force sum of factors to equal one */
+     label = gtk_label_new(_("Constrain sum of factors = 1:"));
+-    gtk_table_attach(GTK_TABLE(table), label, 0,1, table_row,table_row+1,
+-		     FALSE,FALSE, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(table), label, 0, table_row, 1, 1);
+     
+     tb_fads->sum_factors_equal_one_button =  gtk_check_button_new();
+     gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(tb_fads->sum_factors_equal_one_button),
+ 				 tb_fads->sum_factors_equal_one);
+     g_signal_connect(G_OBJECT(tb_fads->sum_factors_equal_one_button), "toggled",  
+ 		     G_CALLBACK(sum_factors_equal_one_toggle_cb), tb_fads);
+-    gtk_table_attach(GTK_TABLE(table), tb_fads->sum_factors_equal_one_button, 1,2, table_row,table_row+1,
+-		     FALSE,FALSE, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(table), tb_fads->sum_factors_equal_one_button,
++                    1, table_row, 1, 1);
+     table_row++;
+ 
+     
+     /* stopping criteria */
+     label = gtk_label_new(_("Beta:"));
+-    gtk_table_attach(GTK_TABLE(table), label, 0,1, table_row,table_row+1,
+-		     FALSE,FALSE, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(table), label, 0, table_row, 1, 1);
+     
+     tb_fads->beta_spin = gtk_spin_button_new_with_range(0.0, 1.0, 0.01);
+     gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(tb_fads->beta_spin), FALSE);
+@@ -987,14 +981,12 @@
+     gtk_widget_set_size_request(tb_fads->beta_spin, SPIN_BUTTON_X_SIZE, -1);
+     g_signal_connect(G_OBJECT(tb_fads->beta_spin), "value_changed",  
+ 		     G_CALLBACK(beta_spinner_cb), tb_fads);
+-    gtk_table_attach(GTK_TABLE(table), tb_fads->beta_spin, 1,2, table_row,table_row+1,
+-		     FALSE,FALSE, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(table), tb_fads->beta_spin, 1, table_row, 1, 1);
+     table_row++;
+     
+     /* how many factors to solve for? */
+     label = gtk_label_new(_("# of Factors to use"));
+-    gtk_table_attach(GTK_TABLE(table), label, 0,1, table_row,table_row+1,
+-		     FALSE,FALSE, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(table), label, 0, table_row, 1, 1);
+     
+     tb_fads->num_factors_spin =  gtk_spin_button_new_with_range(1, AMITK_DATA_SET_NUM_FRAMES(tb_fads->data_set), 1);
+     gtk_spin_button_set_digits(GTK_SPIN_BUTTON(tb_fads->num_factors_spin),0);
+@@ -1002,14 +994,13 @@
+     gtk_widget_set_size_request(tb_fads->num_factors_spin, SPIN_BUTTON_X_SIZE, -1);
+     g_signal_connect(G_OBJECT(tb_fads->num_factors_spin), "value_changed",  
+ 		     G_CALLBACK(num_factors_spinner_cb), tb_fads);
+-    gtk_table_attach(GTK_TABLE(table), tb_fads->num_factors_spin, 1,2, table_row,table_row+1,
+-		     FALSE,FALSE, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(table), tb_fads->num_factors_spin,
++                    1, table_row, 1, 1);
+     table_row++;
+     
+     /* k12 criteria */
+     label = gtk_label_new(_("initial k12 (1/s):"));
+-    gtk_table_attach(GTK_TABLE(table), label, 0,1, table_row,table_row+1,
+-		     FALSE,FALSE, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(table), label, 0, table_row, 1, 1);
+     
+     tb_fads->k12_spin = gtk_spin_button_new_with_range(0.0, G_MAXDOUBLE, 0.01);
+     gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(tb_fads->k12_spin), FALSE);
+@@ -1019,14 +1010,12 @@
+ 		     G_CALLBACK(k12_spinner_cb), tb_fads);
+     g_signal_connect(G_OBJECT(tb_fads->k12_spin), "output",
+ 		     G_CALLBACK(amitk_spin_button_scientific_output), NULL);
+-    gtk_table_attach(GTK_TABLE(table), tb_fads->k12_spin, 1,2, table_row,table_row+1,
+-		     FALSE,FALSE, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(table), tb_fads->k12_spin, 1, table_row, 1, 1);
+     table_row++;
+     
+     /* k21 criteria */
+     label = gtk_label_new(_("initial K21 (1/s):"));
+-    gtk_table_attach(GTK_TABLE(table), label, 0,1, table_row,table_row+1,
+-		     FALSE,FALSE, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(table), label, 0, table_row, 1, 1);
+     
+     tb_fads->k21_spin = gtk_spin_button_new_with_range(0.0, G_MAXDOUBLE, 0.01);
+     gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(tb_fads->k21_spin), FALSE);
+@@ -1036,21 +1025,20 @@
+ 		     G_CALLBACK(k21_spinner_cb), tb_fads);
+     g_signal_connect(G_OBJECT(tb_fads->k21_spin), "output",
+ 		     G_CALLBACK(amitk_spin_button_scientific_output), NULL);
+-    gtk_table_attach(GTK_TABLE(table), tb_fads->k21_spin, 1,2, table_row,table_row+1,
+-		     FALSE,FALSE, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(table), tb_fads->k21_spin, 1, table_row, 1, 1);
+     // table_row++;
+ 
+     table_row = 0;
+     /* a separator for clarity */
+-    vseparator = gtk_vseparator_new();
+-    gtk_table_attach(GTK_TABLE(table), vseparator, 2,3,table_row, table_row+6, 0, GTK_FILL, X_PADDING, Y_PADDING);
++    vseparator = gtk_separator_new(GTK_ORIENTATION_VERTICAL);
++    gtk_grid_attach(GTK_GRID(table), vseparator, 2, table_row, 1, 6);
+     
+     /* A table to add blood sample measurements */
+     tb_fads->blood_add_button = gtk_button_new_with_label(_("Add Blood Sample"));
+     g_signal_connect(G_OBJECT(tb_fads->blood_add_button), "pressed", 
+ 		     G_CALLBACK(add_blood_pressed_cb), tb_fads);
+-    gtk_table_attach(GTK_TABLE(table), tb_fads->blood_add_button, 3,4, table_row,table_row+1,
+-		     FALSE,FALSE, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(table), tb_fads->blood_add_button,
++                    3, table_row, 1, 1);
+     table_row++;
+     
+     /* the scroll widget which the list will go into */
+@@ -1059,8 +1047,9 @@
+     gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled),
+ 				   GTK_POLICY_AUTOMATIC,
+ 				   GTK_POLICY_AUTOMATIC);
+-    gtk_table_attach(GTK_TABLE(table), scrolled, 3, 4, table_row, table_row+4, 
+-		     X_PACKING_OPTIONS | GTK_FILL, Y_PACKING_OPTIONS | GTK_FILL, X_PADDING, Y_PADDING);
++    gtk_widget_set_hexpand(scrolled, TRUE);
++    gtk_widget_set_vexpand(scrolled, TRUE);
++    gtk_grid_attach(GTK_GRID(table), scrolled, 3, table_row, 1, 4);
+     table_row+=4;
+     
+     /* the table itself */
+@@ -1089,8 +1078,8 @@
+     tb_fads->blood_remove_button = gtk_button_new_with_label(_("Remove Blood Sample"));
+     g_signal_connect(G_OBJECT(tb_fads->blood_remove_button), "pressed", 
+ 		     G_CALLBACK(remove_blood_pressed_cb), tb_fads);
+-    gtk_table_attach(GTK_TABLE(table), tb_fads->blood_remove_button, 3,4, table_row,table_row+1,
+-		     FALSE,FALSE, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(table), tb_fads->blood_remove_button,
++                    3, table_row, 1, 1);
+ 
+     break;
+   case CURVES_PAGE:
+@@ -1098,8 +1087,8 @@
+     tb_fads->curve_add_button = gtk_button_new_with_label(_("Add Initial Curves"));
+     g_signal_connect(G_OBJECT(tb_fads->curve_add_button), "pressed", 
+ 		     G_CALLBACK(add_curve_pressed_cb), tb_fads);
+-    gtk_table_attach(GTK_TABLE(table), tb_fads->curve_add_button, 0,1, table_row,table_row+1,
+-		     FALSE,FALSE, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(table), tb_fads->curve_add_button,
++                    0, table_row, 1, 1);
+     table_row++;
+ 
+     /* the scroll widget which the list will go into */
+@@ -1108,14 +1097,15 @@
+     gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled),
+ 				   GTK_POLICY_AUTOMATIC,
+ 				   GTK_POLICY_AUTOMATIC);
+-    gtk_table_attach(GTK_TABLE(table), scrolled, 0, 1, table_row, table_row+4,
+-		     X_PACKING_OPTIONS | GTK_FILL, Y_PACKING_OPTIONS | GTK_FILL, X_PADDING, Y_PADDING);
++    gtk_widget_set_hexpand(scrolled, TRUE);
++    gtk_widget_set_vexpand(scrolled, TRUE);
++    gtk_grid_attach(GTK_GRID(table), scrolled, 0, table_row, 1, 4);
+     table_row+=4;
+     
+     /* the curve text area */
+     tb_fads->curve_view = gtk_text_view_new();
+     tb_fads->curve_text = gtk_text_view_get_buffer(GTK_TEXT_VIEW(tb_fads->curve_view));
+-    gtk_widget_modify_font(tb_fads->curve_view, amitk_fixed_font_desc);
++    gtk_text_view_set_monospace(GTK_TEXT_VIEW(tb_fads->curve_view), TRUE);
+ 
+     gtk_text_view_set_editable(GTK_TEXT_VIEW(tb_fads->curve_view), FALSE);
+     gtk_container_add(GTK_CONTAINER(scrolled),tb_fads->curve_view);
+@@ -1123,8 +1113,8 @@
+     tb_fads->curve_remove_button = gtk_button_new_with_label(_("Remove Initial Curves"));
+     g_signal_connect(G_OBJECT(tb_fads->curve_remove_button), "pressed", 
+ 		     G_CALLBACK(remove_curve_pressed_cb), tb_fads);
+-    gtk_table_attach(GTK_TABLE(table), tb_fads->curve_remove_button, 0,1, table_row,table_row+1,
+-		     FALSE,FALSE, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(table), tb_fads->curve_remove_button,
++                    0, table_row, 1, 1);
+     table_row++;
+ 
+ 
+@@ -1142,7 +1132,6 @@
+ void tb_fads(AmitkDataSet * active_ds, AmitkPreferences * preferences, GtkWindow * parent) {
+ 
+   tb_fads_t * tb_fads;
+-  GdkPixbuf * logo;
+   which_page_t i_page;
+ 
+ 
+@@ -1195,13 +1184,10 @@
+ 
+ 
+ 
+-  logo = gtk_widget_render_icon(GTK_WIDGET(tb_fads->dialog), "amide_icon_logo", GTK_ICON_SIZE_DIALOG, 0);
+   for (i_page=0; i_page<NUM_PAGES; i_page++) {
+-    gtk_assistant_set_page_header_image(GTK_ASSISTANT(tb_fads->dialog), tb_fads->page[i_page], logo);
+     gtk_assistant_set_page_title(GTK_ASSISTANT(tb_fads->dialog), tb_fads->page[i_page], _(wizard_name));
+     g_object_set_data(G_OBJECT(tb_fads->page[i_page]),"which_page", GINT_TO_POINTER(i_page));
+   }
+-  g_object_unref(logo);
+ 
+   gtk_widget_show_all(tb_fads->dialog);
+ 
+--- amide.orig/amide-current/src/tb_filter.c
++++ amide/amide-current/src/tb_filter.c
+@@ -305,7 +305,9 @@
+   GtkWidget * table;
+   GtkWidget * menu;
+ 
+-  table = gtk_table_new(3,3,FALSE);
++  table = gtk_grid_new();
++  gtk_grid_set_row_spacing(GTK_GRID(table), Y_PADDING);
++  gtk_grid_set_column_spacing(GTK_GRID(table), X_PADDING);
+     
+   table_row=0;
+   table_column=0;
+@@ -313,18 +315,14 @@
+   switch(i_page) {
+   case PICK_FILTER_PAGE:
+     label = gtk_label_new(_("Which Filter"));
+-    gtk_table_attach(GTK_TABLE(table), label, 
+-		     table_column,table_column+1, table_row,table_row+1,
+-		     FALSE,FALSE, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(table), label, table_column, table_row, 1, 1);
+     
+-    menu = gtk_combo_box_new_text();
++    menu = gtk_combo_box_text_new();
+     for (i_filter=0; i_filter<AMITK_FILTER_NUM; i_filter++) 
+-      gtk_combo_box_append_text(GTK_COMBO_BOX(menu), amitk_filter_get_name(i_filter));
++      gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(menu), amitk_filter_get_name(i_filter));
+     gtk_combo_box_set_active(GTK_COMBO_BOX(menu), tb_filter->filter);
+     g_signal_connect(G_OBJECT(menu), "changed", G_CALLBACK(filter_cb), tb_filter);
+-    gtk_table_attach(GTK_TABLE(table), menu, 
+-		     table_column+1, table_column+2, table_row, table_row+1,
+-		     FALSE, FALSE, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(table), menu, table_column+1, table_row, 1, 1);
+     gtk_widget_show_all(menu);
+     table_row++;
+     
+@@ -334,16 +332,13 @@
+     tb_filter->kernel_size = DEFAULT_GAUSSIAN_FILTER_SIZE;
+     
+     label = gtk_label_new(_(gaussian_filter_text));
+-    gtk_table_attach(GTK_TABLE(table), label, 
+-		     table_column,table_column+2, table_row,table_row+1,
+-		     FALSE,FALSE, X_PADDING, Y_PADDING);
++    gtk_widget_set_hexpand(label, TRUE);
++    gtk_grid_attach(GTK_GRID(table), label, table_column, table_row, 2, 1);
+     table_row++;
+     
+     /* the kernel selection */
+     label = gtk_label_new(_("Kernel Size"));
+-    gtk_table_attach(GTK_TABLE(table), label, 
+-		     table_column,table_column+1, table_row,table_row+1,
+-		     FALSE,FALSE, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(table), label, table_column, table_row, 1, 1);
+     
+     spin_button =  gtk_spin_button_new_with_range(MIN_FIR_FILTER_SIZE, 
+ 						  MAX_FIR_FILTER_SIZE,2);
+@@ -352,15 +347,12 @@
+ 			      tb_filter->kernel_size);
+     g_signal_connect(G_OBJECT(spin_button), "value_changed",  
+ 		     G_CALLBACK(kernel_size_spinner_cb), tb_filter);
+-    gtk_table_attach(GTK_TABLE(table), spin_button, 
+-		     table_column+1,table_column+2, table_row,table_row+1,
+-		     FALSE,FALSE, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(table), spin_button,
++                    table_column+1, table_row, 1, 1);
+     table_row++;
+     
+     label = gtk_label_new(_("FWHM (mm)"));
+-    gtk_table_attach(GTK_TABLE(table), label, 
+-		     table_column,table_column+1, table_row,table_row+1,
+-		     FALSE,FALSE, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(table), label, table_column, table_row, 1, 1);
+     
+     spin_button =  gtk_spin_button_new_with_range(MIN_FWHM, MAX_FWHM,0.2);
+     gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(spin_button), FALSE);
+@@ -369,14 +361,11 @@
+ 		     G_CALLBACK(fwhm_spinner_cb), tb_filter);
+     g_signal_connect(G_OBJECT(spin_button), "output",
+ 		     G_CALLBACK(amitk_spin_button_scientific_output), NULL);
+-    gtk_table_attach(GTK_TABLE(table), spin_button, 
+-		     table_column+1,table_column+2, table_row,table_row+1,
+-		     FALSE,FALSE, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(table), spin_button,
++                    table_column+1, table_row, 1, 1);
+ #else /* no libgsl support */
+     label = gtk_label_new(_(no_libgsl_text));
+-    gtk_table_attach(GTK_TABLE(table), label, 
+-		     table_column,table_column+2, table_row,table_row+1,
+-		     FALSE,FALSE, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(table), label, table_column, table_row, 2, 1);
+     table_row++;
+ #endif
+     break;
+@@ -385,16 +374,13 @@
+     tb_filter->kernel_size = DEFAULT_MEDIAN_FILTER_SIZE;
+     
+     label = gtk_label_new((i_page == MEDIAN_3D_FILTER_PAGE) ? _(median_3d_filter_text) : _(median_linear_filter_text));
+-    gtk_table_attach(GTK_TABLE(table), label, 
+-		     table_column,table_column+2, table_row,table_row+1,
+-		     FALSE,FALSE, X_PADDING, Y_PADDING);
++    gtk_widget_set_hexpand(label, TRUE);
++    gtk_grid_attach(GTK_GRID(table), label, table_column, table_row, 2, 1);
+     table_row++;
+     
+     /* the kernel selection */
+     label = gtk_label_new(_("Kernel Size"));
+-    gtk_table_attach(GTK_TABLE(table), label, 
+-		     table_column,table_column+1, table_row,table_row+1,
+-		     FALSE,FALSE, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(table), label, table_column, table_row, 1, 1);
+     
+     spin_button =  gtk_spin_button_new_with_range(MIN_NONLINEAR_FILTER_SIZE, 
+ 						  MAX_NONLINEAR_FILTER_SIZE,2);
+@@ -403,9 +389,8 @@
+ 			      tb_filter->kernel_size);
+     g_signal_connect(G_OBJECT(spin_button), "value_changed",  
+ 		     G_CALLBACK(kernel_size_spinner_cb), tb_filter);
+-    gtk_table_attach(GTK_TABLE(table), spin_button, 
+-		     table_column+1,table_column+2, table_row,table_row+1,
+-		     FALSE,FALSE, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(table), spin_button,
++                    table_column+1, table_row, 1, 1);
+     table_row++;
+     break;
+   default:
+@@ -422,7 +407,6 @@
+ void tb_filter(AmitkStudy * study, AmitkDataSet * active_ds, GtkWindow * parent) {
+ 
+   tb_filter_t * tb_filter;
+-  GdkPixbuf * logo;
+   which_page_t i_page;
+ 
+   if (active_ds == NULL) {
+@@ -467,14 +451,11 @@
+ 
+ 
+   /* things for all pages */
+-  logo = gtk_widget_render_icon(GTK_WIDGET(tb_filter->dialog), "amide_icon_logo", GTK_ICON_SIZE_DIALOG, 0);
+   for (i_page=0; i_page<NUM_PAGES; i_page++) {
+-    gtk_assistant_set_page_header_image(GTK_ASSISTANT(tb_filter->dialog), tb_filter->page[i_page], logo);
+     gtk_assistant_set_page_title(GTK_ASSISTANT(tb_filter->dialog), tb_filter->page[i_page], _(wizard_name));
+     gtk_assistant_set_page_complete(GTK_ASSISTANT(tb_filter->dialog), tb_filter->page[i_page], TRUE); /* all pages have default values */
+     g_object_set_data(G_OBJECT(tb_filter->page[i_page]),"which_page", GINT_TO_POINTER(i_page));
+   }
+-  g_object_unref(logo);
+ 
+ #ifndef AMIDE_LIBGSL_SUPPORT
+   gtk_assistant_set_page_complete(GTK_ASSISTANT(tb_filter->dialog), tb_filter->page[GAUSSIAN_FILTER_PAGE], FALSE);
+--- amide.orig/amide-current/src/tb_fly_through.c
++++ amide/amide-current/src/tb_fly_through.c
+@@ -28,7 +28,6 @@
+ #if (AMIDE_FFMPEG_SUPPORT || AMIDE_LIBFAME_SUPPORT)
+ 
+ #include <sys/stat.h>
+-#include <libgnomecanvas/gnome-canvas-pixbuf.h>
+ #include "amide.h"
+ #include "amitk_threshold.h"
+ #include "amitk_progress_dialog.h"
+@@ -102,7 +101,7 @@
+ static void change_start_position_spin_cb(GtkWidget * widget, gpointer data);
+ static void change_end_position_spin_cb(GtkWidget * widget, gpointer data);
+ static void change_duration_spin_cb(GtkWidget * widget, gpointer data);
+-static void destroy_cb(GtkObject * object, gpointer data);
++static void destroy_cb(GtkWidget * object, gpointer data);
+ static gboolean delete_event_cb(GtkWidget* widget, GdkEvent * event, gpointer data);
+ static void response_cb (GtkDialog * dialog, gint response_id, gpointer data);
+ 
+@@ -272,7 +271,7 @@
+   return;
+ }
+ 
+-static void destroy_cb(GtkObject * object, gpointer data) {
++static void destroy_cb(GtkWidget * object, gpointer data) {
+   tb_fly_through_t * tb_fly_through = data;
+   tb_fly_through = tb_fly_through_unref(tb_fly_through); /* free the associated data structure */
+ }
+@@ -308,8 +307,8 @@
+     file_chooser = gtk_file_chooser_dialog_new(_("Output MPEG As"),
+ 					       GTK_WINDOW(dialog), /* parent window */
+ 					       GTK_FILE_CHOOSER_ACTION_SAVE,
+-					       GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+-					       GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
++					       _("_Cancel"), GTK_RESPONSE_CANCEL,
++					       _("_Save"), GTK_RESPONSE_ACCEPT,
+ 					       NULL);
+     gtk_file_chooser_set_local_only(GTK_FILE_CHOOSER(file_chooser), TRUE);
+     gtk_file_chooser_set_do_overwrite_confirmation(GTK_FILE_CHOOSER(file_chooser), TRUE);
+@@ -697,8 +696,8 @@
+ 
+   tb_fly_through->dialog = 
+     gtk_dialog_new_with_buttons(_("Fly Through Generation"),  parent,
+-				GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR,
+-				GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
++				GTK_DIALOG_DESTROY_WITH_PARENT,
++				_("_Cancel"), GTK_RESPONSE_CANCEL,
+ 				_("_Generate Fly Through"), AMITK_RESPONSE_EXECUTE,
+ 				NULL);
+ 
+@@ -711,26 +710,28 @@
+   gtk_window_set_resizable(GTK_WINDOW(tb_fly_through->dialog), TRUE);
+ 
+   /* make the widgets for this dialog box */
+-  packing_table = gtk_table_new(2,3,FALSE);
+-  gtk_container_add (GTK_CONTAINER (GTK_DIALOG(tb_fly_through->dialog)->vbox), packing_table);
+-
+-  right_table = gtk_table_new(9,2,FALSE);
+-  gtk_table_attach(GTK_TABLE(packing_table), right_table, 2,3, 0,2,
+-		   X_PACKING_OPTIONS | GTK_FILL, 0, X_PADDING, Y_PADDING);
++  packing_table = gtk_grid_new();
++  gtk_grid_set_row_spacing(GTK_GRID(packing_table), Y_PADDING);
++  gtk_grid_set_column_spacing(GTK_GRID(packing_table), X_PADDING);
++  gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area
++                                    (GTK_DIALOG(tb_fly_through->dialog))),
++                     packing_table);
++
++  right_table = gtk_grid_new();
++  gtk_grid_set_row_spacing(GTK_GRID(right_table), Y_PADDING);
++  gtk_grid_set_column_spacing(GTK_GRID(right_table), X_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), right_table, 2, 0, 1, 2);
+ 
+   label = gtk_label_new(_("Current Position (mm):"));
+-  gtk_table_attach(GTK_TABLE(right_table), label, 0,1, table_row,table_row+1,
+-		   X_PACKING_OPTIONS | GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(right_table), label, 0, table_row, 1, 1);
+   tb_fly_through->position_entry = gtk_entry_new();
+   gtk_editable_set_editable(GTK_EDITABLE(tb_fly_through->position_entry), FALSE);
+-  gtk_table_attach(GTK_TABLE(right_table), tb_fly_through->position_entry,
+-		   1,2, table_row, table_row+1, 
+-		   GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(right_table), tb_fly_through->position_entry,
++                  1, table_row, 1, 1);
+   table_row++;
+ 
+   label = gtk_label_new(_("Start Position (mm):"));
+-  gtk_table_attach(GTK_TABLE(right_table), label, 0,1, table_row,table_row+1,
+-		   X_PACKING_OPTIONS | GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(right_table), label, 0, table_row, 1, 1);
+   tb_fly_through->start_position_spin = 
+     gtk_spin_button_new_with_range(-G_MAXDOUBLE, G_MAXDOUBLE, 1.0);
+   gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(tb_fly_through->start_position_spin), FALSE);
+@@ -738,14 +739,12 @@
+ 		   G_CALLBACK(change_start_position_spin_cb), tb_fly_through);
+   g_signal_connect(G_OBJECT(tb_fly_through->start_position_spin), "output",
+ 		   G_CALLBACK(amitk_spin_button_scientific_output), NULL);
+-  gtk_table_attach(GTK_TABLE(right_table), tb_fly_through->start_position_spin,
+-		   1,2, table_row, table_row+1, 
+-		   GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(right_table), tb_fly_through->start_position_spin,
++                  1, table_row, 1, 1);
+   table_row++;
+ 
+   label = gtk_label_new(_("End Position (mm):"));
+-  gtk_table_attach(GTK_TABLE(right_table), label, 0,1, table_row,table_row+1,
+-		   X_PACKING_OPTIONS | GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(right_table), label, 0, table_row, 1, 1);
+   tb_fly_through->end_position_spin = 
+     gtk_spin_button_new_with_range(-G_MAXDOUBLE, G_MAXDOUBLE, 1.0);
+   gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(tb_fly_through->end_position_spin), FALSE);
+@@ -753,14 +752,12 @@
+ 		   G_CALLBACK(change_end_position_spin_cb), tb_fly_through);
+   g_signal_connect(G_OBJECT(tb_fly_through->end_position_spin), "output",
+ 		   G_CALLBACK(amitk_spin_button_scientific_output), NULL);
+-  gtk_table_attach(GTK_TABLE(right_table), tb_fly_through->end_position_spin,
+-		   1,2, table_row, table_row+1, 
+-		   GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(right_table), tb_fly_through->end_position_spin,
++                  1, table_row, 1, 1);
+   table_row++;
+ 
+   label = gtk_label_new(_("Movie Duration (sec):"));
+-  gtk_table_attach(GTK_TABLE(right_table), label, 0,1, table_row,table_row+1,
+-		   X_PACKING_OPTIONS | GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(right_table), label, 0, table_row, 1, 1);
+   tb_fly_through->duration_spin_button = 
+     gtk_spin_button_new_with_range(0, G_MAXDOUBLE, 1.0);
+   gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(tb_fly_through->duration_spin_button), FALSE);
+@@ -768,9 +765,8 @@
+ 		   G_CALLBACK(change_duration_spin_cb), tb_fly_through);
+   g_signal_connect(G_OBJECT(tb_fly_through->duration_spin_button), "output",
+ 		   G_CALLBACK(amitk_spin_button_scientific_output), NULL);
+-  gtk_table_attach(GTK_TABLE(right_table), tb_fly_through->duration_spin_button,
+-		   1,2, table_row, table_row+1, 
+-		   GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(right_table), tb_fly_through->duration_spin_button,
++                  1, table_row, 1, 1);
+   table_row++;
+ 
+   /* the progress dialog */
+@@ -783,20 +779,18 @@
+ 					    AMITK_VIEW_MODE_SINGLE, AMITK_CANVAS_TYPE_FLY_THROUGH);
+   g_signal_connect(G_OBJECT(tb_fly_through->canvas), "view_changed",
+ 		   G_CALLBACK(view_changed_cb), tb_fly_through);
+-  gtk_table_attach(GTK_TABLE(packing_table), tb_fly_through->canvas, 0,2,0,1,
+-		   X_PACKING_OPTIONS | GTK_FILL, Y_PACKING_OPTIONS | GTK_FILL,
+-		   X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), tb_fly_through->canvas, 0, 0, 2, 1);
+ 
+   tb_fly_through->start_position_button = gtk_button_new_with_label(_("Set Start Position"));
+   g_signal_connect(G_OBJECT(tb_fly_through->start_position_button), "pressed",
+ 		   G_CALLBACK(set_start_position_pressed_cb), tb_fly_through);
+-  gtk_table_attach(GTK_TABLE(packing_table), tb_fly_through->start_position_button, 
+-		   0,1,1,2, X_PACKING_OPTIONS | GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), tb_fly_through->start_position_button,
++                  0, 1, 1, 1);
+   tb_fly_through->end_position_button = gtk_button_new_with_label(_("Set End Position"));
+   g_signal_connect(G_OBJECT(tb_fly_through->end_position_button), "pressed",
+ 		   G_CALLBACK(set_end_position_pressed_cb), tb_fly_through);
+-  gtk_table_attach(GTK_TABLE(packing_table), tb_fly_through->end_position_button, 
+-		   1,2,1,2, X_PACKING_OPTIONS | GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), tb_fly_through->end_position_button,
++                  1, 1, 1, 1);
+   table_row++;
+ 
+ 
+@@ -844,19 +838,16 @@
+ 
+   if (tb_fly_through->dynamic || tb_fly_through->gated) {
+     /* a separator for clarity */
+-    hseparator = gtk_hseparator_new();
+-    gtk_table_attach(GTK_TABLE(right_table), hseparator, 0,2,
+-		     table_row, table_row+1,GTK_FILL, 0, X_PADDING, Y_PADDING);
++    hseparator = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
++    gtk_grid_attach(GTK_GRID(right_table), hseparator, 0, table_row, 2, 1);
+     table_row++;
+     
+     /* do we want to make a movie over time or over frames */
+     label = gtk_label_new(_("Dynamic Movie:"));
+-    gtk_table_attach(GTK_TABLE(right_table), label, 0,1,
+-		     table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(right_table), label, 0, table_row, 1, 1);
+     
+-    hbox = gtk_hbox_new(FALSE, 0);
+-    gtk_table_attach(GTK_TABLE(right_table), hbox,1,2,
+-		     table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++    hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
++    gtk_grid_attach(GTK_GRID(right_table), hbox, 1, table_row, 1, 1);
+     gtk_widget_show(hbox);
+     table_row++;
+     
+@@ -877,9 +868,8 @@
+       g_object_set_data(G_OBJECT(radio_button3), "dynamic_type", GINT_TO_POINTER(OVER_FRAMES));
+     }
+     
+-    hbox = gtk_hbox_new(FALSE, 0);
+-    gtk_table_attach(GTK_TABLE(right_table), hbox,1,2,
+-		     table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++    hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
++    gtk_grid_attach(GTK_GRID(right_table), hbox, 1, table_row, 1, 1);
+     gtk_widget_show(hbox);
+     table_row++;
+ 
+@@ -911,11 +901,11 @@
+     
+     /* widgets to specify the start and end times */
+     tb_fly_through->start_time_label = gtk_label_new(_("Start Time (s)"));
+-    gtk_table_attach(GTK_TABLE(right_table), tb_fly_through->start_time_label, 0,1,
+-		     table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(right_table), tb_fly_through->start_time_label,
++                    0, table_row, 1, 1);
+     tb_fly_through->start_frame_label = gtk_label_new(_("Start Frame"));
+-    gtk_table_attach(GTK_TABLE(right_table), tb_fly_through->start_frame_label, 0,1,
+-		     table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(right_table), tb_fly_through->start_frame_label,
++                    0, table_row, 1, 1);
+     
+     tb_fly_through->start_time_spin_button = 
+       gtk_spin_button_new_with_range(tb_fly_through->start_time, tb_fly_through->end_time, 1.0);
+@@ -926,8 +916,8 @@
+ 		     G_CALLBACK(change_start_time_cb), tb_fly_through);
+     g_signal_connect(G_OBJECT(tb_fly_through->start_time_spin_button), "output",
+ 		     G_CALLBACK(amitk_spin_button_scientific_output), NULL);
+-    gtk_table_attach(GTK_TABLE(right_table), tb_fly_through->start_time_spin_button,1,2,
+-		     table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(right_table), tb_fly_through->start_time_spin_button,
++                    1, table_row, 1, 1);
+     
+     tb_fly_through->start_frame_spin_button =
+       gtk_spin_button_new_with_range(tb_fly_through->start_frame,tb_fly_through->end_frame+0.1, 1.0);
+@@ -936,16 +926,17 @@
+ 			      tb_fly_through->start_frame);
+     g_signal_connect(G_OBJECT(tb_fly_through->start_frame_spin_button), "value_changed", 
+ 		     G_CALLBACK(change_start_frame_cb), tb_fly_through);
+-    gtk_table_attach(GTK_TABLE(right_table), tb_fly_through->start_frame_spin_button,1,2,
+-		     table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(right_table),
++                    tb_fly_through->start_frame_spin_button,
++                    1, table_row, 1, 1);
+     table_row++;
+     
+     tb_fly_through->end_time_label = gtk_label_new(_("End Time (s)"));
+-    gtk_table_attach(GTK_TABLE(right_table), tb_fly_through->end_time_label, 0,1,
+-		     table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(right_table), tb_fly_through->end_time_label,
++                    0, table_row, 1, 1);
+     tb_fly_through->end_frame_label = gtk_label_new(_("End Frame"));
+-    gtk_table_attach(GTK_TABLE(right_table), tb_fly_through->end_frame_label, 0,1,
+-		     table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(right_table), tb_fly_through->end_frame_label,
++                    0, table_row, 1, 1);
+     
+     
+     tb_fly_through->end_time_spin_button =
+@@ -957,8 +948,8 @@
+ 		     G_CALLBACK(change_end_time_cb), tb_fly_through);
+     g_signal_connect(G_OBJECT(tb_fly_through->end_time_spin_button), "output",
+ 		     G_CALLBACK(amitk_spin_button_scientific_output), NULL);
+-    gtk_table_attach(GTK_TABLE(right_table), tb_fly_through->end_time_spin_button,1,2,
+-		     table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(right_table), tb_fly_through->end_time_spin_button,
++                    1, table_row, 1, 1);
+     
+     tb_fly_through->end_frame_spin_button =
+       gtk_spin_button_new_with_range(tb_fly_through->start_frame,tb_fly_through->end_frame+0.1, 1.0);
+@@ -967,19 +958,20 @@
+ 			      tb_fly_through->end_frame);
+     g_signal_connect(G_OBJECT(tb_fly_through->end_frame_spin_button), "value_changed", 
+ 		     G_CALLBACK(change_end_frame_cb), tb_fly_through);
+-    gtk_table_attach(GTK_TABLE(right_table), tb_fly_through->end_frame_spin_button,1,2,
+-		     table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(right_table),
++                    tb_fly_through->end_frame_spin_button,
++                    1, table_row, 1, 1);
+     table_row++;
+ 
+     tb_fly_through->time_on_image_label = gtk_label_new(_("Display time on image"));
+-    gtk_table_attach(GTK_TABLE(right_table), tb_fly_through->time_on_image_label, 0,1,
+-		     table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(right_table), tb_fly_through->time_on_image_label,
++                    0, table_row, 1, 1);
+     tb_fly_through->time_on_image_button = gtk_check_button_new();
+     gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(tb_fly_through->time_on_image_button), FALSE);
+     g_signal_connect(G_OBJECT(tb_fly_through->time_on_image_button), "toggled", 
+ 		     G_CALLBACK(time_on_image_cb), tb_fly_through);
+-    gtk_table_attach(GTK_TABLE(right_table), tb_fly_through->time_on_image_button,1,2,
+-		     table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(right_table), tb_fly_through->time_on_image_button,
++                    1, table_row, 1, 1);
+     table_row++;
+   }
+   
+--- amide.orig/amide-current/src/tb_math.c
++++ amide/amide-current/src/tb_math.c
+@@ -533,7 +533,9 @@
+   GtkTreeViewColumn *column;
+   GtkTreeSelection *selection;
+ 
+-  table = gtk_table_new(3,2,FALSE);
++  table = gtk_grid_new();
++  gtk_grid_set_row_spacing(GTK_GRID(table), Y_PADDING);
++  gtk_grid_set_column_spacing(GTK_GRID(table), X_PADDING);
+     
+   store = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_INT);
+   tb_math->list_operation = gtk_tree_view_new_with_model (GTK_TREE_MODEL (store));
+@@ -548,8 +550,9 @@
+   gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE);
+   g_signal_connect(G_OBJECT(selection), "changed",
+ 		   G_CALLBACK(operation_selection_changed_cb), tb_math);
+-  gtk_table_attach(GTK_TABLE(table),tb_math->list_operation, 0,1,0,1,
+-		   GTK_FILL|GTK_EXPAND, GTK_FILL | GTK_EXPAND,X_PADDING, Y_PADDING);
++  gtk_widget_set_hexpand(tb_math->list_operation, TRUE);
++  gtk_widget_set_vexpand(tb_math->list_operation, TRUE);
++  gtk_grid_attach(GTK_GRID(table), tb_math->list_operation, 0, 0, 1, 1);
+ 
+   return table;
+ }
+@@ -563,7 +566,9 @@
+   GtkTreeViewColumn *column;
+   GtkTreeSelection *selection;
+ 
+-  table = gtk_table_new(3,3,FALSE);
++  table = gtk_grid_new();
++  gtk_grid_set_row_spacing(GTK_GRID(table), Y_PADDING);
++  gtk_grid_set_column_spacing(GTK_GRID(table), X_PADDING);
+     
+   /* the first data set */
+   store = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_POINTER);
+@@ -585,12 +590,13 @@
+   gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(tb_math->scrolled_ds1), 
+ 				 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+   gtk_container_add(GTK_CONTAINER(tb_math->scrolled_ds1), tb_math->list_ds1);
+-  gtk_table_attach(GTK_TABLE(table),tb_math->scrolled_ds1, 0,1,0,1,
+-		   GTK_FILL|GTK_EXPAND, GTK_FILL | GTK_EXPAND,X_PADDING, Y_PADDING);
++  gtk_widget_set_hexpand(tb_math->scrolled_ds1, TRUE);
++  gtk_widget_set_vexpand(tb_math->scrolled_ds1, TRUE);
++  gtk_grid_attach(GTK_GRID(table), tb_math->scrolled_ds1, 0, 0, 1, 1);
+ 
+ 
+-  vseparator = gtk_vseparator_new();
+-  gtk_table_attach(GTK_TABLE(table), vseparator, 1,2,0,2, 0, GTK_FILL, X_PADDING, Y_PADDING);
++  vseparator = gtk_separator_new(GTK_ORIENTATION_VERTICAL);
++  gtk_grid_attach(GTK_GRID(table), vseparator, 1, 0, 1, 2);
+   
+   /* the second data set */
+   store = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_POINTER);
+@@ -612,8 +618,9 @@
+   gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(tb_math->scrolled_ds2), 
+ 				 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+   gtk_container_add(GTK_CONTAINER(tb_math->scrolled_ds2), tb_math->list_ds2);
+-  gtk_table_attach(GTK_TABLE(table),tb_math->scrolled_ds2, 2,3,0,1,
+-		   GTK_FILL|GTK_EXPAND, GTK_FILL | GTK_EXPAND,X_PADDING, Y_PADDING);
++  gtk_widget_set_hexpand(tb_math->scrolled_ds2, TRUE);
++  gtk_widget_set_vexpand(tb_math->scrolled_ds2, TRUE);
++  gtk_grid_attach(GTK_GRID(table), tb_math->scrolled_ds2, 2, 0, 1, 1);
+ 
+   return table;
+ }
+@@ -624,12 +631,14 @@
+   GtkWidget * table;
+   gint table_row = 0;
+ 
+-  table = gtk_table_new(3,2,FALSE);
++  table = gtk_grid_new();
++  gtk_grid_set_row_spacing(GTK_GRID(table), Y_PADDING);
++  gtk_grid_set_column_spacing(GTK_GRID(table), X_PADDING);
+ 
+ 
+   tb_math->parameter0_label = gtk_label_new(NULL); /* label set in parameter_page_update function */
+-  gtk_table_attach(GTK_TABLE(table), tb_math->parameter0_label, 0,1, table_row,table_row+1,
+-		   FALSE, FALSE, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), tb_math->parameter0_label,
++                  0, table_row, 1, 1);
+     
+   tb_math->parameter0_spin = gtk_spin_button_new_with_range(-G_MAXDOUBLE, G_MAXDOUBLE, 1.0);
+   gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(tb_math->parameter0_spin), FALSE);
+@@ -639,13 +648,13 @@
+ 		   G_CALLBACK(parameter0_spinner_cb), tb_math);
+   g_signal_connect(G_OBJECT(tb_math->parameter0_spin), "output",
+ 		   G_CALLBACK(amitk_spin_button_scientific_output), NULL);
+-  gtk_table_attach(GTK_TABLE(table), tb_math->parameter0_spin, 1,2, table_row,table_row+1,
+-		   FALSE,FALSE, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), tb_math->parameter0_spin,
++                  1, table_row, 1, 1);
+   table_row++;
+ 
+   tb_math->parameter1_label = gtk_label_new(NULL); /* label set in parameter_page_update function */
+-  gtk_table_attach(GTK_TABLE(table), tb_math->parameter1_label, 0,1, table_row,table_row+1,
+-		   FALSE, FALSE, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), tb_math->parameter1_label,
++                  0, table_row, 1, 1);
+     
+   tb_math->parameter1_spin = gtk_spin_button_new_with_range(-G_MAXDOUBLE, G_MAXDOUBLE, 1.0);
+   gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(tb_math->parameter1_spin), FALSE);
+@@ -655,24 +664,24 @@
+ 		   G_CALLBACK(parameter1_spinner_cb), tb_math);
+   g_signal_connect(G_OBJECT(tb_math->parameter1_spin), "output",
+ 		   G_CALLBACK(amitk_spin_button_scientific_output), NULL);
+-  gtk_table_attach(GTK_TABLE(table), tb_math->parameter1_spin, 1,2, table_row,table_row+1,
+-		   FALSE,FALSE, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), tb_math->parameter1_spin,
++                  1, table_row, 1, 1);
+   table_row++;
+ 
+   tb_math->by_frames_check_button = 
+     gtk_check_button_new_with_label (_("Do binary operation frame-by-frame (default is by time)"));
+   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(tb_math->by_frames_check_button), tb_math->by_frames);
+   g_signal_connect(G_OBJECT(tb_math->by_frames_check_button), "toggled", G_CALLBACK(by_frames_cb),tb_math);
+-  gtk_table_attach(GTK_TABLE(table), tb_math->by_frames_check_button,0,2,table_row,table_row+1,
+-		   GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), tb_math->by_frames_check_button,
++                  0, table_row, 2, 1);
+   table_row++;
+ 
+   tb_math->maintain_ds1_dim_check_button = 
+     gtk_check_button_new_with_label(_("Maintain data set 1 dimensions (default is superset of both data sets)"));
+   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(tb_math->maintain_ds1_dim_check_button), tb_math->maintain_ds1_dim);
+   g_signal_connect(G_OBJECT(tb_math->maintain_ds1_dim_check_button), "toggled", G_CALLBACK(maintain_ds1_dim_cb),tb_math);
+-  gtk_table_attach(GTK_TABLE(table), tb_math->maintain_ds1_dim_check_button,0,2,table_row,table_row+1,
+-		   GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), tb_math->maintain_ds1_dim_check_button,
++                  0, table_row, 2, 1);
+   table_row++;
+ 
+   return table;
+@@ -685,7 +694,6 @@
+ void tb_math(AmitkStudy * study, GtkWindow * parent) {
+ 
+   tb_math_t * tb_math;
+-  GdkPixbuf * logo;
+   GList * data_sets;
+   gint i;
+   
+@@ -753,12 +761,9 @@
+ 			      GTK_ASSISTANT_PAGE_CONFIRM);
+   gtk_assistant_set_page_complete(GTK_ASSISTANT(tb_math->dialog), tb_math->page[CONCLUSION_PAGE], TRUE); /* always set to complete here */
+ 
+-  logo = gtk_widget_render_icon(GTK_WIDGET(tb_math->dialog), "amide_icon_logo", GTK_ICON_SIZE_DIALOG, 0);
+   for (i=0; i<NUM_PAGES; i++) {
+-    gtk_assistant_set_page_header_image(GTK_ASSISTANT(tb_math->dialog), tb_math->page[i], logo);
+     g_object_set_data(G_OBJECT(tb_math->page[i]),"which_page", GINT_TO_POINTER(i));
+   }
+-  g_object_unref(logo);
+ 
+   gtk_widget_show_all(tb_math->dialog);
+   return;
+--- amide.orig/amide-current/src/tb_profile.c
++++ amide/amide-current/src/tb_profile.c
+@@ -25,7 +25,7 @@
+ 
+ 
+ #include "amide_config.h"
+-#include <libgnomecanvas/libgnomecanvas.h>
++#include <goocanvas.h>
+ #include "amide.h"
+ #include "amitk_study.h"
+ #include "tb_profile.h"
+@@ -68,13 +68,13 @@
+ 
+ 
+   /* gaussian fit stuff */
+-  GnomeCanvasItem * x_label[2];
++  GooCanvasItem * x_label[2];
+   gboolean calc_gaussian_fit;
+   gdouble initial_x;
+   gdouble x_limit[2];
+   gboolean fix_x;
+   gboolean fix_dc_zero;
+-  GnomeCanvasItem * x_limit_item[2];
++  GooCanvasItem * x_limit_item[2];
+ 
+   guint reference_count;
+ } tb_profile_t;
+@@ -83,11 +83,11 @@
+ typedef struct result_t {
+   gchar * name;
+   GPtrArray * line;
+-  GnomeCanvasItem * line_item;
++  GooCanvasItem * line_item;
+   amide_data_t min_y, max_y, peak_location;
+   gdouble scale_y;
+-  GnomeCanvasItem * y_label[2];
+-  GnomeCanvasItem * legend;
++  GooCanvasItem * y_label[2];
++  GooCanvasItem * legend;
+ 
+   /* gaussian fit stuff */
+   gdouble b_fit, b_err;
+@@ -96,7 +96,7 @@
+   gdouble s_fit, s_err;
+   gint iterations;
+   gint status;
+-  GnomeCanvasItem * fit_item;
++  GooCanvasItem * fit_item;
+ 
+ } result_t;
+ 
+@@ -105,7 +105,7 @@
+ static tb_profile_t * profile_free(tb_profile_t * tb_profile);
+ static tb_profile_t * profile_init(void);
+ #ifdef AMIDE_LIBGSL_SUPPORT
+-static gboolean canvas_event_cb(GtkWidget* widget,  GdkEvent * event, gpointer data);
++static gboolean canvas_event_cb(GooCanvasItem * item, GooCanvasItem * target,  GdkEvent * event, gpointer data);
+ static void calc_gaussian_fit_cb(GtkWidget * button, gpointer data);
+ static void fix_x_cb(GtkWidget * widget, gpointer data);
+ static void fix_dc_zero_cb(GtkWidget * widget, gpointer data);
+@@ -121,7 +121,7 @@
+ static void recalc_profiles(tb_profile_t * tb_profile);
+ static gboolean update_while_idle(gpointer data);
+ static void response_cb (GtkDialog * dialog, gint response_id, gpointer data);
+-static void destroy_cb(GtkObject * object, gpointer data);
++static void destroy_cb(GtkWidget * object, gpointer data);
+ static gboolean delete_event_cb(GtkWidget* widget, GdkEvent * delete_event, gpointer data);
+ static void view_center_changed_cb(AmitkStudy * study, gpointer data);
+ static void selections_changed_cb(AmitkObject * object, gpointer data);
+@@ -145,15 +145,15 @@
+     if (result->name != NULL)
+       g_free(result->name);
+     if (result->line_item != NULL)
+-      gtk_object_destroy(GTK_OBJECT(result->line_item));
++      goo_canvas_item_remove(result->line_item);
+     if (result->y_label[0] != NULL)
+-      gtk_object_destroy(GTK_OBJECT(result->y_label[0]));
++      goo_canvas_item_remove(result->y_label[0]);
+     if (result->y_label[1] != NULL)
+-      gtk_object_destroy(GTK_OBJECT(result->y_label[1]));
++      goo_canvas_item_remove(result->y_label[1]);
+     if (result->legend != NULL)
+-      gtk_object_destroy(GTK_OBJECT(result->legend));
++      goo_canvas_item_remove(result->legend);
+     if (result->fit_item != NULL)
+-      gtk_object_destroy(GTK_OBJECT(result->fit_item));
++      goo_canvas_item_remove(result->fit_item);
+   }
+   g_ptr_array_free(results, TRUE);
+ 
+@@ -316,8 +316,8 @@
+   file_chooser = gtk_file_chooser_dialog_new(_("Export Profile"), 
+ 					     GTK_WINDOW(tb_profile->dialog), /* parent window */
+ 					     GTK_FILE_CHOOSER_ACTION_SAVE,
+-					     GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+-					     GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
++					     _("_Cancel"), GTK_RESPONSE_CANCEL,
++					     _("_Save"), GTK_RESPONSE_ACCEPT,
+ 					     NULL);
+   gtk_file_chooser_set_local_only(GTK_FILE_CHOOSER(file_chooser), TRUE);
+   gtk_file_chooser_set_do_overwrite_confirmation(GTK_FILE_CHOOSER(file_chooser), TRUE);
+@@ -380,10 +380,9 @@
+ 
+ #ifdef AMIDE_LIBGSL_SUPPORT
+ 
+-static gboolean canvas_event_cb(GtkWidget* widget,  GdkEvent * event, gpointer data) {
++static gboolean canvas_event_cb(GooCanvasItem * item,  GooCanvasItem * target, GdkEvent * event, gpointer data) {
+   tb_profile_t * tb_profile = data;
+   AmitkCanvasPoint canvas_cpoint;
+-  GnomeCanvas * canvas;
+   gdouble x_point;
+   gboolean find_new_initial = FALSE;
+   AmitkLineProfileDataElement * element;
+@@ -394,9 +393,8 @@
+   result_t * result;
+   
+ 
+-  canvas = GNOME_CANVAS(widget);
+-  gnome_canvas_window_to_world(canvas, event->button.x, event->button.y, &canvas_cpoint.x, &canvas_cpoint.y);
+-  gnome_canvas_w2c_d(canvas, canvas_cpoint.x, canvas_cpoint.y, &canvas_cpoint.x, &canvas_cpoint.y);
++  canvas_cpoint.x = event->button.x_root;
++  canvas_cpoint.y = event->button.y_root;
+   switch (event->type) {
+ 
+   case GDK_BUTTON_RELEASE:
+@@ -733,7 +731,8 @@
+   GtkTextIter start_iter, end_iter;
+   gchar * results_str;
+   gdouble value;
+-  GnomeCanvasPoints * points;
++  GooCanvasPoints * points;
++  GooCanvasItem * root;
+   div_t x;
+   guint color;
+   result_t * result;
+@@ -744,43 +743,34 @@
+ 
+   /* make the x limit lines */
+   if (tb_profile->x_limit_item[0] != NULL)
+-    gtk_object_destroy(GTK_OBJECT(tb_profile->x_limit_item[0]));
++    goo_canvas_item_remove(tb_profile->x_limit_item[0]);
+   if (tb_profile->x_limit_item[1] != NULL)
+-    gtk_object_destroy(GTK_OBJECT(tb_profile->x_limit_item[1]));
++    goo_canvas_item_remove(tb_profile->x_limit_item[1]);
+   
+-  points = gnome_canvas_points_new(2);
++  points = goo_canvas_points_new(2);
+   points->coords[0] = points->coords[2] = 
+     tb_profile->scale_x*(tb_profile->x_limit[0]-tb_profile->min_x)+EDGE_SPACING;
+   points->coords[1] = EDGE_SPACING+CANVAS_HEIGHT/4.0;
+   points->coords[3] = 3*CANVAS_HEIGHT/4.0+EDGE_SPACING;
++  root = goo_canvas_get_root_item(GOO_CANVAS(tb_profile->canvas));
+   tb_profile->x_limit_item[0] = 
+-    gnome_canvas_item_new(gnome_canvas_root(GNOME_CANVAS(tb_profile->canvas)),
+-			  gnome_canvas_line_get_type(),
+-			  "points", points,
+-			  "fill_color", "white",
+-#ifndef AMIDE_LIBGNOMECANVAS_AA
+-			  "line_style", GDK_LINE_ON_OFF_DASH,
+-#endif
+-			  "width_units", 1.0,
+-			  NULL);
+-  gnome_canvas_points_unref(points);
++    goo_canvas_polyline_new(root, FALSE, 0, "points", points,
++                            "stroke-color", "white",
++                            "line-width", 1.0,
++                            NULL);
++  goo_canvas_points_unref(points);
+   
+-  points = gnome_canvas_points_new(2);
++  points = goo_canvas_points_new(2);
+   points->coords[0] = points->coords[2] =
+     tb_profile->scale_x*(tb_profile->x_limit[1]-tb_profile->min_x)+EDGE_SPACING;
+   points->coords[1] = EDGE_SPACING+CANVAS_HEIGHT/4.0;
+   points->coords[3] = 3*CANVAS_HEIGHT/4.0+EDGE_SPACING;
+   tb_profile->x_limit_item[1] = 
+-    gnome_canvas_item_new(gnome_canvas_root(GNOME_CANVAS(tb_profile->canvas)),
+-			  gnome_canvas_line_get_type(),
+-			  "points", points,
+-			  "fill_color", "white",
+-#ifndef AMIDE_LIBGNOMECANVAS_AA
+-			  "line_style", GDK_LINE_ON_OFF_DASH,
+-#endif
+-			  "width_units", 1.0,
+-			  NULL);
+-  gnome_canvas_points_unref(points);
++    goo_canvas_polyline_new(root, FALSE, 0, "points", points,
++                            "stroke-color", "white",
++                            "line-width", 1.0,
++                            NULL);
++  goo_canvas_points_unref(points);
+ 
+   buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (tb_profile->text));
+ 
+@@ -796,7 +786,7 @@
+   for (i=0; i < tb_profile->results->len; i++) {
+     result = g_ptr_array_index(tb_profile->results, i);
+ 
+-    points = gnome_canvas_points_new(CANVAS_WIDTH);
++    points = goo_canvas_points_new(CANVAS_WIDTH);
+     for (j=0; j<CANVAS_WIDTH; j++) {
+       loc = ((((gdouble) j)-EDGE_SPACING)/tb_profile->scale_x)+tb_profile->min_x;
+       value = calc_gaussian(result->s_fit, result->p_fit, result->c_fit,result->b_fit, loc);
+@@ -815,20 +805,15 @@
+ 
+     /* make sure it's destroyed */
+     if (result->fit_item != NULL)
+-      gtk_object_destroy(GTK_OBJECT(result->fit_item));
++      goo_canvas_item_remove(result->fit_item);
+ 
+     /* and (re)create it */
+     result->fit_item = 
+-      gnome_canvas_item_new(gnome_canvas_root(GNOME_CANVAS(tb_profile->canvas)),
+-			    gnome_canvas_line_get_type(),
+-			    "points", points,
+-			    "fill_color_rgba", color,
+-#ifndef AMIDE_LIBGNOMECANVAS_AA
+-			    "line_style", GDK_LINE_ON_OFF_DASH,
+-#endif
+-			    "width_units", 1.0,
+-			    NULL);
+-    gnome_canvas_points_unref(points);
++      goo_canvas_polyline_new(root, FALSE, 0, "points", points,
++                              "stroke-color-rgba", color,
++                              "line-width", 1.0,
++                              NULL);
++    goo_canvas_points_unref(points);
+ 
+     results_str = 
+       g_strdup_printf(_("\n\ngaussian fit on: %s\n"
+@@ -881,7 +866,8 @@
+   GPtrArray * one_line;
+   gint i,j;
+   AmitkLineProfileDataElement * element;
+-  GnomeCanvasPoints * points;
++  GooCanvasPoints * points;
++  GooCanvasItem * root;
+   result_t * result;
+   div_t x;
+   gchar * label;
+@@ -947,33 +933,30 @@
+     
+   }
+ 
++  root = goo_canvas_get_root_item(GOO_CANVAS(tb_profile->canvas));
+   label = g_strdup_printf("%g", tb_profile->min_x);
+   if (tb_profile->x_label[0] != NULL) {
+-    gnome_canvas_item_set(tb_profile->x_label[0], "text", label, NULL);
++    g_object_set(tb_profile->x_label[0], "text", label, NULL);
+   } else {
+     tb_profile->x_label[0] = 
+-      gnome_canvas_item_new(gnome_canvas_root(GNOME_CANVAS(tb_profile->canvas)), 
+-			    gnome_canvas_text_get_type(),
+-			    "anchor", GTK_ANCHOR_SOUTH_WEST, "text", label,
+-			    "x", (gdouble) EDGE_SPACING+5.0,
+-			    "y", (gdouble) CANVAS_HEIGHT-EDGE_SPACING,
+-			    "fill_color", "white",
+-			    "font_desc", amitk_fixed_font_desc, NULL);
++      goo_canvas_text_new(root, label, (gdouble) EDGE_SPACING+5.0,
++                          (gdouble) CANVAS_HEIGHT-EDGE_SPACING, -1,
++                          GOO_CANVAS_ANCHOR_SOUTH_WEST,
++                          "fill-color", "white",
++                          "font-desc", amitk_fixed_font_desc, NULL);
+   }
+   g_free(label);
+ 
+   label = g_strdup_printf("%g", tb_profile->max_x);
+   if (tb_profile->x_label[1] != NULL) {
+-    gnome_canvas_item_set(tb_profile->x_label[1], "text", label, NULL);
++    g_object_set(tb_profile->x_label[1], "text", label, NULL);
+   } else {
+     tb_profile->x_label[1] = 
+-      gnome_canvas_item_new(gnome_canvas_root(GNOME_CANVAS(tb_profile->canvas)), 
+-			    gnome_canvas_text_get_type(),
+-			    "anchor", GTK_ANCHOR_SOUTH_EAST, "text", label,
+-			    "x", (gdouble) CANVAS_WIDTH-EDGE_SPACING,
+-			    "y", (gdouble) CANVAS_HEIGHT-EDGE_SPACING,
+-			    "fill_color", "white",
+-			    "font_desc", amitk_fixed_font_desc, NULL);
++      goo_canvas_text_new(root, label, (gdouble) CANVAS_WIDTH-EDGE_SPACING,
++                          (gdouble) CANVAS_HEIGHT-EDGE_SPACING, -1,
++                          GOO_CANVAS_ANCHOR_SOUTH_EAST,
++                          "fill-color", "white",
++                          "font-desc", amitk_fixed_font_desc, NULL);
+   }
+   g_free(label);
+ 
+@@ -984,7 +967,7 @@
+   for (i=0; i < tb_profile->results->len; i++) {
+     result = g_ptr_array_index(tb_profile->results, i);
+ 
+-    points = gnome_canvas_points_new(result->line->len);
++    points = goo_canvas_points_new(result->line->len);
+ 
+     result->scale_y = (CANVAS_HEIGHT-2*EDGE_SPACING)/(result->max_y-result->min_y);
+     for (j=0; j<result->line->len; j++) {
+@@ -994,45 +977,39 @@
+     }
+ 
+     x = div(i, NUM_COLOR_ROTATIONS);
+-    result->line_item = gnome_canvas_item_new(gnome_canvas_root(GNOME_CANVAS(tb_profile->canvas)),
+-					      gnome_canvas_line_get_type(),
+-					      "points", points,
+-					      "fill_color_rgba", color_rotation[x.rem],
+-					      "width_units", 1.0,
+-					      NULL);
+-    gnome_canvas_points_unref(points);
++    result->line_item = goo_canvas_polyline_new(root, FALSE, 0,
++                                                "points", points,
++                                                "stroke-color-rgba",
++                                                color_rotation[x.rem],
++                                                "line-width", 1.0, NULL);
++    goo_canvas_points_unref(points);
+ 
+     label = g_strdup_printf("%g", result->min_y);
+     result->y_label[0] = 
+-      gnome_canvas_item_new(gnome_canvas_root(GNOME_CANVAS(tb_profile->canvas)), 
+-			    gnome_canvas_text_get_type(),
+-			    "anchor", GTK_ANCHOR_SOUTH_WEST, "text", label,
+-			    "x", (gdouble) EDGE_SPACING,
+-			    "y", (gdouble) CANVAS_HEIGHT-EDGE_SPACING-TEXT_HEIGHT-(tb_profile->results->len-i-1)*TEXT_HEIGHT,
+-			    "fill_color_rgba", color_rotation[x.rem],
+-			    "font_desc", amitk_fixed_font_desc, NULL);
++      goo_canvas_text_new(root, label, (gdouble) EDGE_SPACING,
++                          (gdouble) CANVAS_HEIGHT-EDGE_SPACING-TEXT_HEIGHT-
++                          (tb_profile->results->len-i-1)*TEXT_HEIGHT,
++                          -1, GOO_CANVAS_ANCHOR_SOUTH_WEST,
++                          "fill-color-rgba", color_rotation[x.rem],
++                          "font-desc", amitk_fixed_font_desc, NULL);
+     g_free(label);
+     
+     label = g_strdup_printf("%g", result->max_y);
+     result->y_label[1] = 
+-      gnome_canvas_item_new(gnome_canvas_root(GNOME_CANVAS(tb_profile->canvas)), 
+-			    gnome_canvas_text_get_type(),
+-			    "anchor", GTK_ANCHOR_NORTH_WEST, "text", label,
+-			    "x", (gdouble) EDGE_SPACING,
+-			    "y", (gdouble) EDGE_SPACING+i*TEXT_HEIGHT,
+-			    "fill_color_rgba", color_rotation[x.rem],
+-			    "font_desc", amitk_fixed_font_desc, NULL);
++      goo_canvas_text_new(root, label, (gdouble) EDGE_SPACING,
++                          (gdouble) EDGE_SPACING+i*TEXT_HEIGHT, -1,
++                          GOO_CANVAS_ANCHOR_NORTH_WEST,
++                          "fill-color-rgba", color_rotation[x.rem],
++                          "font-desc", amitk_fixed_font_desc, NULL);
+     g_free(label);
+ 
+     result->legend = 
+-      gnome_canvas_item_new(gnome_canvas_root(GNOME_CANVAS(tb_profile->canvas)), 
+-			    gnome_canvas_text_get_type(),
+-			    "anchor", GTK_ANCHOR_NORTH_EAST, 
+-			    "text", result->name,
+-			    "x", (gdouble) CANVAS_WIDTH-EDGE_SPACING,
+-			    "y", (gdouble) EDGE_SPACING+i*TEXT_HEIGHT,
+-			    "fill_color_rgba", color_rotation[x.rem],
+-			    "font_desc", amitk_fixed_font_desc, NULL);
++      goo_canvas_text_new(root, result->name,
++                          (gdouble) CANVAS_WIDTH-EDGE_SPACING,
++                          (gdouble) EDGE_SPACING+i*TEXT_HEIGHT, -1,
++                          GOO_CANVAS_ANCHOR_NORTH_EAST,
++                          "fill-color-rgba", color_rotation[x.rem],
++                          "font-desc", amitk_fixed_font_desc, NULL);
+ 
+   tb_profile->initial_x = -1.0;
+   tb_profile->x_limit[0] = tb_profile->min_x;
+@@ -1098,7 +1075,7 @@
+ }
+ 
+ 
+-static void destroy_cb(GtkObject * object, gpointer data) {
++static void destroy_cb(GtkWidget * object, gpointer data) {
+   
+   tb_profile_t * tb_profile = data;
+ 
+@@ -1187,9 +1164,14 @@
+   GtkWidget * radio_button[3];
+   GtkWidget * hbox;
+   GtkWidget * label;
++  GooCanvasItem * root;
++  GooCanvasItem * item;
+ #ifdef AMIDE_LIBGSL_SUPPORT
+   GtkWidget * check_button;
+-  GdkColor color;
++  GtkStyleContext * context;
++  GtkCssProvider * css;
++  const gchar * css_data = "textview text { "
++    "color: white; background-color: black; }";
+ #endif
+   
+   tb_profile = profile_init();
+@@ -1204,10 +1186,10 @@
+ 			  AMITK_OBJECT_NAME(tb_profile->study));
+   dialog = gtk_dialog_new_with_buttons(title, GTK_WINDOW(parent),
+ 				       GTK_DIALOG_DESTROY_WITH_PARENT,
+-				       GTK_STOCK_SAVE_AS, AMITK_RESPONSE_SAVE_AS,
+-				       GTK_STOCK_COPY, AMITK_RESPONSE_COPY,
+-				       GTK_STOCK_HELP, GTK_RESPONSE_HELP,
+-				       GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
++				       _("Save _As"), AMITK_RESPONSE_SAVE_AS,
++				       _("_Copy"), AMITK_RESPONSE_COPY,
++				       _("_Help"), GTK_RESPONSE_HELP,
++				       _("_Close"), GTK_RESPONSE_CLOSE,
+ 				       NULL);
+   g_free(title);
+   gtk_window_set_resizable(GTK_WINDOW(dialog), TRUE);
+@@ -1227,21 +1209,22 @@
+ 
+ 
+   /* make the widgets for this dialog box */
+-  table = gtk_table_new(5,3,FALSE);
++  table = gtk_grid_new();
++  gtk_grid_set_row_spacing(GTK_GRID(table), Y_PADDING);
++  gtk_grid_set_column_spacing(GTK_GRID(table), X_PADDING);
+   table_row=0;
+-  gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), table);
++  gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area
++                                  (GTK_DIALOG(dialog))), table);
+   gtk_widget_show(table);
+   
+   
+   /* which view do we want the profile on */
+   label = gtk_label_new(_("Line Profile on:"));
+-  gtk_table_attach(GTK_TABLE(table), label, 0,1,
+-		   table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), label, 0, table_row, 1, 1);
+   gtk_widget_show(label);
+     
+-  hbox = gtk_hbox_new(FALSE, 0);
+-  gtk_table_attach(GTK_TABLE(table), hbox,1,3,
+-		   table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++  hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
++  gtk_grid_attach(GTK_GRID(table), hbox, 1, table_row, 2, 1);
+   gtk_widget_show(hbox);
+     
+   /* the radio buttons */
+@@ -1266,8 +1249,7 @@
+ 
+   /* changing the angle */
+   label = gtk_label_new(_("Angle (degrees):"));
+-  gtk_table_attach(GTK_TABLE(table), label, 0,1,
+-		   table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), label, 0, table_row, 1, 1);
+   gtk_widget_show(label);
+ 
+   tb_profile->angle_spin = gtk_spin_button_new_with_range(-G_MAXDOUBLE, G_MAXDOUBLE, 1.0);
+@@ -1275,38 +1257,34 @@
+   gtk_spin_button_set_digits(GTK_SPIN_BUTTON(tb_profile->angle_spin),3);
+   g_signal_connect(G_OBJECT(tb_profile->angle_spin), "value_changed", 
+ 		   G_CALLBACK(profile_angle_cb), tb_profile);
+-  gtk_table_attach(GTK_TABLE(table),tb_profile->angle_spin,1,3, 
+-		   table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), tb_profile->angle_spin, 1, table_row, 2, 1);
+   gtk_widget_show(tb_profile->angle_spin);
+   table_row++;
+ 
+ 
+   /* the canvas */
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+-  tb_profile->canvas = gnome_canvas_new_aa();
+-#else
+-  tb_profile->canvas = gnome_canvas_new();
+-#endif
+-  gtk_table_attach(GTK_TABLE(table), tb_profile->canvas, 0, 3, table_row, table_row+1, 
+-		   X_PACKING_OPTIONS | GTK_FILL, Y_PACKING_OPTIONS | GTK_FILL,
+-		   X_PADDING, Y_PADDING);
+-#ifdef AMIDE_LIBGSL_SUPPORT
+-  g_signal_connect(G_OBJECT(tb_profile->canvas), "event",
+-		   G_CALLBACK(canvas_event_cb), tb_profile);
+-#endif
++  tb_profile->canvas = goo_canvas_new();
++  gtk_widget_set_halign(tb_profile->canvas, GTK_ALIGN_CENTER);
++  gtk_grid_attach(GTK_GRID(table), tb_profile->canvas, 0, table_row, 3, 1);
+   gtk_widget_set_size_request(tb_profile->canvas, CANVAS_WIDTH+1, CANVAS_HEIGHT+1);
+-  gnome_canvas_set_scroll_region(GNOME_CANVAS(tb_profile->canvas), 0.0, 0.0,
++  goo_canvas_set_bounds(GOO_CANVAS(tb_profile->canvas), 0.0, 0.0,
+ 				 CANVAS_WIDTH, CANVAS_HEIGHT);
+   gtk_widget_show(tb_profile->canvas);
+   table_row++;
+ 
+   /* draw a black background on the canvas */
+-  gnome_canvas_item_new(gnome_canvas_root(GNOME_CANVAS(tb_profile->canvas)),
+-			gnome_canvas_rect_get_type(),
+-			"x1",0.0, "y1", 0.0, 
+-			"x2", (gdouble) CANVAS_WIDTH, "y2", (gdouble) CANVAS_HEIGHT,
+-			"fill_color_rgba", 0x000000FF,
+-			NULL);
++  root = goo_canvas_get_root_item(GOO_CANVAS(tb_profile->canvas));
++  /* Drawing a background is easily done by setting the
++     "background-color" property of the canvas but we need a
++     GooCanvasItem in order to connect the signal handler.  */
++  item = goo_canvas_rect_new(root, 0.0, 0.0,
++                             (gdouble) CANVAS_WIDTH, (gdouble) CANVAS_HEIGHT,
++                             "fill-color-rgba", 0x000000FF,
++                             NULL);
++#ifdef AMIDE_LIBGSL_SUPPORT
++  g_signal_connect(item, "button-release-event",
++                   G_CALLBACK(canvas_event_cb), tb_profile);
++#endif
+ 
+   
+   /* the fit results */
+@@ -1314,41 +1292,39 @@
+   check_button = gtk_check_button_new_with_label (_("calculate gaussian fit"));
+   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check_button), tb_profile->calc_gaussian_fit);
+   g_signal_connect(G_OBJECT(check_button), "toggled", G_CALLBACK(calc_gaussian_fit_cb), tb_profile);
+-  gtk_table_attach(GTK_TABLE(table), check_button,0,3,
+-		   table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), check_button, 0, table_row, 3, 1);
+   gtk_widget_show(check_button);
+   table_row++;
+ 
+   check_button = gtk_check_button_new_with_label (_("fix x location (c)"));
+   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check_button), tb_profile->fix_x);
+   g_signal_connect(G_OBJECT(check_button), "toggled", G_CALLBACK(fix_x_cb), tb_profile);
+-  gtk_table_attach(GTK_TABLE(table), check_button,0,3,
+-		   table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), check_button, 0, table_row, 3, 1);
+   gtk_widget_show(check_button);
+   table_row++;
+ 
+   check_button = gtk_check_button_new_with_label (_("fix dc value to zero (b)"));
+   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check_button), tb_profile->fix_dc_zero);
+   g_signal_connect(G_OBJECT(check_button), "toggled", G_CALLBACK(fix_dc_zero_cb), tb_profile);
+-  gtk_table_attach(GTK_TABLE(table), check_button,0,3,
+-		   table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), check_button, 0, table_row, 3, 1);
+   gtk_widget_show(check_button);
+   table_row++;
+ 
+   tb_profile->text = gtk_text_view_new ();
+-  gtk_table_attach(GTK_TABLE(table), tb_profile->text, 0, 3, table_row, table_row+1, 
+-		   X_PACKING_OPTIONS | GTK_FILL, Y_PACKING_OPTIONS | GTK_FILL,
+-		   X_PADDING, Y_PADDING);
+-  gtk_widget_modify_font (tb_profile->text, amitk_fixed_font_desc);
++  gtk_widget_set_hexpand(tb_profile->text, TRUE);
++  gtk_grid_attach(GTK_GRID(table), tb_profile->text, 0, table_row, 3, 1);
++  gtk_text_view_set_monospace(GTK_TEXT_VIEW(tb_profile->text), TRUE);
+   gtk_text_view_set_editable(GTK_TEXT_VIEW(tb_profile->text), FALSE);
+   gtk_widget_show(tb_profile->text);
+   table_row++;
+ 
+   /* set it to black */
+-  gdk_color_parse ("black", &color);
+-  gtk_widget_modify_base(tb_profile->text, GTK_STATE_NORMAL, &color);
+-  gdk_color_parse ("white", &color);
+-  gtk_widget_modify_text (tb_profile->text, GTK_STATE_NORMAL, &color);
++  context = gtk_widget_get_style_context(tb_profile->text);
++  css = gtk_css_provider_new();
++  gtk_css_provider_load_from_data(css, css_data, -1, NULL);
++  gtk_style_context_add_provider(context, GTK_STYLE_PROVIDER(css),
++                                 GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
++  g_object_unref(css);
+ #endif
+ 
+   /* and show all our widgets */
+--- amide.orig/amide-current/src/tb_roi_analysis.c
++++ amide/amide-current/src/tb_roi_analysis.c
+@@ -114,7 +114,7 @@
+ 			    gboolean raw_data);
+ static gchar * analyses_as_string(analysis_roi_t * roi_analyses);
+ static void response_cb (GtkDialog * dialog, gint response_id, gpointer data);
+-static void destroy_cb(GtkObject * object, gpointer data);
++static void destroy_cb(GtkWidget * object, gpointer data);
+ static gboolean delete_event_cb(GtkWidget* widget, GdkEvent * delete_event, gpointer data);
+ static void add_pages(GtkWidget * notebook, AmitkStudy * study, analysis_roi_t * roi_analyses);
+ static void read_preferences(gboolean * all_data_sets, 
+@@ -142,8 +142,8 @@
+   file_chooser = gtk_file_chooser_dialog_new ((!raw_data) ? _("Export Statistics") : _("Export ROI Raw Data Values"),
+ 					      GTK_WINDOW(tb_roi_analysis->dialog), /* parent window */
+ 					      GTK_FILE_CHOOSER_ACTION_SAVE,
+-					      GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+-					      GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
++					      _("_Cancel"), GTK_RESPONSE_CANCEL,
++					      _("_Save"), GTK_RESPONSE_ACCEPT,
+ 					      NULL);
+   gtk_file_chooser_set_local_only(GTK_FILE_CHOOSER(file_chooser), TRUE);
+   gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (file_chooser), TRUE);
+@@ -470,7 +470,7 @@
+ 
+ 
+ /* function called to destroy the roi analysis dialog */
+-static void destroy_cb(GtkObject * object, gpointer data) {
++static void destroy_cb(GtkWidget * object, gpointer data) {
+   tb_roi_analysis_t * tb_roi_analysis = data;
+   tb_roi_analysis = tb_roi_analysis_free(tb_roi_analysis);
+   return;
+@@ -504,6 +504,7 @@
+   GtkTreeViewColumn *column;
+   GtkTreeSelection *selection;
+   GtkTreeIter iter;
++  GdkRectangle geom;
+   column_t i_column;
+   gint width;
+   analysis_volume_t * volume_analyses;
+@@ -538,12 +539,13 @@
+ 	label = gtk_label_new(AMITK_OBJECT_NAME(roi_analyses->roi));
+       else
+ 	label = gtk_label_new(_("ROI Statistics"));
+-      table = gtk_table_new(5,3,FALSE);
++      table = gtk_grid_new();
++      gtk_grid_set_row_spacing(GTK_GRID(table), Y_PADDING);
++      gtk_grid_set_column_spacing(GTK_GRID(table), X_PADDING);
+       gtk_notebook_append_page(GTK_NOTEBOOK(notebook), table, label);
+ 
+-      hbox = gtk_hbox_new(FALSE, 0);
+-      gtk_table_attach(GTK_TABLE(table), GTK_WIDGET(hbox), 0,5,
+-		       table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++      hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
++      gtk_grid_attach(GTK_GRID(table), hbox, 0, table_row, 5, 1);
+       table_row++;
+       gtk_widget_show(hbox);
+ 
+@@ -559,7 +561,9 @@
+       }
+     
+       /* try to get a reasonable estimate for how wide the statistics box should be */
+-      width = 0.9*gdk_screen_width();
++      gdk_monitor_get_geometry(gdk_display_get_primary_monitor
++                               (gdk_display_get_default()), &geom);
++      width = 0.9*geom.width;
+       if (width > ROI_STATISTICS_WIDTH)
+ 	width = ROI_STATISTICS_WIDTH;
+       
+@@ -571,10 +575,9 @@
+ 				     GTK_POLICY_AUTOMATIC);
+     
+       /* and throw the scrolled widget into the packing table */
+-      gtk_table_attach(GTK_TABLE(table), GTK_WIDGET(scrolled), 0,5,table_row, table_row+1,
+-		       X_PACKING_OPTIONS | GTK_FILL,
+-		       Y_PACKING_OPTIONS | GTK_FILL,
+-		       X_PADDING, Y_PADDING);
++      gtk_widget_set_hexpand(scrolled, TRUE);
++      gtk_widget_set_vexpand(scrolled, TRUE);
++      gtk_grid_attach(GTK_GRID(table), scrolled, 0, table_row, 5, 1);
+       table_row++;
+     
+       /* and the list itself */
+@@ -828,11 +831,11 @@
+ 			  AMITK_OBJECT_NAME(study));
+   tb_roi_analysis->dialog = gtk_dialog_new_with_buttons(title, GTK_WINDOW(parent),
+ 							GTK_DIALOG_DESTROY_WITH_PARENT,
+-							GTK_STOCK_SAVE_AS, AMITK_RESPONSE_SAVE_AS,
+-							GTK_STOCK_COPY, AMITK_RESPONSE_COPY,
++							_("Save _As"), AMITK_RESPONSE_SAVE_AS,
++							_("_Copy"), AMITK_RESPONSE_COPY,
+ 							"Save Raw Values", AMITK_RESPONSE_SAVE_RAW_AS,
+-							GTK_STOCK_HELP, GTK_RESPONSE_HELP,
+-							GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
++							_("_Help"), GTK_RESPONSE_HELP,
++							_("_Close"), GTK_RESPONSE_CLOSE,
+ 							NULL);
+   g_free(title);
+ 
+@@ -848,7 +851,9 @@
+   notebook = gtk_notebook_new();
+   gtk_notebook_set_scrollable(GTK_NOTEBOOK(notebook), TRUE);
+   gtk_container_set_border_width(GTK_CONTAINER(tb_roi_analysis->dialog), 10);
+-  gtk_container_add(GTK_CONTAINER(GTK_DIALOG(tb_roi_analysis->dialog)->vbox), notebook);
++  gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area
++                                  (GTK_DIALOG(tb_roi_analysis->dialog))),
++                    notebook);
+ 
+   /* add the data pages */
+   add_pages(notebook, study, tb_roi_analysis->roi_analyses);
+@@ -950,7 +955,7 @@
+   guint table_row;
+   GtkWidget * radio_button[4];
+   GtkWidget * hseparator;
+-  GtkObject * adjustment;
++  GtkAdjustment * adjustment;
+   GtkWidget * spin_buttons[3];
+   GtkWidget * check_button;
+   analysis_calculation_t i_calculation_type;
+@@ -968,8 +973,8 @@
+   temp_string = g_strdup_printf(_("%s: ROI Analysis Initialization Dialog"), PACKAGE);
+   tb_roi_init_dialog = gtk_dialog_new_with_buttons (temp_string,  parent,
+ 						    GTK_DIALOG_DESTROY_WITH_PARENT,
+-						    GTK_STOCK_CANCEL, GTK_RESPONSE_CLOSE, 
+-						    GTK_STOCK_EXECUTE, AMITK_RESPONSE_EXECUTE,
++						    _("_Cancel"), GTK_RESPONSE_CLOSE,
++						    _("_Execute"), AMITK_RESPONSE_EXECUTE,
+ 						    NULL);
+   gtk_window_set_title(GTK_WINDOW(tb_roi_init_dialog), temp_string);
+   g_free(temp_string);
+@@ -981,52 +986,50 @@
+   gtk_container_set_border_width(GTK_CONTAINER(tb_roi_init_dialog), 10);
+ 
+   /* start making the widgets for this dialog box */
+-  table = gtk_table_new(5,3,FALSE);
++  table = gtk_grid_new();
++  gtk_grid_set_row_spacing(GTK_GRID(table), Y_PADDING);
++  gtk_grid_set_column_spacing(GTK_GRID(table), X_PADDING);
+   table_row=0;
+-  gtk_container_add(GTK_CONTAINER(GTK_DIALOG(tb_roi_init_dialog)->vbox), table);
++  gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area
++                                  (GTK_DIALOG(tb_roi_init_dialog))), table);
+ 
+   label = gtk_label_new(_("Calculate:"));
+-  gtk_table_attach(GTK_TABLE(table), label, 0,1, 
+-		   table_row, table_row+1, X_PACKING_OPTIONS, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), label, 0, table_row, 1, 1);
+   label = gtk_label_new(_("All ROIS:"));
+-  gtk_table_attach(GTK_TABLE(table), label, 1,2, 
+-		   table_row, table_row+1, X_PACKING_OPTIONS, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), label, 1, table_row, 1, 1);
+   label = gtk_label_new(_("Selected ROIS:"));
+-  gtk_table_attach(GTK_TABLE(table), label, 2,3, 
+-		   table_row, table_row+1, X_PACKING_OPTIONS, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), label, 2, table_row, 1, 1);
+   table_row++;
+ 
+   label = gtk_label_new(_("On All Data Sets:"));
+-  gtk_table_attach(GTK_TABLE(table), label, 0,1, 
+-		   table_row, table_row+1, X_PACKING_OPTIONS, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), label, 0, table_row, 1, 1);
+ 
+   radio_button[0] = gtk_radio_button_new(NULL);
+-  gtk_table_attach(GTK_TABLE(table), radio_button[0], 1,2, 
+-		   table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++  gtk_widget_set_halign(radio_button[0], GTK_ALIGN_CENTER);
++  gtk_grid_attach(GTK_GRID(table), radio_button[0], 1, table_row, 1, 1);
+   g_object_set_data(G_OBJECT(radio_button[0]), "all_data_sets", GINT_TO_POINTER(TRUE));
+   g_object_set_data(G_OBJECT(radio_button[0]), "all_rois", GINT_TO_POINTER(TRUE));
+ 
+   radio_button[1] = gtk_radio_button_new_from_widget(GTK_RADIO_BUTTON(radio_button[0]));
+-  gtk_table_attach(GTK_TABLE(table), radio_button[1], 2,3, 
+-		   table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++  gtk_widget_set_halign(radio_button[1], GTK_ALIGN_CENTER);
++  gtk_grid_attach(GTK_GRID(table), radio_button[1], 2, table_row, 1, 1);
+   g_object_set_data(G_OBJECT(radio_button[1]), "all_data_sets", GINT_TO_POINTER(TRUE));
+   g_object_set_data(G_OBJECT(radio_button[1]), "all_rois", GINT_TO_POINTER(FALSE));
+   table_row++;
+ 
+ 
+   label = gtk_label_new(_("On Selected Data Sets:"));
+-  gtk_table_attach(GTK_TABLE(table), label, 0,1, 
+-		   table_row, table_row+1, X_PACKING_OPTIONS, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), label, 0, table_row, 1, 1);
+ 
+   radio_button[2] = gtk_radio_button_new_from_widget(GTK_RADIO_BUTTON(radio_button[0]));
+-  gtk_table_attach(GTK_TABLE(table), radio_button[2], 1,2, 
+-		   table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++  gtk_widget_set_halign(radio_button[2], GTK_ALIGN_CENTER);
++  gtk_grid_attach(GTK_GRID(table), radio_button[2], 1, table_row, 1, 1);
+   g_object_set_data(G_OBJECT(radio_button[2]), "all_data_sets", GINT_TO_POINTER(FALSE));
+   g_object_set_data(G_OBJECT(radio_button[2]), "all_rois", GINT_TO_POINTER(TRUE));
+ 
+   radio_button[3] = gtk_radio_button_new_from_widget(GTK_RADIO_BUTTON(radio_button[0]));
+-  gtk_table_attach(GTK_TABLE(table), radio_button[3], 2,3, 
+-		   table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++  gtk_widget_set_halign(radio_button[3], GTK_ALIGN_CENTER);
++  gtk_grid_attach(GTK_GRID(table), radio_button[3], 2, table_row, 1, 1);
+   g_object_set_data(G_OBJECT(radio_button[3]), "all_data_sets", GINT_TO_POINTER(FALSE));
+   g_object_set_data(G_OBJECT(radio_button[3]), "all_rois", GINT_TO_POINTER(FALSE));
+   table_row++;
+@@ -1047,30 +1050,27 @@
+ 
+ 
+   /* a separator for clarity */
+-  hseparator = gtk_hseparator_new();
+-  gtk_table_attach(GTK_TABLE(table), hseparator, 0,3,table_row, table_row+1,
+-		   GTK_FILL, 0, X_PADDING, Y_PADDING);
++  hseparator = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
++  gtk_grid_attach(GTK_GRID(table), hseparator, 0, table_row, 3, 1);
+   table_row++;
+ 
+   /* do we want to calculate over a subfraction */
+   label = gtk_label_new(_("Calculate over all voxels (normal):"));
+-  gtk_table_attach(GTK_TABLE(table), label, 
+-		   0,1, table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), label, 0, table_row, 1, 1);
+   radio_button[0] = gtk_radio_button_new(NULL);
+-  gtk_table_attach(GTK_TABLE(table), radio_button[0], 1,2,table_row, table_row+1,
+-		   GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_widget_set_halign(radio_button[0], GTK_ALIGN_CENTER);
++  gtk_grid_attach(GTK_GRID(table), radio_button[0], 1, table_row, 1, 1);
+   g_object_set_data(G_OBJECT(radio_button[0]), "calculation_type", GINT_TO_POINTER(ALL_VOXELS));
+   table_row++;
+ 
+ 
+   /* do we want to calculate over a subfraction */
+   label = gtk_label_new(_("Calculate over % highest voxels:"));
+-  gtk_table_attach(GTK_TABLE(table), label, 
+-		   0,1, table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), label, 0, table_row, 1, 1);
+ 
+   radio_button[1] = gtk_radio_button_new_from_widget(GTK_RADIO_BUTTON(radio_button[0]));
+-  gtk_table_attach(GTK_TABLE(table), radio_button[1], 1,2,table_row, table_row+1,
+-		   GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_widget_set_halign(radio_button[1], GTK_ALIGN_CENTER);
++  gtk_grid_attach(GTK_GRID(table), radio_button[1], 1, table_row, 1, 1);
+   g_object_set_data(G_OBJECT(radio_button[1]), "calculation_type", GINT_TO_POINTER(HIGHEST_FRACTION_VOXELS));
+ 
+   adjustment = gtk_adjustment_new(100.0*subfraction, 0.0, 100.0,1.0, 1.0, 0.0);
+@@ -1082,19 +1082,17 @@
+   g_signal_connect(G_OBJECT(spin_buttons[0]), "output",
+ 		   G_CALLBACK(amitk_spin_button_scientific_output), NULL);
+   g_signal_connect(G_OBJECT(spin_buttons[0]), "value_changed",  G_CALLBACK(subfraction_precentage_cb), NULL);
+-  gtk_table_attach(GTK_TABLE(table), spin_buttons[0], 2,3, 
+-		   table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), spin_buttons[0], 2, table_row, 1, 1);
+   gtk_widget_set_sensitive(spin_buttons[0], calculation_type == HIGHEST_FRACTION_VOXELS);
+   table_row++;
+ 
+   /* do we want to calculate over a percentage of max */
+   label = gtk_label_new(_("Calculate for voxels >= % of Max:"));
+-  gtk_table_attach(GTK_TABLE(table), label, 
+-		   0,1, table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), label, 0, table_row, 1, 1);
+ 
+   radio_button[2] = gtk_radio_button_new_from_widget(GTK_RADIO_BUTTON(radio_button[0]));
+-  gtk_table_attach(GTK_TABLE(table), radio_button[2], 1,2,table_row, table_row+1,
+-		   GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_widget_set_halign(radio_button[2], GTK_ALIGN_CENTER);
++  gtk_grid_attach(GTK_GRID(table), radio_button[2], 1, table_row, 1, 1);
+   g_object_set_data(G_OBJECT(radio_button[2]), "calculation_type", GINT_TO_POINTER(VOXELS_NEAR_MAX));
+ 
+   adjustment = gtk_adjustment_new(threshold_percentage, 0.0, 100.0,1.0, 1.0, 0.0);
+@@ -1106,19 +1104,17 @@
+   g_signal_connect(G_OBJECT(spin_buttons[1]), "output",
+ 		   G_CALLBACK(amitk_spin_button_scientific_output), NULL);
+   g_signal_connect(G_OBJECT(spin_buttons[1]), "value_changed",  G_CALLBACK(threshold_percentage_cb), NULL);
+-  gtk_table_attach(GTK_TABLE(table), spin_buttons[1], 2,3, 
+-		   table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), spin_buttons[1], 2, table_row, 1, 1);
+   gtk_widget_set_sensitive(spin_buttons[1], calculation_type == VOXELS_NEAR_MAX);
+   table_row++;
+ 
+   /* do we want to calculate over a percentage of max */
+   label = gtk_label_new(_("Calculate for voxels >= Value:"));
+-  gtk_table_attach(GTK_TABLE(table), label, 
+-		   0,1, table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), label, 0, table_row, 1, 1);
+ 
+   radio_button[3] = gtk_radio_button_new_from_widget(GTK_RADIO_BUTTON(radio_button[0]));
+-  gtk_table_attach(GTK_TABLE(table), radio_button[3], 1,2,table_row, table_row+1,
+-		   GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_widget_set_halign(radio_button[3], GTK_ALIGN_CENTER);
++  gtk_grid_attach(GTK_GRID(table), radio_button[3], 1, table_row, 1, 1);
+   g_object_set_data(G_OBJECT(radio_button[3]), "calculation_type", GINT_TO_POINTER(VOXELS_GREATER_THAN_VALUE));
+ 
+   spin_buttons[2] = gtk_spin_button_new_with_range(-G_MAXDOUBLE, G_MAXDOUBLE, 1.0);
+@@ -1130,8 +1126,7 @@
+   g_signal_connect(G_OBJECT(spin_buttons[2]), "output",
+ 		   G_CALLBACK(amitk_spin_button_scientific_output), NULL);
+   g_signal_connect(G_OBJECT(spin_buttons[2]), "value_changed",  G_CALLBACK(threshold_value_cb), NULL);
+-  gtk_table_attach(GTK_TABLE(table), spin_buttons[2], 2,3, 
+-		   table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), spin_buttons[2], 2, table_row, 1, 1);
+   gtk_widget_set_sensitive(spin_buttons[2], calculation_type == VOXELS_GREATER_THAN_VALUE);
+   table_row++;
+ 
+@@ -1146,16 +1141,14 @@
+   }
+ 
+   /* a separator for clarity */
+-  hseparator = gtk_hseparator_new();
+-  gtk_table_attach(GTK_TABLE(table), hseparator, 0,3,table_row, table_row+1,
+-		   GTK_FILL, 0, X_PADDING, Y_PADDING);
++  hseparator = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
++  gtk_grid_attach(GTK_GRID(table), hseparator, 0, table_row, 3, 1);
+   table_row++;
+ 
+   /* do we want more accurate quantitation */
+   check_button = gtk_check_button_new_with_label(_("More Accurate Quantitation (Slow)"));
+   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check_button), accurate);
+-  gtk_table_attach(GTK_TABLE(table), check_button, 
+-		   0,2, table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), check_button, 0, table_row, 2, 1);
+   g_signal_connect(G_OBJECT(check_button), "toggled", G_CALLBACK(accurate_cb), tb_roi_init_dialog);
+   table_row++;
+ 
+--- amide.orig/amide-current/src/ui_common.c
++++ amide/amide-current/src/ui_common.c
+@@ -63,14 +63,13 @@
+ #define AXIS_ARROW_EDGE 7
+ #define AXIS_ARROW_WIDTH 6
+ 
+-static void manual_cb(GtkAction *action, gpointer * caller);
+-static void about_cb(GtkAction *action, gpointer * caller);
++static void manual_cb(GSimpleAction *action, GVariant *param, gpointer data);
++static void about_cb(GSimpleAction *action, GVariant *param, gpointer data);
+ 
+ /* our help menu... */
+-GtkActionEntry ui_common_help_menu_items[UI_COMMON_HELP_MENU_NUM] = {
+-  /* Help menu */
+-  {"HelpContents", GTK_STOCK_HELP, N_("_Contents"), "F1", N_("Open the AMIDE manual"), G_CALLBACK (manual_cb) },
+-  {"HelpAbout", GTK_STOCK_ABOUT, NULL, NULL, N_("About AMIDE"), G_CALLBACK (about_cb) },
++GActionEntry ui_common_help_menu_items[UI_COMMON_HELP_MENU_NUM] = {
++  { "manual", manual_cb },
++  { "about", about_cb }
+ };
+ 
+ 
+@@ -82,24 +81,17 @@
+ static gchar * last_path_used=NULL;
+ static ui_common_cursor_t current_cursor;
+ 
+-#ifndef AMIDE_LIBGNOMECANVAS_AA
+-static gchar * line_style_names[] = {
+-  N_("Solid"),
+-  N_("On/Off"),
+-  N_("Double Dash")
+-};
+-#endif
+ 
+ 
+ 
+ 
+-static void manual_cb(GtkAction *action, gpointer * caller) {
++static void manual_cb(GSimpleAction * action, GVariant * param, gpointer data) {
+   amide_call_help(NULL);
+ }
+ 
+ 
+ /* the about dialog */
+-static void about_cb(GtkAction *action, gpointer * caller) {
++static void about_cb(GSimpleAction * action, GVariant * param, gpointer data) {
+ 
+   const gchar *authors[] = {
+     "Andreas Loening <loening at alum.mit.edu>",
+@@ -204,29 +196,30 @@
+ 
+ /* function which brings up an about box */
+ void ui_common_about_cb(GtkWidget * button, gpointer data) {
+-  about_cb(NULL, NULL);
++  about_cb(NULL, NULL, NULL);
+ }
+ 
+-void ui_common_draw_view_axis(GnomeCanvas * canvas, gint row, gint column, 
++void ui_common_draw_view_axis(GooCanvas * canvas, gint row, gint column,
+ 			      AmitkView view, AmitkLayout layout, 
+ 			      gint axis_width, gint axis_height) {
+ 
+   const gchar * x_axis_label;
+   gdouble x_axis_label_x_location;
+   gdouble x_axis_label_y_location;
+-  GtkAnchorType x_axis_label_anchor;
+-  GnomeCanvasPoints * x_axis_line_points;
++  GooCanvasAnchorType x_axis_label_anchor;
++  GooCanvasPoints * x_axis_line_points;
+ 
+   const gchar * y_axis_label;
+   gdouble y_axis_label_x_location;
+   gdouble y_axis_label_y_location;
+-  GtkAnchorType y_axis_label_anchor;
+-  GnomeCanvasPoints * y_axis_line_points;
++  GooCanvasAnchorType y_axis_label_anchor;
++  GooCanvasPoints * y_axis_line_points;
++  GooCanvasItem * root;
+ 
+-  x_axis_line_points = gnome_canvas_points_new(2);
++  x_axis_line_points = goo_canvas_points_new(2);
+   x_axis_line_points->coords[0] = column*axis_width + AXIS_MARGIN; /* x1 */
+ 
+-  y_axis_line_points = gnome_canvas_points_new(2);
++  y_axis_line_points = goo_canvas_points_new(2);
+   y_axis_line_points->coords[0] = column*axis_width + AXIS_MARGIN; /* x1 */
+ 
+   switch(view) {
+@@ -240,7 +233,7 @@
+     x_axis_label = amitk_axis_get_name(AMITK_AXIS_X);
+     x_axis_label_x_location = column*axis_width + axis_width-AXIS_MARGIN-AXIS_TEXT_MARGIN;
+     x_axis_label_y_location = row*axis_height + AXIS_HEADER+AXIS_TEXT_MARGIN;
+-    x_axis_label_anchor = GTK_ANCHOR_NORTH_EAST;
++    x_axis_label_anchor = GOO_CANVAS_ANCHOR_NORTH_EAST;
+     
+     /* the z axis */
+     y_axis_line_points->coords[1] = row*axis_height + AXIS_HEADER; /* y1 */
+@@ -251,7 +244,7 @@
+     y_axis_label = amitk_axis_get_name(AMITK_AXIS_Z);
+     y_axis_label_x_location = column*axis_width + AXIS_MARGIN+AXIS_TEXT_MARGIN;
+     y_axis_label_y_location = row*axis_height + axis_height-AXIS_MARGIN-AXIS_TEXT_MARGIN;
+-    y_axis_label_anchor = GTK_ANCHOR_NORTH_WEST;
++    y_axis_label_anchor = GOO_CANVAS_ANCHOR_NORTH_WEST;
+     break;
+   case AMITK_VIEW_SAGITTAL:
+     /* the y axis */
+@@ -269,10 +262,10 @@
+     x_axis_label_y_location = row*axis_height + AXIS_HEADER+AXIS_TEXT_MARGIN;
+     if (layout == AMITK_LAYOUT_ORTHOGONAL) {
+       x_axis_label_x_location = column*axis_width + AXIS_MARGIN+AXIS_TEXT_MARGIN;
+-      x_axis_label_anchor = GTK_ANCHOR_NORTH_WEST;
++      x_axis_label_anchor = GOO_CANVAS_ANCHOR_NORTH_WEST;
+     } else {/* AMITK_LAYOUT_LINEAR */
+       x_axis_label_x_location = column*axis_width + axis_width-AXIS_MARGIN-AXIS_TEXT_MARGIN;
+-      x_axis_label_anchor = GTK_ANCHOR_NORTH_EAST;
++      x_axis_label_anchor = GOO_CANVAS_ANCHOR_NORTH_EAST;
+     }
+     
+     /* the z axis */
+@@ -290,10 +283,10 @@
+     y_axis_label_y_location = row*axis_height + axis_height-AXIS_MARGIN-AXIS_TEXT_MARGIN;
+     if (layout == AMITK_LAYOUT_ORTHOGONAL) {
+       y_axis_label_x_location = column*axis_width + axis_width-AXIS_MARGIN-AXIS_TEXT_MARGIN;
+-      y_axis_label_anchor = GTK_ANCHOR_SOUTH_EAST;
++      y_axis_label_anchor = GOO_CANVAS_ANCHOR_SOUTH_EAST;
+     } else {
+       y_axis_label_x_location = column*axis_width + AXIS_MARGIN+AXIS_TEXT_MARGIN;
+-      y_axis_label_anchor = GTK_ANCHOR_NORTH_WEST;
++      y_axis_label_anchor = GOO_CANVAS_ANCHOR_NORTH_WEST;
+     }
+     break;
+   case AMITK_VIEW_TRANSVERSE:
+@@ -307,7 +300,7 @@
+     x_axis_label = amitk_axis_get_name(AMITK_AXIS_X);
+     x_axis_label_x_location = column*axis_width + axis_width-AXIS_MARGIN-AXIS_TEXT_MARGIN;
+     x_axis_label_y_location = row*axis_height + axis_height-AXIS_MARGIN-AXIS_TEXT_MARGIN;
+-    x_axis_label_anchor = GTK_ANCHOR_SOUTH_EAST;
++    x_axis_label_anchor = GOO_CANVAS_ANCHOR_SOUTH_EAST;
+ 
+     /* the y axis */
+     y_axis_line_points->coords[1] = row*axis_height + axis_height-AXIS_MARGIN; /* y1 */
+@@ -318,63 +311,58 @@
+     y_axis_label = amitk_axis_get_name(AMITK_AXIS_Y);
+     y_axis_label_x_location = column*axis_width + AXIS_MARGIN+AXIS_TEXT_MARGIN;
+     y_axis_label_y_location = row*axis_height + AXIS_HEADER+AXIS_TEXT_MARGIN;
+-    y_axis_label_anchor = GTK_ANCHOR_NORTH_WEST;
++    y_axis_label_anchor = GOO_CANVAS_ANCHOR_NORTH_WEST;
+ 
+     break;
+   }
+ 
+   /* the view label */
+-  gnome_canvas_item_new(gnome_canvas_root(canvas), gnome_canvas_text_get_type(),
+-			"anchor", GTK_ANCHOR_NORTH, "text", amitk_view_get_name(view),
+-			"x", (gdouble) (column+0.5)*axis_width,
+-			"y", (gdouble) (row+0.5)*axis_height, 
+-			"fill_color", "black", 
+-			"font_desc", amitk_fixed_font_desc, NULL);
++  root = goo_canvas_get_root_item(canvas);
++  goo_canvas_text_new(root, amitk_view_get_name(view),
++                      (gdouble) (column+0.5)*axis_width,
++                      (gdouble) (row+0.5)*axis_height, -1,
++                      GOO_CANVAS_ANCHOR_NORTH,
++                      "fill-color", "black",
++                      "font-desc", amitk_fixed_font_desc, NULL);
+ 
+   /* the x axis */
+-  gnome_canvas_item_new(gnome_canvas_root(canvas), gnome_canvas_line_get_type(),
+-			"points", x_axis_line_points, "fill_color", "black",
+-			"width_pixels", 3, "last_arrowhead", TRUE, 
+-			"arrow_shape_a", (gdouble) AXIS_ARROW_LENGTH,
+-			"arrow_shape_b", (gdouble) AXIS_ARROW_EDGE,
+-			"arrow_shape_c", (gdouble) AXIS_ARROW_WIDTH,
+-			NULL);
++  goo_canvas_polyline_new(root, FALSE, 0, "points", x_axis_line_points,
++                          "stroke-color", "black", "line-width", 3.0,
++                          "end-arrow", TRUE,
++                          "arrow-length", (gdouble) AXIS_ARROW_LENGTH,
++                          "arrow-tip-length", (gdouble) AXIS_ARROW_EDGE,
++                          "arrow-width", (gdouble) AXIS_ARROW_WIDTH, NULL);
+ 
+   /* the x label */
+-  gnome_canvas_item_new(gnome_canvas_root(canvas), gnome_canvas_text_get_type(),
+-			"anchor", x_axis_label_anchor,"text", x_axis_label,
+-			"x", x_axis_label_x_location, "y", x_axis_label_y_location,
+-			"fill_color", "black", "font_desc", amitk_fixed_font_desc, NULL); 
++  goo_canvas_text_new(root, x_axis_label, x_axis_label_x_location,
++                      x_axis_label_y_location, -1, x_axis_label_anchor,
++                      "fill-color", "black",
++                      "font-desc", amitk_fixed_font_desc, NULL);
+ 
+   /* the y axis */
+-  gnome_canvas_item_new(gnome_canvas_root(canvas), gnome_canvas_line_get_type(),
+-			"points", y_axis_line_points, "fill_color", "black",
+-			"width_pixels", 3, "last_arrowhead", TRUE, 
+-			"arrow_shape_a", (gdouble) AXIS_ARROW_LENGTH,
+-			"arrow_shape_b", (gdouble) AXIS_ARROW_EDGE,
+-			"arrow_shape_c", (gdouble) AXIS_ARROW_WIDTH,
+-			NULL);
++  goo_canvas_polyline_new(root, FALSE, 0, "points", y_axis_line_points,
++                          "stroke-color", "black", "line-width", 3.0,
++                          "end-arrow", TRUE,
++                          "arrow-length", (gdouble) AXIS_ARROW_LENGTH,
++                          "arrow-tip-length", (gdouble) AXIS_ARROW_EDGE,
++                          "arrow-width", (gdouble) AXIS_ARROW_WIDTH, NULL);
+ 
+-  gnome_canvas_points_unref(x_axis_line_points);
+-  gnome_canvas_points_unref(y_axis_line_points);
++  goo_canvas_points_unref(x_axis_line_points);
++  goo_canvas_points_unref(y_axis_line_points);
+ 
+   /* the y label */
+-  gnome_canvas_item_new(gnome_canvas_root(canvas),gnome_canvas_text_get_type(),
+-			"anchor", y_axis_label_anchor, "text", y_axis_label,
+-			"x", y_axis_label_x_location,"y", y_axis_label_y_location,
+-			"fill_color", "black", "font_desc", amitk_fixed_font_desc, NULL); 
++  goo_canvas_text_new(root, y_axis_label, y_axis_label_x_location,
++                      y_axis_label_y_location, -1, y_axis_label_anchor,
++                      "fill-color", "black",
++                      "font-desc", amitk_fixed_font_desc, NULL);
+ 
+   return;
+ }
+ 
+ 
+-void ui_common_update_sample_roi_item(GnomeCanvasItem * roi_item,
++void ui_common_update_sample_roi_item(GooCanvasItem * roi_item,
+ 				      gint roi_width,
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+ 				      gdouble transparency
+-#else
+-				      GdkLineStyle line_style
+-#endif
+ 				      ) {
+ 
+   rgba_t outline_color;
+@@ -382,19 +370,13 @@
+ 
+   outline_color = amitk_color_table_outline_color(AMITK_COLOR_TABLE_NIH, TRUE);
+   fill_color = outline_color;
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+   fill_color.a *= transparency;
+-#endif
+ 
+-  gnome_canvas_item_set(roi_item, 
+-			"width_pixels", roi_width,
+-			"fill_color_rgba", amitk_color_table_rgba_to_uint32(fill_color), 
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+-			"outline_color_rgba", amitk_color_table_rgba_to_uint32(outline_color), 
+-#else
+-			"line_style", line_style,
+-#endif
+-			NULL);
++  g_object_set(roi_item,
++               "line-width", (gdouble) roi_width,
++               "fill-color-rgba", amitk_color_table_rgba_to_uint32(fill_color),
++               "stroke-color-rgba", amitk_color_table_rgba_to_uint32(outline_color),
++               NULL);
+ 
+   return;
+ }
+@@ -403,13 +385,8 @@
+ void ui_common_study_preferences_widgets(GtkWidget * packing_table,
+ 					 gint table_row,
+ 					 GtkWidget ** proi_width_spin,
+-					 GnomeCanvasItem ** proi_item,
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
++					 GooCanvasItem ** proi_item,
+ 					 GtkWidget ** proi_transparency_spin,
+-#else
+-					 GtkWidget ** pline_style_menu,
+-					 GtkWidget ** pfill_roi_button,
+-#endif
+ 					 GtkWidget ** playout_button1,
+ 					 GtkWidget ** playout_button2,
+ 					 GtkWidget ** ppanel_layout_button1,
+@@ -419,21 +396,17 @@
+ 					 GtkWidget ** ptarget_size_spin) {
+ 
+   GtkWidget * label;
+-  GtkObject * adjustment;
++  GtkAdjustment * adjustment;
+   GtkWidget * roi_canvas;
+-  GnomeCanvasPoints * roi_line_points;
++  GooCanvasPoints * roi_line_points;
++  GooCanvasItem * root;
+   GtkWidget * image;
+   GtkWidget * hseparator;
+-#ifndef AMIDE_LIBGNOMECANVAS_AA
+-  GdkLineStyle i_line_style;
+-#endif
+ 
+ 
+   /* widgets to change the roi's size */
+   label = gtk_label_new(_("ROI Width (pixels)"));
+-  gtk_table_attach(GTK_TABLE(packing_table), label, 
+-		   0,1, table_row, table_row+1,
+-		   0, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), label, 0, table_row, 1, 1);
+   gtk_widget_show(label);
+ 
+   adjustment = gtk_adjustment_new(AMITK_PREFERENCES_MIN_ROI_WIDTH,
+@@ -444,24 +417,19 @@
+   gtk_spin_button_set_snap_to_ticks(GTK_SPIN_BUTTON(*proi_width_spin), TRUE);
+   gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(*proi_width_spin), TRUE);
+   gtk_spin_button_set_update_policy(GTK_SPIN_BUTTON(*proi_width_spin), GTK_UPDATE_ALWAYS);
+-  gtk_table_attach(GTK_TABLE(packing_table), *proi_width_spin, 1,2, 
+-		   table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), *proi_width_spin,
++                  1, table_row, 1, 1);
+   gtk_widget_show(*proi_width_spin);
+ 
+   /* a little canvas indicator thingie to show the user who the new preferences will look */
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+-  roi_canvas = gnome_canvas_new_aa();
+-#else
+-  roi_canvas = gnome_canvas_new();
+-#endif
++  roi_canvas = goo_canvas_new();
+   gtk_widget_set_size_request(roi_canvas, 100, 100);
+-  gnome_canvas_set_scroll_region(GNOME_CANVAS(roi_canvas), 0.0, 0.0, 100.0, 100.0);
+-  gtk_table_attach(GTK_TABLE(packing_table),  roi_canvas, 2,3,table_row,table_row+2,
+-		   GTK_FILL, 0,  X_PADDING, Y_PADDING);
++  goo_canvas_set_bounds(GOO_CANVAS(roi_canvas), 0.0, 0.0, 100.0, 100.0);
++  gtk_grid_attach(GTK_GRID(packing_table), roi_canvas, 2, table_row, 1, 2);
+   gtk_widget_show(roi_canvas);
+ 
+   /* the box */
+-  roi_line_points = gnome_canvas_points_new(5);
++  roi_line_points = goo_canvas_points_new(5);
+   roi_line_points->coords[0] = 25.0; /* x1 */
+   roi_line_points->coords[1] = 25.0; /* y1 */
+   roi_line_points->coords[2] = 75.0; /* x2 */
+@@ -473,100 +441,56 @@
+   roi_line_points->coords[8] = 25.0; /* x4 */
+   roi_line_points->coords[9] = 25.0; /* y4 */
+ 
+-  
+-  *proi_item = gnome_canvas_item_new(gnome_canvas_root(GNOME_CANVAS(roi_canvas)), 
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+-				     gnome_canvas_polygon_get_type(),
+-#else
+-				     gnome_canvas_line_get_type(),
+-#endif
++  root = goo_canvas_get_root_item(GOO_CANVAS(roi_canvas));
++  *proi_item = goo_canvas_polyline_new(root, TRUE, 0,
+ 				     "points", roi_line_points, 
+ 				     NULL);
+-  gnome_canvas_points_unref(roi_line_points);
++  goo_canvas_points_unref(roi_line_points);
+   table_row++;
+ 
+ 
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+   /* widget to change the transparency level */
+   /* only works for anti-aliased canvases */
+   /* widgets to change the roi's size */
+ 
+   label = gtk_label_new(_("ROI Transparency"));
+-  gtk_table_attach(GTK_TABLE(packing_table), label, 
+-		   0, 1, table_row, table_row+1,
+-		   0, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), label, 0, table_row, 1, 1);
+   gtk_widget_show(label);
+ 
+   *proi_transparency_spin = gtk_spin_button_new_with_range(0.0,1.0,AMITK_PREFERENCES_DEFAULT_CANVAS_ROI_TRANSPARENCY);
+   gtk_spin_button_set_increments(GTK_SPIN_BUTTON(*proi_transparency_spin),0.1,0.1);
+   gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(*proi_transparency_spin),FALSE);
+-  gtk_table_attach(GTK_TABLE(packing_table), *proi_transparency_spin, 1,2, 
+-		   table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), *proi_transparency_spin,
++                  1, table_row, 1, 1);
+   gtk_widget_show(*proi_transparency_spin);
+   table_row++;
+-#else
+-  /* widgets to change the roi's line style */
+-  /* Anti-aliased canvas doesn't yet support this */
+-  /* also need to remove #ifndef for relevant lines in amitk_canvas_object.c and other locations  */
+-  label = gtk_label_new(_("ROI Line Style:"));
+-  gtk_table_attach(GTK_TABLE(packing_table), label, 0,1,
+-  		   table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
+-  gtk_widget_show(label);
+-
+-  *pline_style_menu = gtk_combo_box_new_text();
+-  for (i_line_style=0; i_line_style<=GDK_LINE_DOUBLE_DASH; i_line_style++) 
+-     gtk_combo_box_append_text(GTK_COMBO_BOX(*pline_style_menu),
+-			       line_style_names[i_line_style]);
+-  gtk_widget_set_size_request (*pline_style_menu, 125, -1);
+-  gtk_table_attach(GTK_TABLE(packing_table),  *pline_style_menu, 1,2, 
+-  		   table_row,table_row+1, GTK_FILL, 0,  X_PADDING, Y_PADDING);
+-  gtk_widget_show(*pline_style_menu);
+-  table_row++;
+-
+-  /* do we want to fill in isocontour roi's */
+-  label = gtk_label_new(_("Draw Isocontours/Freehands Filled:"));
+-  gtk_table_attach(GTK_TABLE(packing_table), label, 
+-		   0,1, table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
+-  gtk_widget_show(label);
+-
+-  *pfill_roi_button = gtk_check_button_new();
+-  gtk_table_attach(GTK_TABLE(packing_table), *pfill_roi_button,
+-		   1,2, table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
+-  gtk_widget_show(*pfill_roi_button);
+-  table_row++;
+-#endif
+ 
+-  hseparator = gtk_hseparator_new();
+-  gtk_table_attach(GTK_TABLE(packing_table), hseparator, 
+-		   0, 3, table_row, table_row+1,
+-		   GTK_FILL, 0, X_PADDING, Y_PADDING);
++  hseparator = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
++  gtk_grid_attach(GTK_GRID(packing_table), hseparator, 0, table_row, 3, 1);
+   table_row++;
+   gtk_widget_show(hseparator);
+ 
+ 
+   label = gtk_label_new(_("Canvas Layout:"));
+-  gtk_table_attach(GTK_TABLE(packing_table), label, 
+-		   0,1, table_row, table_row+1,
+-		   0, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), label, 0, table_row, 1, 1);
+   gtk_widget_show(label);
+ 
+   /* the radio buttons */
+   *playout_button1 = gtk_radio_button_new(NULL);
+-  image = gtk_image_new_from_stock("amide_icon_layout_linear",GTK_ICON_SIZE_DIALOG);
++  image = gtk_image_new_from_icon_name("amide_icon_layout_linear",GTK_ICON_SIZE_DIALOG);
+   gtk_button_set_image(GTK_BUTTON(*playout_button1), image);
+-  gtk_table_attach(GTK_TABLE(packing_table), *playout_button1,
+-  		   1,2, table_row, table_row+1,
+-  		   0, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), *playout_button1,
++                  1, table_row, 1, 1);
+   g_object_set_data(G_OBJECT(*playout_button1), "layout", GINT_TO_POINTER(AMITK_LAYOUT_LINEAR));
+   gtk_widget_show(*playout_button1);
+ 
+   *playout_button2 = gtk_radio_button_new(NULL);
+   gtk_radio_button_set_group(GTK_RADIO_BUTTON(*playout_button2), 
+ 			     gtk_radio_button_get_group(GTK_RADIO_BUTTON(*playout_button1)));
+-  image = gtk_image_new_from_stock("amide_icon_layout_orthogonal",GTK_ICON_SIZE_DIALOG);
++  image = gtk_image_new_from_icon_name("amide_icon_layout_orthogonal",GTK_ICON_SIZE_DIALOG);
+   gtk_button_set_image(GTK_BUTTON(*playout_button2), image);
+-  gtk_table_attach(GTK_TABLE(packing_table), *playout_button2, 2,3, table_row, table_row+1,
+-  		   0, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), *playout_button2,
++                  2, table_row, 1, 1);
+   g_object_set_data(G_OBJECT(*playout_button2), "layout", GINT_TO_POINTER(AMITK_LAYOUT_ORTHOGONAL));
+   gtk_widget_show(*playout_button2);
+ 
+@@ -574,40 +498,35 @@
+ 
+ 
+   label = gtk_label_new(_("Multiple Canvases Layout:"));
+-  gtk_table_attach(GTK_TABLE(packing_table), label, 
+-		   0,1, table_row, table_row+1,
+-		   0, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), label, 0, table_row, 1, 1);
+   gtk_widget_show(label);
+ 
+   /* the radio buttons */
+   *ppanel_layout_button1 = gtk_radio_button_new(NULL);
+-  image = gtk_image_new_from_stock("amide_icon_panels_mixed", GTK_ICON_SIZE_LARGE_TOOLBAR);
++  image = gtk_image_new_from_icon_name("amide_icon_panels_mixed", GTK_ICON_SIZE_LARGE_TOOLBAR);
+   gtk_button_set_image(GTK_BUTTON(*ppanel_layout_button1), image);
+-  gtk_table_attach(GTK_TABLE(packing_table), *ppanel_layout_button1,
+-  		   1,2, table_row, table_row+1,
+-  		   0, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), *ppanel_layout_button1,
++                  1, table_row, 1, 1);
+   g_object_set_data(G_OBJECT(*ppanel_layout_button1), "panel_layout", GINT_TO_POINTER(AMITK_PANEL_LAYOUT_MIXED));
+   gtk_widget_show(*ppanel_layout_button1);
+ 
+   *ppanel_layout_button2 = gtk_radio_button_new(NULL);
+   gtk_radio_button_set_group(GTK_RADIO_BUTTON(*ppanel_layout_button2), 
+ 			     gtk_radio_button_get_group(GTK_RADIO_BUTTON(*ppanel_layout_button1)));
+-  image = gtk_image_new_from_stock("amide_icon_panels_linear_x", GTK_ICON_SIZE_LARGE_TOOLBAR);
++  image = gtk_image_new_from_icon_name("amide_icon_panels_linear_x", GTK_ICON_SIZE_LARGE_TOOLBAR);
+   gtk_button_set_image(GTK_BUTTON(*ppanel_layout_button2), image);
+-  gtk_table_attach(GTK_TABLE(packing_table), *ppanel_layout_button2,
+-  		   2,3, table_row, table_row+1,
+-  		   0, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), *ppanel_layout_button2,
++                  2, table_row, 1, 1);
+   g_object_set_data(G_OBJECT(*ppanel_layout_button2), "panel_layout", GINT_TO_POINTER(AMITK_PANEL_LAYOUT_LINEAR_X));
+   gtk_widget_show(*ppanel_layout_button2);
+ 
+   *ppanel_layout_button3 = gtk_radio_button_new(NULL);
+   gtk_radio_button_set_group(GTK_RADIO_BUTTON(*ppanel_layout_button3), 
+ 			     gtk_radio_button_get_group(GTK_RADIO_BUTTON(*ppanel_layout_button1)));
+-  image = gtk_image_new_from_stock("amide_icon_panels_linear_y", GTK_ICON_SIZE_LARGE_TOOLBAR);
++  image = gtk_image_new_from_icon_name("amide_icon_panels_linear_y", GTK_ICON_SIZE_LARGE_TOOLBAR);
+   gtk_button_set_image(GTK_BUTTON(*ppanel_layout_button3), image);
+-  gtk_table_attach(GTK_TABLE(packing_table), *ppanel_layout_button3,
+-  		   3,4, table_row, table_row+1,
+-  		   0, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), *ppanel_layout_button3,
++                  3, table_row, 1, 1);
+   g_object_set_data(G_OBJECT(*ppanel_layout_button3), "panel_layout", GINT_TO_POINTER(AMITK_PANEL_LAYOUT_LINEAR_Y));
+   gtk_widget_show(*ppanel_layout_button3);
+ 
+@@ -616,21 +535,20 @@
+ 
+   /* do we want the size of the canvas to not resize */
+   label = gtk_label_new(_("Maintain view size constant:"));
+-  gtk_table_attach(GTK_TABLE(packing_table), label, 
+-		   0,1, table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), label, 0, table_row, 1, 1);
+   gtk_widget_show(label);
+ 
+   *pmaintain_size_button = gtk_check_button_new();
+-  gtk_table_attach(GTK_TABLE(packing_table), *pmaintain_size_button, 
+-		   1,2, table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++  gtk_widget_set_halign(*pmaintain_size_button, GTK_ALIGN_CENTER);
++  gtk_grid_attach(GTK_GRID(packing_table), *pmaintain_size_button,
++                  1, table_row, 1, 1);
+   gtk_widget_show(*pmaintain_size_button);
+   table_row++;
+ 
+ 
+   /* widgets to change the amount of empty space in the center of the target */
+   label = gtk_label_new(_("Target Empty Area (pixels)"));
+-  gtk_table_attach(GTK_TABLE(packing_table), label, 
+-		   0,1, table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), label, 0, table_row, 1, 1);
+   gtk_widget_show(label);
+ 
+   adjustment = gtk_adjustment_new(AMITK_PREFERENCES_MIN_TARGET_EMPTY_AREA, 
+@@ -642,8 +560,8 @@
+   gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(*ptarget_size_spin), TRUE);
+   gtk_spin_button_set_update_policy(GTK_SPIN_BUTTON(*ptarget_size_spin), GTK_UPDATE_ALWAYS);
+ 
+-  gtk_table_attach(GTK_TABLE(packing_table), *ptarget_size_spin, 1,2, 
+-		   table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), *ptarget_size_spin,
++                  1, table_row, 1, 1);
+   gtk_widget_show(*ptarget_size_spin);
+ 
+ 
+@@ -655,31 +573,27 @@
+   GtkWidget * axis_indicator;
+   AmitkView i_view;
+ 
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+-  axis_indicator = gnome_canvas_new_aa();
+-#else
+-  axis_indicator = gnome_canvas_new();
+-#endif
++  axis_indicator = goo_canvas_new();
+   switch(layout) {
+   case AMITK_LAYOUT_ORTHOGONAL:
+     gtk_widget_set_size_request(axis_indicator, 2.0*AXIS_WIDTH, 2.0*ORTHOGONAL_AXIS_HEIGHT);
+-    gnome_canvas_set_scroll_region(GNOME_CANVAS(axis_indicator), 0.0, 0.0, 
++    goo_canvas_set_bounds(GOO_CANVAS(axis_indicator), 0.0, 0.0,
+ 				   2.0*AXIS_WIDTH, 2.0*ORTHOGONAL_AXIS_HEIGHT);
+-    ui_common_draw_view_axis(GNOME_CANVAS(axis_indicator), 0, 0, AMITK_VIEW_TRANSVERSE, 
++    ui_common_draw_view_axis(GOO_CANVAS(axis_indicator), 0, 0, AMITK_VIEW_TRANSVERSE,
+ 			     layout, AXIS_WIDTH, ORTHOGONAL_AXIS_HEIGHT);
+-    ui_common_draw_view_axis(GNOME_CANVAS(axis_indicator), 1, 0, AMITK_VIEW_CORONAL, 
++    ui_common_draw_view_axis(GOO_CANVAS(axis_indicator), 1, 0, AMITK_VIEW_CORONAL,
+ 			     layout, AXIS_WIDTH, ORTHOGONAL_AXIS_HEIGHT);
+-    ui_common_draw_view_axis(GNOME_CANVAS(axis_indicator), 0, 1, AMITK_VIEW_SAGITTAL, 
++    ui_common_draw_view_axis(GOO_CANVAS(axis_indicator), 0, 1, AMITK_VIEW_SAGITTAL,
+ 			     layout, AXIS_WIDTH, ORTHOGONAL_AXIS_HEIGHT);
+ 
+     break;
+   case AMITK_LAYOUT_LINEAR:
+   default:
+     gtk_widget_set_size_request(axis_indicator, 3.0*AXIS_WIDTH, LINEAR_AXIS_HEIGHT);
+-    gnome_canvas_set_scroll_region(GNOME_CANVAS(axis_indicator), 0.0, 0.0, 
++    goo_canvas_set_bounds(GOO_CANVAS(axis_indicator), 0.0, 0.0,
+ 				   3.0*AXIS_WIDTH, LINEAR_AXIS_HEIGHT);
+     for (i_view=0;i_view< AMITK_VIEW_NUM;i_view++)
+-      ui_common_draw_view_axis(GNOME_CANVAS(axis_indicator), 0, i_view, i_view,
++      ui_common_draw_view_axis(GOO_CANVAS(axis_indicator), 0, i_view, i_view,
+ 			       layout, AXIS_WIDTH, LINEAR_AXIS_HEIGHT);
+     break;
+   }
+@@ -690,41 +604,41 @@
+ 
+ 
+ 
+-/* This data is in X bitmap format, and can be created with the 'bitmap' utility. */
+-#define small_dot_width 3
+-#define small_dot_height 3
+-static gchar small_dot_bits[] = {0x00, 0x02, 0x00};
+- 
+-
+ /* load in the cursors */
+ static void ui_common_cursor_init(void) {
+ 
+-  GdkPixmap *source, *mask;
+-  GdkColor fg = { 0, 0, 0, 0 }; /* black. */
+-  GdkColor bg = { 0, 0, 0, 0 }; /* black */
++  cairo_surface_t * surf;
++  cairo_t * cr;
++  GdkPixbuf * pixbuf;
+   GdkCursor * small_dot;
++  GdkDisplay * d;
+  
+-  source = gdk_bitmap_create_from_data(NULL, small_dot_bits, small_dot_width, small_dot_height);
+-  mask = gdk_bitmap_create_from_data(NULL, small_dot_bits, small_dot_width, small_dot_height);
+-  small_dot = gdk_cursor_new_from_pixmap (source, mask, &fg, &bg, 2,2);
+-  g_object_unref (source);
+-  g_object_unref (mask);
++  surf = cairo_image_surface_create(CAIRO_FORMAT_A1, 3, 3);
++  cr = cairo_create(surf);
++  cairo_arc(cr, 0, 0, 1.5, 0, 2 * M_PI);
++  cairo_fill(cr);
++  cairo_destroy(cr);
++  pixbuf = gdk_pixbuf_get_from_surface(surf, 0, 0, 3, 3);
++  cairo_surface_destroy(surf);
++  d = gdk_display_get_default();
++  small_dot = gdk_cursor_new_from_pixbuf(d, pixbuf, 0, 0);
++  g_object_unref(pixbuf);
+                                      
+   /* load in the cursors */
+ 
+   ui_common_cursor[UI_CURSOR_DEFAULT] = NULL;
+-  ui_common_cursor[UI_CURSOR_ROI_MODE] =  gdk_cursor_new(GDK_DRAFT_SMALL);
++  ui_common_cursor[UI_CURSOR_ROI_MODE] =  gdk_cursor_new_for_display(d, GDK_DRAFT_SMALL);
+   ui_common_cursor[UI_CURSOR_ROI_RESIZE] = small_dot; /* was GDK_SIZING */
+   ui_common_cursor[UI_CURSOR_ROI_ROTATE] = small_dot; /* was GDK_EXCHANGE */
+-  ui_common_cursor[UI_CURSOR_ROI_DRAW] = gdk_cursor_new(GDK_PENCIL);
++  ui_common_cursor[UI_CURSOR_ROI_DRAW] = gdk_cursor_new_for_display(d, GDK_PENCIL);
+   ui_common_cursor[UI_CURSOR_OBJECT_SHIFT] = small_dot; /* was GDK_FLEUR */
+-  ui_common_cursor[UI_CURSOR_ROI_ISOCONTOUR] = gdk_cursor_new(GDK_DRAFT_SMALL);
+-  ui_common_cursor[UI_CURSOR_ROI_ERASE] = gdk_cursor_new(GDK_DRAFT_SMALL);
+-  ui_common_cursor[UI_CURSOR_DATA_SET_MODE] = gdk_cursor_new(GDK_CROSSHAIR);
+-  ui_common_cursor[UI_CURSOR_FIDUCIAL_MARK_MODE] = gdk_cursor_new(GDK_DRAFT_SMALL);
+-  ui_common_cursor[UI_CURSOR_RENDERING_ROTATE_XY] = gdk_cursor_new(GDK_FLEUR);
+-  ui_common_cursor[UI_CURSOR_RENDERING_ROTATE_Z] = gdk_cursor_new(GDK_EXCHANGE);
+-  ui_common_cursor[UI_CURSOR_WAIT] = gdk_cursor_new(GDK_WATCH);
++  ui_common_cursor[UI_CURSOR_ROI_ISOCONTOUR] = gdk_cursor_new_for_display(d, GDK_DRAFT_SMALL);
++  ui_common_cursor[UI_CURSOR_ROI_ERASE] = gdk_cursor_new_for_display(d, GDK_DRAFT_SMALL);
++  ui_common_cursor[UI_CURSOR_DATA_SET_MODE] = gdk_cursor_new_for_display(d, GDK_CROSSHAIR);
++  ui_common_cursor[UI_CURSOR_FIDUCIAL_MARK_MODE] = gdk_cursor_new_for_display(d, GDK_DRAFT_SMALL);
++  ui_common_cursor[UI_CURSOR_RENDERING_ROTATE_XY] = gdk_cursor_new_for_display(d, GDK_FLEUR);
++  ui_common_cursor[UI_CURSOR_RENDERING_ROTATE_Z] = gdk_cursor_new_for_display(d, GDK_EXCHANGE);
++  ui_common_cursor[UI_CURSOR_WAIT] = gdk_cursor_new_for_display(d, GDK_WATCH);
+   
+ 
+  
+@@ -743,7 +657,7 @@
+ 
+   /* sanity checks */
+   if (widget == NULL) return;
+-  if (!GTK_WIDGET_REALIZED(widget)) return;
++  if (!gtk_widget_get_realized(widget)) return;
+ 
+   if (which_cursor != UI_CURSOR_WAIT)
+     current_cursor = which_cursor;
+@@ -819,8 +733,8 @@
+ 
+   dialog = gtk_dialog_new_with_buttons (_("Request Dialog"),  parent,
+ 					GTK_DIALOG_DESTROY_WITH_PARENT,
+-					GTK_STOCK_CANCEL, GTK_RESPONSE_CLOSE, 
+-					GTK_STOCK_OK, GTK_RESPONSE_OK,
++					_("_Cancel"), GTK_RESPONSE_CLOSE,
++					_("_OK"), GTK_RESPONSE_OK,
+ 					NULL);
+   g_object_set_data(G_OBJECT(dialog), "return_str_ptr", return_str_ptr);
+   g_signal_connect(G_OBJECT(dialog), "response", G_CALLBACK(init_response_cb), NULL);
+@@ -828,25 +742,25 @@
+   gtk_dialog_set_response_sensitive(GTK_DIALOG(dialog), GTK_RESPONSE_OK,FALSE);
+   gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_OK);
+ 
+-  table = gtk_table_new(3,2,FALSE);
++  table = gtk_grid_new();
++  gtk_grid_set_row_spacing(GTK_GRID(table), Y_PADDING);
++  gtk_grid_set_column_spacing(GTK_GRID(table), X_PADDING);
+   table_row=0;
+-  gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), table);
++  gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area
++                                  (GTK_DIALOG(dialog))), table);
+ 
+ 
+-  image = gtk_image_new_from_stock(GTK_STOCK_DIALOG_QUESTION,GTK_ICON_SIZE_DIALOG);
+-  gtk_table_attach(GTK_TABLE(table), image, 
+-		   0,1, table_row, table_row+1, X_PACKING_OPTIONS, 0, X_PADDING, Y_PADDING);
++  image = gtk_image_new_from_icon_name("dialog-question", GTK_ICON_SIZE_DIALOG);
++  gtk_grid_attach(GTK_GRID(table), image, 0, table_row, 1, 1);
+ 
+   label = gtk_label_new(prompt);
+-  gtk_table_attach(GTK_TABLE(table), label, 
+-		   1,2, table_row, table_row+1, X_PACKING_OPTIONS, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), label, 1, table_row, 1, 1);
+   table_row++;
+ 
+ 
+   entry = gtk_entry_new();
+   gtk_entry_set_activates_default(GTK_ENTRY(entry), TRUE);
+-  gtk_table_attach(GTK_TABLE(table), entry, 
+-		   1,2, table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), entry, 1, table_row, 1, 1);
+   g_signal_connect(G_OBJECT(entry), "changed", G_CALLBACK(entry_activate), dialog);
+   table_row++;
+ 
+@@ -894,7 +808,7 @@
+   toolbar_item = gtk_tool_item_new();
+   gtk_container_add(GTK_CONTAINER(toolbar_item), widget);
+   if (tooltip != NULL)
+-    gtk_tool_item_set_tooltip_text(toolbar_item,tooltip);
++    gtk_widget_set_tooltip_text(widget, tooltip);
+   gtk_tool_item_set_homogeneous(toolbar_item, FALSE);
+   gtk_toolbar_insert(GTK_TOOLBAR(toolbar), toolbar_item, position);
+ 
+@@ -934,12 +848,14 @@
+ 
+ /* keep track of open windows */
+ void amide_unregister_window(gpointer * widget) {
++  GtkApplication * app;
+ 
+   g_return_if_fail(widget != NULL);
+ 
+   windows = g_list_remove(windows, widget);
++  app = gtk_window_get_application(GTK_WINDOW(widget));
+ 
+-  if (windows == NULL) gtk_main_quit();
++  if (windows == NULL) g_application_quit(G_APPLICATION(app));
+ 
+   return;
+ }
+--- amide.orig/amide-current/src/ui_gate_dialog.c
++++ amide/amide-current/src/ui_gate_dialog.c
+@@ -402,10 +402,11 @@
+   column_type_t i_column;
+ 
+   temp_string = g_strdup_printf(_("%s: Gate Dialog"),PACKAGE);
+-  dialog = gtk_dialog_new_with_buttons(temp_string,  parent,
+-					    GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR,
+-					    NULL);
++  dialog = gtk_dialog_new();
++  gtk_window_set_title(GTK_WINDOW(dialog), temp_string);
+   g_free(temp_string);
++  gtk_window_set_transient_for(GTK_WINDOW(dialog), parent);
++  gtk_window_set_destroy_with_parent(GTK_WINDOW(dialog), TRUE);
+   gtk_window_set_resizable(GTK_WINDOW(dialog), TRUE);
+ 
+   gd = g_try_new(ui_gate_dialog_t, 1);
+@@ -419,13 +420,15 @@
+   g_signal_connect(G_OBJECT(dialog), "delete_event", G_CALLBACK(delete_event_cb), gd);
+ 
+   /* start making the widgets for this dialog box */
+-  packing_table = gtk_table_new(5,4,FALSE);
++  packing_table = gtk_grid_new();
++  gtk_grid_set_row_spacing(GTK_GRID(packing_table), Y_PADDING);
++  gtk_grid_set_column_spacing(GTK_GRID(packing_table), X_PADDING);
+   table_row=0;
+-  gtk_container_add (GTK_CONTAINER (GTK_DIALOG(dialog)->vbox), packing_table);
++  gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area
++                                    (GTK_DIALOG(dialog))), packing_table);
+ 
+   label = gtk_label_new(_("Start Gate"));
+-  gtk_table_attach(GTK_TABLE(packing_table), label, 0,1,
+-		   table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), label, 0, table_row, 1, 1);
+ 
+   gd->start_spin = gtk_spin_button_new_with_range(0, G_MAXDOUBLE, 1.0);
+   gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(gd->start_spin), TRUE);
+@@ -434,15 +437,13 @@
+ 		   G_CALLBACK(change_spin_cb), dialog);
+   g_signal_connect(G_OBJECT(gd->start_spin), "output",
+ 		   G_CALLBACK(amitk_spin_button_scientific_output), NULL);
+-  gtk_table_attach(GTK_TABLE(packing_table), gd->start_spin,1,2,
+-		   table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), gd->start_spin, 1, table_row, 1, 1);
+   table_row++;
+ 
+ 
+ 
+   label = gtk_label_new(_("End Gate"));
+-  gtk_table_attach(GTK_TABLE(packing_table), label, 0,1,
+-		   table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), label, 0, table_row, 1, 1);
+     
+   gd->end_spin = gtk_spin_button_new_with_range(0, G_MAXDOUBLE, 1.0);
+   gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(gd->end_spin), TRUE);
+@@ -451,15 +452,12 @@
+ 		   G_CALLBACK(change_spin_cb), dialog);
+   g_signal_connect(G_OBJECT(gd->end_spin), "output",
+ 		   G_CALLBACK(amitk_spin_button_scientific_output), NULL);
+-  gtk_table_attach(GTK_TABLE(packing_table), gd->end_spin,1,2,
+-		   table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), gd->end_spin, 1, table_row, 1, 1);
+   table_row++;
+ 
+   /* a separator for clarity */
+-  hseparator = gtk_hseparator_new();
+-  gtk_table_attach(GTK_TABLE(packing_table), hseparator, 0, 4, 
+-		   table_row, table_row+1,
+-		   GTK_FILL, 0, X_PADDING, Y_PADDING);
++  hseparator = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
++  gtk_grid_attach(GTK_GRID(packing_table), hseparator, 0, table_row, 4, 1);
+   table_row++;
+ 
+   /* the scroll widget which the list will go into */
+@@ -468,11 +466,9 @@
+   gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled),
+   				 GTK_POLICY_AUTOMATIC,
+   				 GTK_POLICY_AUTOMATIC);
+-  gtk_table_attach(GTK_TABLE(packing_table), scrolled, 0,2, 
+-  		   table_row, table_row+1, 
+-  		   X_PACKING_OPTIONS | GTK_FILL, 
+-  		   Y_PACKING_OPTIONS | GTK_FILL, 
+-  		   X_PADDING, Y_PADDING);
++  gtk_widget_set_hexpand(scrolled, TRUE);
++  gtk_widget_set_vexpand(scrolled, TRUE);
++  gtk_grid_attach(GTK_GRID(packing_table), scrolled, 0, table_row, 2, 1);
+   table_row++;
+     
+ 
+@@ -503,8 +499,8 @@
+   gd->autoplay_check_button = gtk_check_button_new_with_label (_("Auto play"));
+   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(gd->autoplay_check_button), FALSE);
+   g_signal_connect(G_OBJECT(gd->autoplay_check_button), "toggled", G_CALLBACK(autoplay_cb),gd);
+-  gtk_table_attach(GTK_TABLE(packing_table), gd->autoplay_check_button,0,2,table_row,table_row+1,
+-		   GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), gd->autoplay_check_button,
++                  0, table_row, 2, 1);
+   table_row++;
+ 
+ 
+--- amide.orig/amide-current/src/ui_preferences_dialog.c
++++ amide/amide-current/src/ui_preferences_dialog.c
+@@ -48,12 +48,7 @@
+ 
+ static void update_roi_sample_item(ui_study_t * ui_study);
+ static void roi_width_cb(GtkWidget * widget, gpointer data);
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+ static void roi_transparency_cb(GtkWidget * widget, gpointer data);
+-#else
+-static void line_style_cb(GtkWidget * widget, gpointer data);
+-static void fill_roi_cb(GtkWidget * widget, gpointer data);
+-#endif
+ static void layout_cb(GtkWidget * widget, gpointer data);
+ static void panel_layout_cb(GtkWidget * widget, gpointer data);
+ static void maintain_size_cb(GtkWidget * widget, gpointer data);
+@@ -70,16 +65,12 @@
+ 
+ /* function called to update the roi sampe item */
+ static void update_roi_sample_item(ui_study_t * ui_study) {
+-  GnomeCanvasItem * roi_item;
++  GooCanvasItem * roi_item;
+ 
+   roi_item = g_object_get_data(G_OBJECT(ui_study->preferences->dialog), "roi_item");
+   ui_common_update_sample_roi_item(roi_item,
+ 				   AMITK_PREFERENCES_CANVAS_ROI_WIDTH(ui_study->preferences),
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+ 				   AMITK_PREFERENCES_CANVAS_ROI_TRANSPARENCY(ui_study->preferences)
+-#else
+-				   AMITK_PREFERENCES_CANVAS_LINE_STYLE(ui_study->preferences)
+-#endif
+ 				   );
+ 
+   return;
+@@ -101,7 +92,6 @@
+ }
+ 
+ 
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+ /* function to change the roi internal transparency */
+ static void roi_transparency_cb(GtkWidget * widget, gpointer data) {
+ 
+@@ -117,34 +107,6 @@
+   return;
+ }
+ 
+-#else
+-/* function to change the line style */
+-static void line_style_cb(GtkWidget * widget, gpointer data) {
+-
+-  ui_study_t * ui_study=data;
+-  GdkLineStyle new_line_style;
+-  GnomeCanvasItem * roi_item;
+-
+-  g_return_if_fail(ui_study->study != NULL);
+-
+-  /* figure out which menu item called me */
+-  new_line_style = gtk_combo_box_get_active(GTK_COMBO_BOX(widget));
+-  amitk_preferences_set_canvas_line_style(ui_study->preferences, new_line_style);
+-  update_roi_sample_item(ui_study);
+-
+-  return;
+-}
+-
+-static void fill_roi_cb(GtkWidget * widget, gpointer data) {
+-
+-  ui_study_t * ui_study = data;
+-  amitk_preferences_set_canvas_fill_roi(ui_study->preferences, 
+-					gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)));
+-
+-  return;
+-}
+-#endif
+-
+ /* function called to change the layout */
+ static void layout_cb(GtkWidget * widget, gpointer data) {
+ 
+@@ -295,12 +257,7 @@
+   GtkWidget * maintain_size_button;
+   GtkWidget * roi_width_spin;
+   GtkWidget * target_size_spin;
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+   GtkWidget * roi_transparency_spin;
+-#else
+-  GtkWidget * line_style_menu;
+-  GtkWidget * fill_roi_button;
+-#endif
+   GtkWidget * layout_button1;
+   GtkWidget * layout_button2;
+   GtkWidget * panel_layout_button1;
+@@ -313,7 +270,7 @@
+   GtkWidget * entry;
+   AmitkModality i_modality;
+   AmitkWhichDefaultDirectory i_which_default_directory;
+-  GnomeCanvasItem * roi_item;
++  GooCanvasItem * roi_item;
+   AmitkThresholdStyle i_threshold_style;
+   GtkWidget * style_buttons[AMITK_THRESHOLD_STYLE_NUM];
+   GtkWidget * hbox;
+@@ -331,8 +288,8 @@
+   temp_string = g_strdup_printf(_("%s: Preferences Dialog"), PACKAGE);
+   dialog = gtk_dialog_new_with_buttons (temp_string,  ui_study->window,
+ 					GTK_DIALOG_DESTROY_WITH_PARENT,
+-					GTK_STOCK_HELP, GTK_RESPONSE_HELP,
+-					GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
++					_("_Help"), GTK_RESPONSE_HELP,
++					_("_Close"), GTK_RESPONSE_CLOSE,
+ 					NULL);
+   gtk_window_set_title(GTK_WINDOW(dialog), temp_string);
+   g_free(temp_string);
+@@ -343,7 +300,8 @@
+   g_signal_connect(G_OBJECT(dialog), "delete_event", G_CALLBACK(delete_event_cb), ui_study->preferences);
+ 
+   notebook = gtk_notebook_new();
+-  gtk_container_add (GTK_CONTAINER (GTK_DIALOG(dialog)->vbox), notebook);
++  gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area
++                                    (GTK_DIALOG(dialog))), notebook);
+ 
+   
+ 
+@@ -353,7 +311,9 @@
+ 
+ 
+   /* start making the widgets for this dialog box */
+-  packing_table = gtk_table_new(4,5,FALSE);
++  packing_table = gtk_grid_new();
++  gtk_grid_set_row_spacing(GTK_GRID(packing_table), Y_PADDING);
++  gtk_grid_set_column_spacing(GTK_GRID(packing_table), X_PADDING);
+   label = gtk_label_new(_("ROI/View Preferences"));
+   table_row=0;
+   gtk_notebook_append_page(GTK_NOTEBOOK(notebook), packing_table, label);
+@@ -361,25 +321,17 @@
+ 
+   /* warn that these preferences are only for new stuff */
+   label = gtk_label_new(study_preference_text);
+-  gtk_table_attach(GTK_TABLE(packing_table), label, 
+-		   0,3, table_row, table_row+1,
+-		   0, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), label, 0, table_row, 3, 1);
+   table_row++;
+ 
+-  hseparator = gtk_hseparator_new();
+-  gtk_table_attach(GTK_TABLE(packing_table), hseparator, 
+-		   0, 3, table_row, table_row+1,
+-		   GTK_FILL, 0, X_PADDING, Y_PADDING);
++  hseparator = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
++  gtk_grid_attach(GTK_GRID(packing_table), hseparator, 0, table_row, 3, 1);
+   table_row++;
+ 
+ 
+   ui_common_study_preferences_widgets(packing_table, table_row,
+ 				      &roi_width_spin, &roi_item, 
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+ 				      &roi_transparency_spin,
+-#else
+-				      &line_style_menu, &fill_roi_button,
+-#endif
+ 				      &layout_button1, &layout_button2, 
+ 				      &panel_layout_button1,&panel_layout_button2,&panel_layout_button3,
+ 				      &maintain_size_button,
+@@ -394,20 +346,9 @@
+   g_object_set_data(G_OBJECT(dialog), "roi_item", roi_item);
+   update_roi_sample_item(ui_study);
+ 
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+   gtk_spin_button_set_value(GTK_SPIN_BUTTON(roi_transparency_spin),
+ 			    AMITK_PREFERENCES_CANVAS_ROI_TRANSPARENCY(ui_study->preferences));
+   g_signal_connect(G_OBJECT(roi_transparency_spin), "value_changed",  G_CALLBACK(roi_transparency_cb), ui_study);
+-#else
+-  gtk_combo_box_set_active(GTK_COMBO_BOX(line_style_menu),
+-			   AMITK_PREFERENCES_CANVAS_LINE_STYLE(ui_study->preferences));
+-  g_signal_connect(G_OBJECT(line_style_menu), "changed", G_CALLBACK(line_style_cb), ui_study);
+-
+-  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(fill_roi_button), 
+-			       AMITK_PREFERENCES_CANVAS_FILL_ROI(ui_study->preferences));
+-  g_signal_connect(G_OBJECT(fill_roi_button), "toggled", G_CALLBACK(fill_roi_cb), ui_study);
+-#endif
+-
+ 
+   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(layout_button1), 
+ 			       (AMITK_PREFERENCES_CANVAS_LAYOUT(ui_study->preferences) == AMITK_LAYOUT_LINEAR));
+@@ -444,37 +385,33 @@
+      Threshold Windows
+      ---------------------- */
+ 
+-  packing_table = gtk_table_new(4,2,FALSE);
++  packing_table = gtk_grid_new();
++  gtk_grid_set_row_spacing(GTK_GRID(packing_table), Y_PADDING);
++  gtk_grid_set_column_spacing(GTK_GRID(packing_table), X_PADDING);
+   label = gtk_label_new(_("Thresholding"));
+   table_row=0;
+   gtk_notebook_append_page(GTK_NOTEBOOK(notebook), packing_table, label);
+ 
+   /* warn that these preferences are only for new stuff */
+   label = gtk_label_new(data_set_preference_text);
+-  gtk_table_attach(GTK_TABLE(packing_table), label, 
+-		   0,3, table_row, table_row+1,
+-		   0, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), label, 0, table_row, 3, 1);
+   gtk_widget_show(label);
+   table_row++;
+ 
+-  hseparator = gtk_hseparator_new();
+-  gtk_table_attach(GTK_TABLE(packing_table), hseparator, 
+-		   0, 3, table_row, table_row+1,
+-		   GTK_FILL, 0, X_PADDING, Y_PADDING);
++  hseparator = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
++  gtk_grid_attach(GTK_GRID(packing_table), hseparator, 0, table_row, 3, 1);
+   gtk_widget_show(hseparator);
+   table_row++;
+ 
+   
+   /* threshold type selection */
+   label = gtk_label_new(_("Threshold Style"));
+-  gtk_table_attach(GTK_TABLE(packing_table), label, 0,1, table_row,table_row+1,
+-		   X_PACKING_OPTIONS | GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), label, 0, table_row, 1, 1);
+   gtk_widget_show(label);
+     
+-  hbox = gtk_hbox_new(FALSE, 0);
++  hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
+   amitk_threshold_style_widgets(style_buttons, hbox);
+-  gtk_table_attach(GTK_TABLE(packing_table), hbox, 1,2, table_row,table_row+1,
+-		   X_PACKING_OPTIONS | GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), hbox, 1, table_row, 1, 1);
+   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(style_buttons[AMITK_PREFERENCES_THRESHOLD_STYLE(ui_study->preferences)]),
+ 			       TRUE);
+   for (i_threshold_style = 0; i_threshold_style < AMITK_THRESHOLD_STYLE_NUM; i_threshold_style++) 
+@@ -494,11 +431,12 @@
+ 
+ 
+   windows_widget = amitk_window_edit_new(NULL, ui_study->preferences);
+-  gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrolled), windows_widget);
++  gtk_container_add(GTK_CONTAINER(scrolled), windows_widget);
+   gtk_widget_show(windows_widget);
+ 
+-  gtk_table_attach(GTK_TABLE(packing_table), scrolled, 0,2, table_row,table_row+1,
+-		   X_PACKING_OPTIONS | GTK_FILL, GTK_FILL|GTK_EXPAND, X_PADDING, Y_PADDING);
++  gtk_widget_set_hexpand(scrolled, TRUE);
++  gtk_widget_set_vexpand(scrolled, TRUE);
++  gtk_grid_attach(GTK_GRID(packing_table), scrolled, 0, table_row, 2, 1);
+   gtk_widget_show(scrolled);
+ 
+   gtk_widget_show(packing_table);
+@@ -508,7 +446,9 @@
+   /* ----------------------
+      Default color tables 
+      ---------------------- */
+-  packing_table = gtk_table_new(4,2,FALSE);
++  packing_table = gtk_grid_new();
++  gtk_grid_set_row_spacing(GTK_GRID(packing_table), Y_PADDING);
++  gtk_grid_set_column_spacing(GTK_GRID(packing_table), X_PADDING);
+   label = gtk_label_new(_("Default Color Tables"));
+   table_row=0;
+   gtk_notebook_append_page(GTK_NOTEBOOK(notebook), packing_table, label);
+@@ -520,13 +460,13 @@
+ 				  amitk_modality_get_name(i_modality));
+     label = gtk_label_new(temp_string);
+     g_free(temp_string);
+-    gtk_table_attach(GTK_TABLE(packing_table), label, 0,1, table_row,table_row+1,
+-		     X_PACKING_OPTIONS | GTK_FILL, 0, X_PADDING, Y_PADDING);
++    gtk_widget_set_hexpand(label, TRUE);
++    gtk_grid_attach(GTK_GRID(packing_table), label, 0, table_row, 1, 1);
+     gtk_widget_show(label);
+ 
+     menu = amitk_color_table_menu_new();
+-    gtk_table_attach(GTK_TABLE(packing_table), menu, 1,2, table_row,table_row+1,
+-		     X_PACKING_OPTIONS | GTK_FILL, 0, X_PADDING, Y_PADDING);
++    gtk_widget_set_hexpand(menu, TRUE);
++    gtk_grid_attach(GTK_GRID(packing_table), menu, 1, table_row, 1, 1);
+     gtk_combo_box_set_active(GTK_COMBO_BOX(menu),
+ 			     AMITK_PREFERENCES_COLOR_TABLE(ui_study->preferences, i_modality));
+     g_object_set_data(G_OBJECT(menu), "modality", GINT_TO_POINTER(i_modality));
+@@ -545,71 +485,59 @@
+ 
+ 
+   /* start making the widgets for this dialog box */
+-  packing_table = gtk_table_new(4,5,FALSE);
++  packing_table = gtk_grid_new();
++  gtk_grid_set_row_spacing(GTK_GRID(packing_table), Y_PADDING);
++  gtk_grid_set_column_spacing(GTK_GRID(packing_table), X_PADDING);
+   label = gtk_label_new(_("Miscellaneous"));
+   table_row=0;
+   gtk_notebook_append_page(GTK_NOTEBOOK(notebook), packing_table, label);
+ 
+   label = gtk_label_new(_("Send Warning Messages to Console:"));
+-  gtk_table_attach(GTK_TABLE(packing_table), label, 
+-		   0,1, table_row, table_row+1,
+-		   GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), label, 0, table_row, 1, 1);
+ 
+   check_button = gtk_check_button_new();
+   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check_button), 
+ 			       AMITK_PREFERENCES_WARNINGS_TO_CONSOLE(ui_study->preferences));
+   g_signal_connect(G_OBJECT(check_button), "toggled", G_CALLBACK(warnings_to_console_cb), ui_study);
+-  gtk_table_attach(GTK_TABLE(packing_table), check_button, 
+-		   1,2, table_row, table_row+1,
+-		   GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), check_button, 1, table_row, 1, 1);
+   table_row++;
+ 
+ 
+   label = gtk_label_new(_("Prompt for \"Save Changes\" on Exit:"));
+-  gtk_table_attach(GTK_TABLE(packing_table), label, 
+-		   0,1, table_row, table_row+1,
+-		   GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), label, 0, table_row, 1, 1);
+ 
+   check_button = gtk_check_button_new();
+   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check_button), 
+ 			       AMITK_PREFERENCES_PROMPT_FOR_SAVE_ON_EXIT(ui_study->preferences));
+   g_signal_connect(G_OBJECT(check_button), "toggled", G_CALLBACK(save_on_exit_cb), ui_study);
+-  gtk_table_attach(GTK_TABLE(packing_table), check_button, 
+-		   1,2, table_row, table_row+1,
+-		   GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), check_button, 1, table_row, 1, 1);
+   table_row++;
+ 
+ 
+   label = gtk_label_new(_("Which Default Directory:"));
+-  gtk_table_attach(GTK_TABLE(packing_table), label, 
+-		   0,1, table_row, table_row+1,
+-		   GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), label, 0, table_row, 1, 1);
+ 
+-  menu = gtk_combo_box_new_text();
++  menu = gtk_combo_box_text_new();
+   for (i_which_default_directory=0; i_which_default_directory < AMITK_WHICH_DEFAULT_DIRECTORY_NUM; i_which_default_directory++)
+-    gtk_combo_box_append_text(GTK_COMBO_BOX(menu),
++    gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(menu),
+ 			      amitk_which_default_directory_names[i_which_default_directory]);
+   gtk_combo_box_set_active(GTK_COMBO_BOX(menu),
+ 			   AMITK_PREFERENCES_WHICH_DEFAULT_DIRECTORY(ui_study->preferences));
+   g_signal_connect(G_OBJECT(menu), "changed", G_CALLBACK(which_default_directory_cb), ui_study);
+-  gtk_table_attach(GTK_TABLE(packing_table), menu, 
+-		   1,2, table_row, table_row+1,
+-		   GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_widget_set_hexpand(menu, TRUE);
++  gtk_grid_attach(GTK_GRID(packing_table), menu, 1, table_row, 1, 1);
+   table_row++;
+ 
+ 
+   label = gtk_label_new(_("Specified Directory:"));
+-  gtk_table_attach(GTK_TABLE(packing_table), label, 
+-		   0,1, table_row, table_row+1,
+-		   GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), label, 0, table_row, 1, 1);
+ 
+   entry =  gtk_file_chooser_button_new(_("Default Directory:"),
+   				       GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER);
+   amitk_preferences_set_file_chooser_directory(ui_study->preferences, entry); /* set the default directory if applicable */
+   g_signal_connect(G_OBJECT(entry), "current-folder-changed", G_CALLBACK(default_directory_cb), ui_study);
+-  gtk_table_attach(GTK_TABLE(packing_table), entry, 
+-		   1,2, table_row, table_row+1,
+-		   GTK_FILL|GTK_EXPAND, 0, X_PADDING, Y_PADDING);
++  gtk_widget_set_hexpand(entry, TRUE);
++  gtk_grid_attach(GTK_GRID(packing_table), entry, 1, table_row, 1, 1);
+ 
+   /* make sure what's being shown in the above widget is consistent with what we have,
+      this only comes up if we've never set a default directory before */
+--- amide.orig/amide-current/src/ui_render.c
++++ amide/amide-current/src/ui_render.c
+@@ -27,7 +27,7 @@
+ 
+ #ifdef AMIDE_LIBVOLPACK_SUPPORT
+ 
+-#include <libgnomecanvas/libgnomecanvas.h>
++#include <goocanvas.h>
+ 
+ #include "amide_gconf.h"
+ #include "image.h"
+@@ -45,19 +45,20 @@
+ #define UPDATE_RENDERING 0x1
+ 
+ 
+-static gboolean canvas_event_cb(GtkWidget* widget,  GdkEvent * event, gpointer data);
+-static void stereoscopic_cb(GtkRadioAction * action, GtkRadioAction * current, gpointer data);
++static gboolean canvas_event_cb(GooCanvasItem * item, GooCanvasItem * target,  GdkEvent * event, gpointer data);
++static void stereoscopic_cb(GSimpleAction * action, GVariant * state, gpointer data);
+ static void change_zoom_cb(GtkWidget * widget, gpointer data);
+ static void rotate_cb(GtkAdjustment * adjustment, gpointer data);
++static gboolean button_release_cb(GtkWidget * widget, GdkEvent * event, gpointer data);
+ static void reset_axis_pressed_cb(GtkWidget * widget, gpointer data);
+-static void export_cb(GtkAction * action, gpointer data);
+-static void parameters_cb(GtkAction * action, gpointer data);
+-static void transfer_function_cb(GtkAction * action, gpointer data);
++static void export_cb(GSimpleAction * action, GVariant * param, gpointer data);
++static void parameters_cb(GSimpleAction * action, GVariant * param, gpointer data);
++static void transfer_function_cb(GSimpleAction * action, GVariant * param, gpointer data);
+ #if (AMIDE_FFMPEG_SUPPORT || AMIDE_LIBFAME_SUPPORT)
+-static void movie_cb(GtkAction * action, gpointer data);
++static void movie_cb(GSimpleAction * action, GVariant * param, gpointer data);
+ #endif
+ static gboolean delete_event_cb(GtkWidget* widget, GdkEvent * event, gpointer data);
+-static void close_cb(GtkAction * action, gpointer data);
++static void close_cb(GSimpleAction * action, GVariant * param, gpointer data);
+ 
+ 
+ static void read_render_preferences(gboolean * strip_highs, gboolean * optimize_renderings,
+@@ -73,14 +74,15 @@
+    -events for non-new roi's are handled by ui_study_rois_cb_roi_event 
+ 
+ */
+-static gboolean canvas_event_cb(GtkWidget* widget,  GdkEvent * event, gpointer data) {
++static gboolean canvas_event_cb(GooCanvasItem * item, GooCanvasItem * target, GdkEvent * event, gpointer data) {
+ 
+   ui_render_t * ui_render = data;
+-  GnomeCanvas * canvas;
++  GooCanvas * canvas;
++  GooCanvasItem * root;
+   AmitkPoint temp_point;
+   AmitkCanvasPoint temp_cpoint1, temp_cpoint2;
+   AmitkCanvasPoint canvas_cpoint, diff_cpoint;
+-  GnomeCanvasPoints * line_points;
++  GooCanvasPoints * line_points;
+   guint i, j,k;
+   rgba_t color;
+   gdouble dim;
+@@ -88,14 +90,15 @@
+   static AmitkPoint theta;
+   static AmitkCanvasPoint initial_cpoint, center_cpoint;
+   static gboolean dragging = FALSE;
+-  static GnomeCanvasItem * rotation_box[8];
++  static GooCanvasItem * rotation_box[8];
+   static AmitkPoint box_point[8];
+ 
+-  canvas = GNOME_CANVAS(widget);
++  canvas = goo_canvas_item_get_canvas(item);
++  root = goo_canvas_get_root_item(canvas);
+ 
+   /* get the location of the event, and convert it to the canvas coordinates */
+-  gnome_canvas_window_to_world(canvas, event->button.x, event->button.y, &canvas_cpoint.x, &canvas_cpoint.y);
+-  gnome_canvas_w2c_d(canvas, canvas_cpoint.x, canvas_cpoint.y, &canvas_cpoint.x, &canvas_cpoint.y);
++  canvas_cpoint.x = event->button.x_root;
++  canvas_cpoint.y = event->button.y_root;
+   dim = MIN(ui_render->pixbuf_width, ui_render->pixbuf_height);
+   temp_point.x = temp_point.y = temp_point.z = -dim/2.0;
+   amitk_space_set_offset(ui_render->box_space, temp_point);
+@@ -134,7 +137,7 @@
+ 
+ 	/* draw the 8 lines we use to represent out cube */
+ 	for (i=0; i<8; i++) {
+-	  line_points = gnome_canvas_points_new(2);
++	  line_points = goo_canvas_points_new(2);
+ 	  if ((i < 4) && (i & 0x1)){ /* i < 4, evens */
+ 	    j = (i & 0x2) ? i -2 : i -1;
+ 	    k = (i & 0x2) ? i  : i +1;
+@@ -152,25 +155,28 @@
+ 	  color = 
+ 	    amitk_color_table_outline_color(ui_render->renderings->rendering->color_table, TRUE);
+ 	  rotation_box[i] = 
+-	    gnome_canvas_item_new(gnome_canvas_root(GNOME_CANVAS(ui_render->canvas)), 
+-				  gnome_canvas_line_get_type(),
+-				  "points", line_points, 
+-				  "fill_color_rgba", amitk_color_table_rgba_to_uint32(color),
+-				  "width_units", 1.0, NULL);
+-	  gnome_canvas_points_unref(line_points);
++            goo_canvas_polyline_new(root, FALSE, 0, "points", line_points,
++                                    "stroke-color-rgba",
++                                    amitk_color_table_rgba_to_uint32(color),
++                                    "line-width", 1.0, NULL);
++	  goo_canvas_points_unref(line_points);
+ 	}
++        g_signal_connect(rotation_box[0], "button-release-event",
++                         G_CALLBACK(canvas_event_cb), ui_render);
++        g_signal_connect(rotation_box[0], "motion-notify-event",
++                         G_CALLBACK(canvas_event_cb), ui_render);
+ 
+ 	/* translate the 8 vertices back to the base frame */
+ 	for (i=0; i<8; i++)
+ 	  box_point[i] = amitk_space_s2b(ui_render->box_space, box_point[i]);
+ 
+ 	if (event->button.button == 1)
+-	  gnome_canvas_item_grab(GNOME_CANVAS_ITEM(rotation_box[0]),
++	  goo_canvas_pointer_grab(canvas, rotation_box[0],
+ 				 GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK,
+ 				 ui_common_cursor[UI_CURSOR_RENDERING_ROTATE_XY],
+ 				 event->button.time);
+ 	else /* button 2 */
+-	  gnome_canvas_item_grab(GNOME_CANVAS_ITEM(rotation_box[0]),
++	  goo_canvas_pointer_grab(canvas, rotation_box[0],
+ 				 GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK,
+ 				 ui_common_cursor[UI_CURSOR_RENDERING_ROTATE_Z],
+ 				 event->button.time);
+@@ -227,7 +233,7 @@
+ 	
+ 	/* draw the 8 lines we use to represent out cube */
+ 	for (i=0; i<8; i++) {
+-	  line_points = gnome_canvas_points_new(2);
++	  line_points = goo_canvas_points_new(2);
+ 	  if ((i < 4) && (i & 0x1)){ /* i < 4, evens */
+ 	    j = (i & 0x2) ? i -2 : i -1;
+ 	    k = (i & 0x2) ? i  : i +1;
+@@ -242,8 +248,8 @@
+ 	  line_points->coords[1] = box_point[j].y; /* y1 */
+ 	  line_points->coords[2] = box_point[k].x;  /* x2 */
+ 	  line_points->coords[3] = box_point[k].y; /* y2 */
+-	  gnome_canvas_item_set(rotation_box[i],  "points", line_points, NULL);
+-	  gnome_canvas_points_unref(line_points);
++	  g_object_set(rotation_box[i],  "points", line_points, NULL);
++	  goo_canvas_points_unref(line_points);
+ 	}
+ 	
+ 	/* translate the 8 vertices back to the base frame */
+@@ -260,12 +266,12 @@
+ 
+     case GDK_BUTTON_RELEASE:
+       if (dragging) {
+-	gnome_canvas_item_ungrab(GNOME_CANVAS_ITEM(rotation_box[0]), event->button.time);
++	goo_canvas_pointer_ungrab(canvas, rotation_box[0], event->button.time);
+ 	dragging = FALSE;
+ 
+ 	/* get rid of the frame */
+ 	for (i=0; i<8; i++)
+-	  gtk_object_destroy(GTK_OBJECT(rotation_box[i]));
++	  goo_canvas_item_remove(rotation_box[i]);
+ 
+ 	/* render now if appropriate*/
+ 	if (!ui_render->update_without_release) 
+@@ -280,10 +286,11 @@
+   return FALSE;
+ }
+ /* function to switch into stereoscopic rendering mode */
+-static void stereoscopic_cb(GtkRadioAction * action, GtkRadioAction * current, gpointer data) {
++static void stereoscopic_cb(GSimpleAction * action, GVariant * state, gpointer data) {
+   ui_render_t * ui_render = data;
+-  ui_render->stereoscopic = gtk_radio_action_get_current_value((GTK_RADIO_ACTION(current)));
++  ui_render->stereoscopic = g_variant_get_int32(state);
+   ui_render_add_update(ui_render); 
++  g_simple_action_set_state(action, state);
+   return;
+ }
+ 
+@@ -312,7 +319,48 @@
+   return;
+ }
+ 
++/* Compensate the lack of GTK_UPDATE_DISCONTINUOUS in GTK 3 -- the
++   sliders are practically unusable without it.  */
++static gboolean button_release_cb(GtkWidget * widget, GdkEvent * event, gpointer data) {
+ 
++  ui_render_t * ui_render = data;
++  GtkAdjustment * adjustment;
++  AmitkAxis i_axis;
++  gdouble val;
++
++  if (AMITK_IS_DIAL(widget))
++    adjustment = amitk_dial_get_adjustment(AMITK_DIAL(widget));
++  else
++    adjustment = gtk_range_get_adjustment(GTK_RANGE(widget));
++
++  i_axis = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(adjustment), "axis"));
++  val = gtk_adjustment_get_value(adjustment);
++
++  if (i_axis == AMITK_AXIS_X) {
++    if (val != ui_render->x_old) {
++      ui_render->x_old = val;
++      rotate_cb(adjustment, ui_render);
++    } else {
++      gtk_adjustment_set_value(adjustment, 0.0);
++    }
++  } else if (i_axis == AMITK_AXIS_Y) {
++    if (val != ui_render->y_old) {
++      ui_render->y_old = val;
++      rotate_cb(adjustment, ui_render);
++    } else {
++      gtk_adjustment_set_value(adjustment, 0.0);
++    }
++  } else {
++    if (val != ui_render->z_old) {
++      ui_render->z_old = val;
++      rotate_cb(adjustment, ui_render);
++    } else {
++      gtk_adjustment_set_value(adjustment, 0.0);
++    }
++  }
++
++  return FALSE;
++}
+ 
+ 
+ /* function called when one of the rotate widgets has been hit */
+@@ -324,7 +372,7 @@
+ 
+   /* figure out which rotate widget called me */
+   i_axis = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(adjustment),"axis"));
+-  rot = (adjustment->value/180.0)*M_PI; /* get rotation in radians */
++  rot = (gtk_adjustment_get_value(adjustment)/180.0)*M_PI; /* get rotation in radians */
+ 
+   /* update the rotation values */
+   renderings_set_rotation(ui_render->renderings, i_axis, rot);
+@@ -333,8 +381,7 @@
+   ui_render_add_update(ui_render); 
+ 
+   /* return adjustment back to normal */
+-  adjustment->value = 0.0;
+-  gtk_adjustment_changed(adjustment);
++  gtk_adjustment_set_value(adjustment, 0.0);
+ 
+   return;
+ }
+@@ -354,7 +401,7 @@
+ 
+ 
+ /* function to save a rendering as an external data format */
+-static void export_cb(GtkAction * action, gpointer data) {
++static void export_cb(GSimpleAction * action, GVariant * param, gpointer data) {
+ 
+   ui_render_t * ui_render = data;
+   renderings_t * temp_renderings;
+@@ -369,8 +416,8 @@
+   file_chooser = gtk_file_chooser_dialog_new(_("Export File"),
+ 					     GTK_WINDOW(ui_render->window), /* parent window */
+ 					     GTK_FILE_CHOOSER_ACTION_SAVE,
+-					     GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+-					     GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
++					     _("_Cancel"), GTK_RESPONSE_CANCEL,
++					     _("_Save"), GTK_RESPONSE_ACCEPT,
+ 					     NULL);
+   gtk_file_chooser_set_local_only(GTK_FILE_CHOOSER(file_chooser), TRUE);
+   gtk_file_chooser_set_do_overwrite_confirmation(GTK_FILE_CHOOSER (file_chooser), TRUE);
+@@ -419,14 +466,14 @@
+ 
+ 
+ /* function called when the button to pop up a rendering parameters modification dialog is hit */
+-static void parameters_cb(GtkAction * action, gpointer data) {
++static void parameters_cb(GSimpleAction * action, GVariant * param, gpointer data) {
+   ui_render_t * ui_render = data;
+   ui_render_dialog_create_parameters(ui_render);
+   return;
+ }
+ 
+ /* function called when the button to pop up a transfer function dialog is hit */
+-static void transfer_function_cb(GtkAction * action, gpointer data) {
++static void transfer_function_cb(GSimpleAction * action, GVariant * param, gpointer data) {
+   ui_render_t * ui_render = data;
+   ui_render_dialog_create_transfer_function(ui_render);
+   return;
+@@ -435,7 +482,7 @@
+ 
+ #if (AMIDE_FFMPEG_SUPPORT || AMIDE_LIBFAME_SUPPORT)
+ /* function called when the button to pop up a movie generation dialog */
+-static void movie_cb(GtkAction * action, gpointer data) {
++static void movie_cb(GSimpleAction * action, GVariant * param, gpointer data) {
+   ui_render_t * ui_render = data;
+   ui_render->movie = ui_render_movie_dialog_create(ui_render);
+   return;
+@@ -455,7 +502,7 @@
+ }
+ 
+ /* function ran when closing the rendering window */
+-static void close_cb(GtkAction* widget, gpointer data) {
++static void close_cb(GSimpleAction * action, GVariant * param, gpointer data) {
+ 
+   ui_render_t * ui_render = data;
+   GtkWindow * window = ui_render->window;
+@@ -470,100 +517,107 @@
+ 
+ 
+ 
+-static const GtkActionEntry normal_items[] = {
+-  /* Toplevel */
+-  { "FileMenu", NULL, N_("_File") },
+-  { "EditMenu", NULL, N_("_Edit") },
+-  { "HelpMenu", NULL, N_("_Help") },
+-  
+-  /* File menu */
+-  { "ExportRendering", NULL, N_("_Export Rendering"), NULL, N_("Export the rendered image"), G_CALLBACK(export_cb)},
++static const GActionEntry normal_items[] = {
++  { "export", export_cb },
+ #if (AMIDE_FFMPEG_SUPPORT || AMIDE_LIBFAME_SUPPORT)
+-  { "CreateMovie", NULL, N_("_Create Movie"), NULL, N_("Create a movie out of a sequence of renderings"), G_CALLBACK(movie_cb)},
++  { "movie", movie_cb },
+ #endif
+-  { "Close", GTK_STOCK_CLOSE, NULL, "<control>W", N_("Close the rendering dialog"), G_CALLBACK (close_cb)},
+-  
+-  /* Edit menu */
+-  { "Parameters", NULL, N_("_Rendering Parameters"), NULL, N_("Adjust parameters pertinent to the rendered image"), G_CALLBACK(parameters_cb)},
+-  
+-  /* Toolbar items */
+-  { "TransferFunctions", "amide_icon_transfer_function", N_("X-fer"), NULL, N_("Opacity and density transfer functions"), G_CALLBACK(transfer_function_cb)}
++  { "close", close_cb },
++  { "parameters", parameters_cb },
++  { "transfer", transfer_function_cb }
+ };
+ 
+-static const GtkRadioActionEntry stereoscopic_radio_entries[] = {
+-  { "MonoscopicRendering", "amide_icon_view_mode_single", N_("Mono"), NULL,  N_("Monoscopic rendering"), 0},
+-  { "StereoscopicRendering", "amide_icon_view_mode_linked_2way", N_("Stereo"), NULL,  N_("Stereoscopic rendering"), 1},
++static const GActionEntry stateful_entries[] = {
++  { "rendering", NULL, "i", "@i 0", stereoscopic_cb }
+ };
+ 
+-static const char *ui_description =
+-"<ui>"
+-"  <menubar name='MainMenu'>"
+-"    <menu action='FileMenu'>"
+-"      <menuitem action='ExportRendering'/>"
+-"      <menuitem action='CreateMovie'/>"
+-"      <separator/>"
+-"      <menuitem action='Close'/>"
+-"    </menu>"
+-"    <menu action='EditMenu'>"
+-"      <menuitem action='Parameters'/>"
+-"    </menu>"
+-HELP_MENU_UI_DESCRIPTION
+-"  </menubar>"
+-"  <toolbar name='ToolBar'>"
+-"    <toolitem action='TransferFunctions'/>"
+-"    <separator/>"
+-"    <toolitem action='MonoscopicRendering'/>"
+-"    <toolitem action='StereoscopicRendering'/>"
+-  /* "    <separator/>" */
+-  /* "    <placeholder name='Zoom' />" */
+-"  </toolbar>"
+-"</ui>";
+-
+ /* function to setup the menus and toolbars for the rendering ui */
+ static void menus_toolbar_create(ui_render_t * ui_render) {
+ 
+   GtkWidget *menubar;
+   GtkWidget *toolbar;
+-  GtkActionGroup *action_group;
+-  GtkUIManager *ui_manager;
+-  GtkAccelGroup *accel_group;
++  GMenuModel *model;
++  GMenu *menu;
++  GSimpleActionGroup *action_group;
++  GtkBuilder *builder;
++  GtkApplication * app;
+   GtkWidget * label;
+   GtkWidget * spin_button;
+-  GError * error;
++  GtkWidget * icon;
++  GtkToolItem * tool_item;
++  const gchar *close[] = { "<Control>w", NULL };
++  const gchar *help[] = { "F1", NULL };
+ 
+   /* sanity check */
+   g_assert(ui_render !=NULL);
+ 
+   /* create an action group with all the menu actions */
+-  action_group = gtk_action_group_new ("MenuActions");
+-  gtk_action_group_set_translation_domain(action_group, GETTEXT_PACKAGE);
+-  gtk_action_group_add_actions(action_group, normal_items, G_N_ELEMENTS(normal_items),ui_render);
+-  gtk_action_group_add_actions(action_group, ui_common_help_menu_items, G_N_ELEMENTS(ui_common_help_menu_items),ui_render);
+-  gtk_action_group_add_radio_actions(action_group, stereoscopic_radio_entries, G_N_ELEMENTS (stereoscopic_radio_entries), 
+-				     0, G_CALLBACK(stereoscopic_cb), ui_render);
+-
+-  /* create the ui manager, and add the actions and accel's */
+-  ui_manager = gtk_ui_manager_new ();
+-  gtk_ui_manager_insert_action_group (ui_manager, action_group, 0);
+-  accel_group = gtk_ui_manager_get_accel_group (ui_manager);
+-  gtk_window_add_accel_group (ui_render->window, accel_group);
++  app = gtk_window_get_application(ui_render->window);
++  action_group = g_simple_action_group_new();
++  g_action_map_add_action_entries(G_ACTION_MAP(action_group),
++                                  normal_items, G_N_ELEMENTS(normal_items),
++                                  ui_render);
++  g_action_map_add_action_entries(G_ACTION_MAP(app), ui_common_help_menu_items,
++                                  G_N_ELEMENTS(ui_common_help_menu_items),
++                                  ui_render);
++  g_action_map_add_action_entries(G_ACTION_MAP(action_group),
++                                  stateful_entries,
++                                  G_N_ELEMENTS(stateful_entries), ui_render);
++  gtk_widget_insert_action_group(ui_render->window_vbox, "render",
++                                 G_ACTION_GROUP(action_group));
++
++  gtk_application_set_accels_for_action(app, "render.close", close);
++  gtk_application_set_accels_for_action(app, "app.manual", help);
+ 
+   /* create the actual menu/toolbar ui */
+-  error = NULL;
+-  if (!gtk_ui_manager_add_ui_from_string (ui_manager, ui_description, -1, &error)) {
+-    g_warning ("%s: building menus failed in %s: %s", PACKAGE, __FILE__, error->message);
+-    g_error_free (error);
+-    return;
+-  }
++  builder = gtk_builder_new_from_resource("/com/github/ferdymercury/amide/render.ui");
++  gtk_builder_set_translation_domain(builder, GETTEXT_PACKAGE);
+ 
+   /* pack in the menu and toolbar */
+-  menubar = gtk_ui_manager_get_widget (ui_manager, "/MainMenu");
++  model = G_MENU_MODEL (gtk_builder_get_object (builder, "menubar"));
++  menu = gtk_application_get_menu_by_id (app, "help");
++  g_menu_append_submenu (G_MENU (model), _("_Help"), G_MENU_MODEL (menu));
++#if !(AMIDE_FFMPEG_SUPPORT || AMIDE_LIBFAME_SUPPORT)
++  /* Remove "Create Movie" menu item.  */
++  menu = G_MENU (gtk_builder_get_object (builder, "file"));
++  g_menu_remove (menu, 1);
++#endif
++  menubar = gtk_menu_bar_new_from_model (model);
++  g_object_unref (builder);
+   gtk_box_pack_start (GTK_BOX (ui_render->window_vbox), menubar, FALSE, FALSE, 0);
+ 
+-  toolbar = gtk_ui_manager_get_widget (ui_manager, "/ToolBar");
++  toolbar = gtk_toolbar_new ();
+   gtk_box_pack_start (GTK_BOX (ui_render->window_vbox), toolbar, FALSE, FALSE, 0);
+   gtk_toolbar_set_style(GTK_TOOLBAR(toolbar), GTK_TOOLBAR_ICONS);
+ 
++  icon = gtk_image_new_from_icon_name("amide_icon_transfer_function",
++                                      GTK_ICON_SIZE_LARGE_TOOLBAR);
++  tool_item = gtk_tool_button_new(icon, _("X-fer"));
++  gtk_tool_item_set_tooltip_text(tool_item,
++                                 _("Opacity and density transfer functions"));
++  gtk_actionable_set_action_name(GTK_ACTIONABLE(tool_item), "render.transfer");
++  gtk_toolbar_insert(GTK_TOOLBAR(toolbar), tool_item, -1);
++
++  ui_common_toolbar_append_separator(toolbar);
++
++  tool_item = gtk_radio_tool_button_new(NULL);
++  gtk_tool_button_set_label(GTK_TOOL_BUTTON(tool_item), _("Mono"));
++  gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(tool_item),
++                                 "amide_icon_view_mode_single");
++  gtk_tool_item_set_tooltip_text(tool_item, _("Monoscopic rendering"));
++  gtk_actionable_set_detailed_action_name(GTK_ACTIONABLE(tool_item),
++                                          "render.rendering(0)");
++  gtk_toolbar_insert(GTK_TOOLBAR(toolbar), tool_item, -1);
++  tool_item =
++    gtk_radio_tool_button_new_from_widget(GTK_RADIO_TOOL_BUTTON(tool_item));
++  gtk_tool_button_set_label(GTK_TOOL_BUTTON(tool_item), _("Stereo"));
++  gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(tool_item),
++                                "amide_icon_view_mode_linked_2way");
++  gtk_tool_item_set_tooltip_text(tool_item, _("Stereoscopic rendering"));
++  gtk_actionable_set_detailed_action_name(GTK_ACTIONABLE(tool_item),
++                                          "render.rendering(1)");
++  gtk_toolbar_insert(GTK_TOOLBAR(toolbar), tool_item, -1);
++
+   /* a separator for clarity */
+   ui_common_toolbar_append_separator(toolbar);
+ 
+@@ -664,6 +718,8 @@
+ 				    GList * selected_objects,
+ 				    AmitkPreferences * preferences) {
+ 
++  GdkMonitor * monitor;
++  GdkRectangle geom;
+   ui_render_t * ui_render;
+   gboolean strip_highs;
+   gboolean optimize_rendering;
+@@ -700,6 +756,9 @@
+   ui_render->front_factor = RENDERING_DEFAULT_FRONT_FACTOR;
+   ui_render->density = RENDERING_DEFAULT_DENSITY;
+   ui_render->zoom = RENDERING_DEFAULT_ZOOM;
++  ui_render->x_old = 0.0;
++  ui_render->y_old = 0.0;
++  ui_render->z_old = 0.0;
+   ui_render->start = AMITK_STUDY_VIEW_START_TIME(study);
+   ui_render->duration = AMITK_STUDY_VIEW_DURATION(study);
+   ui_render->fov = AMITK_STUDY_FOV(study);
+@@ -717,8 +776,11 @@
+ 
+   ui_render->stereo_eye_width = 
+     amide_gconf_get_int(GCONF_AMIDE_RENDERING,"eye-width");
+-  if (ui_render->stereo_eye_width == 0)  /* if no config file, put in sane value */
+-    ui_render->stereo_eye_width = 50*gdk_screen_width()/gdk_screen_width_mm(); /* in pixels */
++  if (ui_render->stereo_eye_width == 0) { /* if no config file, put in sane value */
++    monitor = gdk_display_get_primary_monitor(gdk_display_get_default());
++    gdk_monitor_get_geometry(monitor, &geom);
++    ui_render->stereo_eye_width = 50*geom.width/gdk_monitor_get_width_mm(monitor); /* in pixels */
++  }
+ 
+   ui_render->stereo_eye_angle = 
+     amide_gconf_get_float(GCONF_AMIDE_RENDERING,"eye-angle");
+@@ -742,7 +804,7 @@
+ GdkPixbuf * ui_render_get_pixbuf(ui_render_t * ui_render) {
+ 
+   GdkPixbuf * pixbuf;
+-  pixbuf = amitk_get_pixbuf_from_canvas(GNOME_CANVAS(ui_render->canvas), 0.0,0.0,
++  pixbuf = amitk_get_pixbuf_from_canvas(GOO_CANVAS(ui_render->canvas), 0.0,0.0,
+ 					ui_render->pixbuf_width, ui_render->pixbuf_height);
+   return pixbuf;
+ }
+@@ -766,6 +828,7 @@
+ gboolean ui_render_update_immediate(gpointer data) {
+ 
+   ui_render_t * ui_render = data;
++  GooCanvasItem * root;
+   amide_intpoint_t size_dim; 
+   AmideEye eyes;
+   gboolean return_val=TRUE;
+@@ -806,17 +869,24 @@
+ 
+ 
+   /* put up the image */
++  root = goo_canvas_get_root_item(GOO_CANVAS(ui_render->canvas));
+   if (ui_render->canvas_image != NULL) 
+-    gnome_canvas_item_set(ui_render->canvas_image,
++    g_object_set(ui_render->canvas_image,
+ 			  "pixbuf", ui_render->pixbuf, NULL);
+-  else /* time to make a new image */
++  else { /* time to make a new image */
+     ui_render->canvas_image = 
+-      gnome_canvas_item_new(gnome_canvas_root(GNOME_CANVAS(ui_render->canvas)),
+-			    gnome_canvas_pixbuf_get_type(),
+-			    "pixbuf", ui_render->pixbuf,
+-			    "x", (double) 0.0,
+-			    "y", (double) 0.0,
+-			    NULL);
++      goo_canvas_image_new(root, ui_render->pixbuf, 0.0, 0.0, NULL);
++    g_signal_connect(ui_render->canvas_image, "button-press-event",
++                     G_CALLBACK(canvas_event_cb), ui_render);
++    g_signal_connect(ui_render->canvas_image, "button-release-event",
++                     G_CALLBACK(canvas_event_cb), ui_render);
++    g_signal_connect(ui_render->canvas_image, "enter-notify-event",
++                     G_CALLBACK(canvas_event_cb), ui_render);
++    g_signal_connect(ui_render->canvas_image, "leave-notify-event",
++                     G_CALLBACK(canvas_event_cb), ui_render);
++    g_signal_connect(ui_render->canvas_image, "motion-notify-event",
++                     G_CALLBACK(canvas_event_cb), ui_render);
++  }
+ 
+   /* get the height and width */
+   ui_render->pixbuf_width = gdk_pixbuf_get_width(ui_render->pixbuf);  
+@@ -834,29 +904,25 @@
+ 
+     color = amitk_color_table_outline_color(ui_render->renderings->rendering->color_table, FALSE);
+     if (ui_render->canvas_time_label != NULL) 
+-      gnome_canvas_item_set(ui_render->canvas_time_label,
++      g_object_set(ui_render->canvas_time_label,
+ 			    "text", time_str,
+-			    "fill_color_rgba", color, NULL);
++			    "fill-color-rgba", color, NULL);
+     else
+       ui_render->canvas_time_label = 
+-	gnome_canvas_item_new(gnome_canvas_root(GNOME_CANVAS(ui_render->canvas)),
+-			      gnome_canvas_text_get_type(),
+-			      "anchor", GTK_ANCHOR_SOUTH_WEST,
+-			      "text", time_str,
+-			      "x", 4.0,
+-			      "y", ui_render->pixbuf_height-2.0,
+-			      "fill_color_rgba", color,
+-			      "font_desc", amitk_fixed_font_desc, NULL);
++        goo_canvas_text_new(root, time_str, 4.0, ui_render->pixbuf_height-2.0,
++                            -1, GOO_CANVAS_ANCHOR_SOUTH_WEST,
++                            "fill-color-rgba", color,
++                            "font-desc", amitk_fixed_font_desc, NULL);
+     g_free(time_str);
+   } else {
+     if (ui_render->canvas_time_label != NULL) {
+-      gtk_object_destroy(GTK_OBJECT(ui_render->canvas_time_label));
++      goo_canvas_item_remove(ui_render->canvas_time_label);
+       ui_render->canvas_time_label = NULL;
+     }
+   }
+ 
+   /* reset the min size of the widget */
+-  gnome_canvas_set_scroll_region(GNOME_CANVAS(ui_render->canvas), 0.0, 0.0, ui_render->pixbuf_width, ui_render->pixbuf_height);
++  goo_canvas_set_bounds(GOO_CANVAS(ui_render->canvas), 0.0, 0.0, ui_render->pixbuf_width, ui_render->pixbuf_height);
+   gtk_widget_set_size_request(ui_render->canvas, ui_render->pixbuf_width, ui_render->pixbuf_height);
+   ui_render->rendered_successfully = TRUE;
+   return_val = FALSE;
+@@ -894,9 +960,11 @@
+ 
+   /* setup the window with a vbox container in it */
+   window = GTK_WINDOW(gtk_window_new(GTK_WINDOW_TOPLEVEL));
++  gtk_application_add_window(GTK_APPLICATION(g_application_get_default()),
++                             GTK_WINDOW(window));
+   gtk_window_set_title(window, _("Rendering Window"));
+   gtk_window_set_resizable(window, FALSE);
+-  window_vbox = gtk_vbox_new(FALSE,0);
++  window_vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
+   gtk_container_add (GTK_CONTAINER (window), window_vbox);
+   ui_render = ui_render_init(window, window_vbox, study, selected_objects, preferences);
+ 
+@@ -916,71 +984,53 @@
+   menus_toolbar_create(ui_render);
+ 
+   /* make the widgets for this dialog box */
+-  packing_table = gtk_table_new(3,3,FALSE);
++  packing_table = gtk_grid_new();
++  gtk_grid_set_row_spacing(GTK_GRID(packing_table), Y_PADDING);
++  gtk_grid_set_column_spacing(GTK_GRID(packing_table), X_PADDING);
+   gtk_box_pack_start (GTK_BOX (ui_render->window_vbox), packing_table, TRUE,TRUE, 0);
+ 
+   /* setup the main canvas */
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+-  ui_render->canvas = gnome_canvas_new_aa();
+-#else
+-  ui_render->canvas = gnome_canvas_new();
+-#endif
+-  gtk_table_attach(GTK_TABLE(packing_table), 
+-		   ui_render->canvas, 1,2,1,2,
+-		   X_PACKING_OPTIONS | GTK_FILL,
+-		   Y_PACKING_OPTIONS | GTK_FILL,
+-		   X_PADDING, Y_PADDING);
+-  g_signal_connect(G_OBJECT(ui_render->canvas), "event",
+-		   G_CALLBACK(canvas_event_cb), ui_render);
++  ui_render->canvas = goo_canvas_new();
++  gtk_grid_attach(GTK_GRID(packing_table), ui_render->canvas, 1, 1, 1, 1);
+   ui_render_update_immediate(ui_render); /* fill in the canvas */
+ 
+   /* create the x, y, and z rotation dials */
+-  hbox = gtk_hbox_new(FALSE, 0);
+-  gtk_table_attach(GTK_TABLE(packing_table), hbox, 1,3,0,1,
+-		   X_PACKING_OPTIONS | GTK_FILL, Y_PACKING_OPTIONS | GTK_FILL, 
+-		   X_PADDING, Y_PADDING);
++  hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
++  gtk_grid_attach(GTK_GRID(packing_table), hbox, 1, 0, 2, 1);
+   adjustment = GTK_ADJUSTMENT(gtk_adjustment_new(0.0, -90.0, 90.0, 1.0, 1.0, 1.0));
+-  scale = gtk_hscale_new(adjustment);
+-  gtk_range_set_update_policy (GTK_RANGE(scale), GTK_UPDATE_DISCONTINUOUS);
++  scale = gtk_scale_new(GTK_ORIENTATION_HORIZONTAL, adjustment);
+   g_object_set_data(G_OBJECT(adjustment), "axis", GINT_TO_POINTER(AMITK_AXIS_Y));
+   gtk_box_pack_start(GTK_BOX(hbox), scale, TRUE, TRUE, 0);
+-  g_signal_connect (G_OBJECT(adjustment), "value_changed", 
+-		    G_CALLBACK(rotate_cb), ui_render);
++  g_signal_connect (scale, "button-release-event",
++                    G_CALLBACK(button_release_cb), ui_render);
+   label = gtk_label_new(_("y"));
+   gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
+ 
+   /* create the z dial */
+-  hbox = gtk_hbox_new(FALSE, 0);
+-  gtk_table_attach(GTK_TABLE(packing_table), hbox, 3,4,0,1,
+-		   X_PACKING_OPTIONS | GTK_FILL, Y_PACKING_OPTIONS | GTK_FILL, 
+-		   X_PADDING, Y_PADDING);
++  hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
++  gtk_grid_attach(GTK_GRID(packing_table), hbox, 3, 0, 1, 1);
+   label = gtk_label_new(_("z"));
+   gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
+   adjustment = GTK_ADJUSTMENT(gtk_adjustment_new(0.0, -180.0, 180.0, 1.0, 1.0, 1.0));
+ 
+   dial = amitk_dial_new(adjustment);
+-  gtk_widget_set_size_request(dial,50,50);
+-  amitk_dial_set_update_policy (AMITK_DIAL(dial), GTK_UPDATE_DISCONTINUOUS);
+   g_object_set_data(G_OBJECT(adjustment), "axis", GINT_TO_POINTER(AMITK_AXIS_Z));
+   gtk_box_pack_start(GTK_BOX(hbox), dial, FALSE, FALSE, 0);
+-  g_signal_connect (G_OBJECT(adjustment), "value_changed", 
+-		    G_CALLBACK(rotate_cb), ui_render);
++  g_signal_connect (dial, "button-release-event",
++                    G_CALLBACK(button_release_cb), ui_render);
+ 
+ 
+   /* the x slider */
+-  vbox = gtk_vbox_new(FALSE, 0);
+-  gtk_table_attach(GTK_TABLE(packing_table), vbox,  3,4,1,2,
+-		   X_PACKING_OPTIONS , Y_PACKING_OPTIONS | GTK_FILL, 
+-		   X_PADDING, Y_PADDING);
++  vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
++  gtk_grid_attach(GTK_GRID(packing_table), vbox, 3, 1, 1, 1);
+   label = gtk_label_new(_("x"));
+   gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 5);
+   adjustment = GTK_ADJUSTMENT(gtk_adjustment_new(0.0, -90.0, 90.0, 1.0, 1.0, 1.0));
+-  scale = gtk_vscale_new(adjustment);
+-  gtk_range_set_update_policy (GTK_RANGE(scale), GTK_UPDATE_DISCONTINUOUS);
++  scale = gtk_scale_new(GTK_ORIENTATION_VERTICAL, adjustment);
+   g_object_set_data(G_OBJECT(adjustment), "axis", GINT_TO_POINTER(AMITK_AXIS_X));
+   gtk_box_pack_start(GTK_BOX(vbox), scale, TRUE, TRUE, 0);
+-  g_signal_connect(G_OBJECT(adjustment), "value_changed", 
+-		   G_CALLBACK(rotate_cb), ui_render);
++  g_signal_connect(scale, "button-release-event",
++                   G_CALLBACK(button_release_cb), ui_render);
+ 
+   /* button to reset the axis */
+   button = gtk_button_new_with_label(_("Reset Axis"));
+@@ -1042,8 +1092,8 @@
+   temp_string = g_strdup_printf(_("%s: Rendering Initialization Dialog"), PACKAGE);
+   dialog = gtk_dialog_new_with_buttons (temp_string,  parent,
+ 					GTK_DIALOG_DESTROY_WITH_PARENT,
+-					GTK_STOCK_CANCEL, GTK_RESPONSE_CLOSE, 
+-					GTK_STOCK_EXECUTE, AMITK_RESPONSE_EXECUTE,
++					_("_Cancel"), GTK_RESPONSE_CLOSE,
++					_("_Execute"), AMITK_RESPONSE_EXECUTE,
+ 					NULL);
+   gtk_window_set_title(GTK_WINDOW(dialog), temp_string);
+   g_free(temp_string);
+@@ -1054,9 +1104,12 @@
+   gtk_container_set_border_width(GTK_CONTAINER(dialog), 10);
+ 
+   /* start making the widgets for this dialog box */
+-  table = gtk_table_new(5,2,FALSE);
++  table = gtk_grid_new();
++  gtk_grid_set_row_spacing(GTK_GRID(table), Y_PADDING);
++  gtk_grid_set_column_spacing(GTK_GRID(table), X_PADDING);
+   table_row=0;
+-  gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), table);
++  gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area
++                                  (GTK_DIALOG(dialog))), table);
+ 
+   tree_view = amitk_tree_view_new(AMITK_TREE_VIEW_MODE_MULTIPLE_SELECTION,NULL, NULL);
+   g_object_set_data(G_OBJECT(dialog), "tree_view", tree_view);
+@@ -1068,33 +1121,28 @@
+   gtk_widget_set_size_request(scrolled,250,250);
+   gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled), 
+ 				 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+-  gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrolled), 
+-					tree_view);
+-  gtk_table_attach(GTK_TABLE(table), scrolled, 0,2,
+-		   table_row, table_row+1,GTK_FILL, GTK_FILL | GTK_EXPAND, X_PADDING, Y_PADDING);
++  gtk_container_add(GTK_CONTAINER(scrolled), tree_view);
++  gtk_grid_attach(GTK_GRID(table), scrolled, 0, table_row, 2, 1);
+   table_row++;
+ 
+   /* do we want to strip values */
+   check_button = gtk_check_button_new_with_label(_("Set values greater than max. threshold to zero?"));
+   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check_button), strip_highs);
+-  gtk_table_attach(GTK_TABLE(table), check_button, 
+-		   0,2, table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), check_button, 0, table_row, 2, 1);
+   g_signal_connect(G_OBJECT(check_button), "toggled", G_CALLBACK(init_strip_highs_cb), dialog);
+   table_row++;
+ 
+   /* do we want to converse memory */
+   check_button = gtk_check_button_new_with_label(_("Accelerate Rendering?  Increases memory use ~3x"));
+   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check_button),optimize_rendering);
+-  gtk_table_attach(GTK_TABLE(table), check_button, 
+-		   0,2, table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), check_button, 0, table_row, 2, 1);
+   g_signal_connect(G_OBJECT(check_button), "toggled", G_CALLBACK(init_optimize_rendering_cb), dialog);
+   table_row++;
+ 
+   /* do we want the initial opacities to be only density dependent */
+   check_button = gtk_check_button_new_with_label(_("Initial opacity functions only density dependent?"));
+   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check_button),initially_no_gradient_opacity);
+-  gtk_table_attach(GTK_TABLE(table), check_button, 
+-		   0,2, table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), check_button, 0, table_row, 2, 1);
+   g_signal_connect(G_OBJECT(check_button), "toggled", G_CALLBACK(init_no_gradient_opacity_cb), dialog);
+   table_row++;
+ 
+--- amide.orig/amide-current/src/ui_render.h
++++ amide/amide-current/src/ui_render.h
+@@ -55,8 +55,8 @@
+   amide_real_t fov;
+   AmitkPoint view_center;
+   GtkWidget * canvas;
+-  GnomeCanvasItem * canvas_image;
+-  GnomeCanvasItem * canvas_time_label;
++  GooCanvasItem * canvas_image;
++  GooCanvasItem * canvas_time_label;
+   gboolean time_label_on;
+   gint pixbuf_width, pixbuf_height;
+   GdkPixbuf * pixbuf;
+@@ -70,6 +70,9 @@
+   gdouble front_factor;
+   gdouble density;
+   gdouble zoom;
++  gdouble x_old;
++  gdouble y_old;
++  gdouble z_old;
+   AmitkSpace * box_space;
+ 
+   guint next_update;
+--- amide.orig/amide-current/src/ui_render_dialog.c
++++ amide/amide-current/src/ui_render_dialog.c
+@@ -32,6 +32,8 @@
+ #include "ui_common.h"
+ #include "ui_render_dialog.h"
+ #include "amitk_color_table_menu.h"
++#include "amitk_curve.h"
++#include "amitk_gamma.h"
+ 
+ 
+ #define GAMMA_CURVE_WIDTH -1 /* sets automatically */
+@@ -155,11 +157,16 @@
+ static void change_eye_width_cb(GtkWidget * widget, gpointer data) {
+ 
+   ui_render_t * ui_render = data;
++  GdkMonitor * monitor;
++  GdkRectangle geom;
+   gdouble temp_val;
+ 
+   temp_val = gtk_spin_button_get_value(GTK_SPIN_BUTTON(widget));
+ 
+-  temp_val = temp_val*gdk_screen_width()/gdk_screen_width_mm();
++  monitor = gdk_display_get_monitor_at_window(gdk_display_get_default(),
++                                              gtk_widget_get_window(widget));
++  gdk_monitor_get_geometry(monitor, &geom);
++  temp_val = temp_val*geom.width/gdk_monitor_get_width_mm(monitor);
+   if (temp_val < 0) /* weird mutants? */
+     return;
+   if (temp_val > 1000) /* just plain wrong? */
+@@ -294,20 +301,20 @@
+ 
+   for (i_classification = 0; i_classification < NUM_CLASSIFICATIONS; i_classification++) {
+     /* figure out the curve type */
+-    switch (GTK_CURVE(GTK_GAMMA_CURVE(gamma_curve[i_classification])->curve)->curve_type) {
+-    case GTK_CURVE_TYPE_SPLINE:
++    switch (AMITK_CURVE(AMITK_GAMMA_CURVE(gamma_curve[i_classification])->curve)->curve_type) {
++    case AMITK_CURVE_TYPE_SPLINE:
+       curve_type = CURVE_SPLINE;
+-      num_points = GTK_CURVE(GTK_GAMMA_CURVE(gamma_curve[i_classification])->curve)->num_ctlpoints; 
++      num_points = AMITK_CURVE(AMITK_GAMMA_CURVE(gamma_curve[i_classification])->curve)->num_ctlpoints;
+       break;
+-    case GTK_CURVE_TYPE_LINEAR:       
++    case AMITK_CURVE_TYPE_LINEAR:
+     default:
+       curve_type = CURVE_LINEAR;
+-      num_points = GTK_CURVE(GTK_GAMMA_CURVE(gamma_curve[i_classification])->curve)->num_ctlpoints; 
++      num_points = AMITK_CURVE(AMITK_GAMMA_CURVE(gamma_curve[i_classification])->curve)->num_ctlpoints;
+       break;
+     }
+ 
+     /* set the ramp table to what's in the curve widget */
+-    gtk_curve_get_vector(GTK_CURVE(GTK_GAMMA_CURVE(gamma_curve[i_classification])->curve), 
++    amitk_curve_get_vector(AMITK_CURVE(AMITK_GAMMA_CURVE(gamma_curve[i_classification])->curve),
+ 			 (i_classification == DENSITY_CLASSIFICATION) ?  RENDERING_DENSITY_MAX:RENDERING_GRADIENT_MAX,
+ 			 (i_classification == DENSITY_CLASSIFICATION) ? rendering->density_ramp : rendering->gradient_ramp);   
+     
+@@ -331,8 +338,8 @@
+     
+     /* copy the new ctrl points */
+     for (i=0;i<rendering->num_points[i_classification];i++) {
+-      rendering->ramp_x[i_classification][i] = GTK_CURVE(GTK_GAMMA_CURVE(gamma_curve[i_classification])->curve)->ctlpoint[i][0];
+-      rendering->ramp_y[i_classification][i] = GTK_CURVE(GTK_GAMMA_CURVE(gamma_curve[i_classification])->curve)->ctlpoint[i][1];
++      rendering->ramp_x[i_classification][i] = AMITK_CURVE(AMITK_GAMMA_CURVE(gamma_curve[i_classification])->curve)->ctlpoint[i][0];
++      rendering->ramp_y[i_classification][i] = AMITK_CURVE(AMITK_GAMMA_CURVE(gamma_curve[i_classification])->curve)->ctlpoint[i][1];
+     }
+ 
+     rendering->need_reclassify = TRUE;
+@@ -412,7 +419,7 @@
+   gfloat (*curve_ctrl_points)[2];
+   guint i;
+ 
+-  curve = GTK_GAMMA_CURVE(gamma_curve)->curve;
++  curve = AMITK_GAMMA_CURVE(gamma_curve)->curve;
+ 
+   /* allocate some memory for the curve we're passing to the curve widget */
+   if ((curve_ctrl_points = g_try_malloc(rendering->num_points[type]*sizeof(gfloat)*2)) == NULL) {
+@@ -426,20 +433,20 @@
+     curve_ctrl_points[i][1]=rendering->ramp_y[type][i];
+   }
+   
+-  GTK_CURVE(curve)->num_ctlpoints =  rendering->num_points[type];
+-  g_free(GTK_CURVE(curve)->ctlpoint);
+-  GTK_CURVE(curve)->ctlpoint = curve_ctrl_points;
++  AMITK_CURVE(curve)->num_ctlpoints = rendering->num_points[type];
++  g_free(AMITK_CURVE(curve)->ctlpoint);
++  AMITK_CURVE(curve)->ctlpoint = curve_ctrl_points;
+   
+   /* doing some hackish stuff to get this to work as I'd like it (i.e. saving state) */
+   switch (rendering->curve_type[type]) {
+   case CURVE_SPLINE:
+-    GTK_CURVE(curve)->curve_type = GTK_CURVE_TYPE_SPLINE;
+-    GTK_TOGGLE_BUTTON(GTK_GAMMA_CURVE(gamma_curve)->button[0])->active=TRUE;
++    AMITK_CURVE(curve)->curve_type = AMITK_CURVE_TYPE_SPLINE;
++    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(AMITK_GAMMA_CURVE(gamma_curve)->button[0]), TRUE);
+     break;
+   case CURVE_LINEAR:
+   default:
+-    GTK_CURVE(curve)->curve_type = GTK_CURVE_TYPE_LINEAR;
+-    GTK_TOGGLE_BUTTON(GTK_GAMMA_CURVE(gamma_curve)->button[1])->active=TRUE;
++    AMITK_CURVE(curve)->curve_type = AMITK_CURVE_TYPE_LINEAR;
++    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(AMITK_GAMMA_CURVE(gamma_curve)->button[1]), TRUE);
+     break;
+   }
+ 
+@@ -457,6 +464,8 @@
+   GtkWidget * check_button;
+   GtkWidget * spin_button;
+   GtkWidget * hseparator;
++  GdkMonitor * monitor;
++  GdkRectangle geom;
+   rendering_quality_t i_quality;
+   guint table_row = 0;
+   
+@@ -465,8 +474,8 @@
+   temp_string = g_strdup_printf(_("%s: Rendering Parameters Dialog"),PACKAGE);
+   dialog = gtk_dialog_new_with_buttons (temp_string,  ui_render->window,
+ 					GTK_DIALOG_DESTROY_WITH_PARENT,
+-					GTK_STOCK_HELP, GTK_RESPONSE_HELP,
+-					GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
++					_("_Help"), GTK_RESPONSE_HELP,
++					_("_Close"), GTK_RESPONSE_CLOSE,
+ 					NULL);
+   g_free(temp_string);
+   ui_render->parameter_dialog = dialog;
+@@ -480,23 +489,23 @@
+ 
+ 
+   /* start making the widgets for this dialog box */
+-  packing_table = gtk_table_new(4,2,FALSE);
++  packing_table = gtk_grid_new();
++  gtk_grid_set_row_spacing(GTK_GRID(packing_table), Y_PADDING);
++  gtk_grid_set_column_spacing(GTK_GRID(packing_table), X_PADDING);
+   table_row=0;
+-  gtk_container_add (GTK_CONTAINER (GTK_DIALOG(dialog)->vbox), packing_table);
++  gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area
++                                    (GTK_DIALOG(dialog))), packing_table);
+ 
+   /* widgets to change the quality versus speed of rendering */
+   label = gtk_label_new(_("Speed versus Quality"));
+-  gtk_table_attach(GTK_TABLE(packing_table), label, 0,1,
+-		   table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), label, 0, table_row, 1, 1);
+ 
+-  menu = gtk_combo_box_new_text();
++  menu = gtk_combo_box_text_new();
+   for (i_quality=0; i_quality<NUM_QUALITIES; i_quality++) 
+-    gtk_combo_box_append_text(GTK_COMBO_BOX(menu), _(rendering_quality_names[i_quality]));
++    gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(menu), _(rendering_quality_names[i_quality]));
+   gtk_combo_box_set_active(GTK_COMBO_BOX(menu), ui_render->quality);
+   g_signal_connect(G_OBJECT(menu), "changed", G_CALLBACK(change_quality_cb), ui_render);
+-  gtk_table_attach(GTK_TABLE(packing_table), menu, 1,2, 
+-		   table_row,table_row+1, GTK_EXPAND | GTK_FILL, 0, 
+-		   X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), menu, 1, table_row, 1, 1);
+   table_row++;
+ 
+ 
+@@ -505,86 +514,78 @@
+   check_button = gtk_check_button_new_with_label (_("update without button release"));
+   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check_button), ui_render->update_without_release);
+   g_signal_connect(G_OBJECT(check_button), "toggled", G_CALLBACK(update_without_release_toggle_cb), ui_render);
+-  gtk_table_attach(GTK_TABLE(packing_table), check_button, 0,2, 
+-		   table_row,table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), check_button, 0, table_row, 2, 1);
+   table_row++;
+ 
+   /* a separator for clarity */
+-  hseparator = gtk_hseparator_new();
+-  gtk_table_attach(GTK_TABLE(packing_table), hseparator,0,2,
+-		   table_row, table_row+1, GTK_FILL, GTK_FILL, X_PADDING, Y_PADDING);
++  hseparator = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
++  gtk_grid_attach(GTK_GRID(packing_table), hseparator, 0, table_row, 2, 1);
+   table_row++;
+ 
+ 
+   /* widget for the stereo eye angle */
+   label = gtk_label_new(_("Stereo Angle"));
+-  gtk_table_attach(GTK_TABLE(packing_table), label, 0,1,
+-		   table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), label, 0, table_row, 1, 1);
+ 
+   spin_button = gtk_spin_button_new_with_range(-90.0, 90.0, 0.2);
+   gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(spin_button), FALSE);
+   gtk_spin_button_set_digits(GTK_SPIN_BUTTON(spin_button), 2);
+   gtk_spin_button_set_value(GTK_SPIN_BUTTON(spin_button), ui_render->stereo_eye_angle);
+   g_signal_connect(G_OBJECT(spin_button), "value_changed", G_CALLBACK(change_eye_angle_cb), ui_render);
+-  gtk_table_attach(GTK_TABLE(packing_table), spin_button,1,2,
+-		   table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), spin_button, 1, table_row, 1, 1);
+   table_row++;
+ 
+   /* widget for the stereo eye width */
+   label = gtk_label_new(_("Eye Width (mm)"));
+-  gtk_table_attach(GTK_TABLE(packing_table), label, 0,1,
+-		   table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), label, 0, table_row, 1, 1);
+ 
+   spin_button = gtk_spin_button_new_with_range(0, G_MAXDOUBLE, 1.0);
+   gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(spin_button), FALSE);
+   gtk_spin_button_set_digits(GTK_SPIN_BUTTON(spin_button), 2);
++  monitor = gdk_display_get_monitor_at_window(gdk_display_get_default(),
++                                              gtk_widget_get_window
++                                              (GTK_WIDGET(ui_render->window)));
++  gdk_monitor_get_geometry(monitor, &geom);
+   gtk_spin_button_set_value(GTK_SPIN_BUTTON(spin_button), 
+-			    gdk_screen_width_mm()*ui_render->stereo_eye_width/
+-			    ((gdouble) gdk_screen_width()));
++			    gdk_monitor_get_width_mm(monitor)*ui_render->stereo_eye_width/
++			    ((gdouble) geom.width));
+   g_signal_connect(G_OBJECT(spin_button), "value_changed", G_CALLBACK(change_eye_width_cb), ui_render);
+-  gtk_table_attach(GTK_TABLE(packing_table), spin_button,1,2,
+-		   table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), spin_button, 1, table_row, 1, 1);
+   table_row++;
+ 
+   /* a separator for clarity */
+-  hseparator = gtk_hseparator_new();
+-  gtk_table_attach(GTK_TABLE(packing_table), hseparator,0,2,
+-		   table_row, table_row+1, GTK_FILL, GTK_FILL, X_PADDING, Y_PADDING);
++  hseparator = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
++  gtk_grid_attach(GTK_GRID(packing_table), hseparator, 0, table_row, 2, 1);
+   table_row++;
+ 
+   /* the depth cueing enabling button */
+   check_button = gtk_check_button_new_with_label (_("enable/disable depth cueing"));
+   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check_button), ui_render->depth_cueing);
+   g_signal_connect(G_OBJECT(check_button), "toggled", G_CALLBACK(depth_cueing_toggle_cb), ui_render);
+-  gtk_table_attach(GTK_TABLE(packing_table), check_button, 0,2, 
+-		   table_row,table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), check_button, 0, table_row, 2, 1);
+   table_row++;
+ 
+ 
+   label = gtk_label_new(_("Front Factor"));
+-  gtk_table_attach(GTK_TABLE(packing_table), label, 0,1,
+-		   table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), label, 0, table_row, 1, 1);
+ 
+   spin_button = gtk_spin_button_new_with_range(-G_MAXDOUBLE, G_MAXDOUBLE, 0.2);
+   gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(spin_button), FALSE);
+   gtk_spin_button_set_digits(GTK_SPIN_BUTTON(spin_button), 2);
+   gtk_spin_button_set_value(GTK_SPIN_BUTTON(spin_button), ui_render->front_factor);
+   g_signal_connect(G_OBJECT(spin_button), "value_changed", G_CALLBACK(change_front_factor_cb), ui_render);
+-  gtk_table_attach(GTK_TABLE(packing_table), spin_button,1,2,
+-		   table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), spin_button, 1, table_row, 1, 1);
+   table_row++;
+ 
+   label = gtk_label_new(_("Density"));
+-  gtk_table_attach(GTK_TABLE(packing_table), label, 0,1,
+-		   table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), label, 0, table_row, 1, 1);
+ 
+   spin_button = gtk_spin_button_new_with_range(-G_MAXDOUBLE, G_MAXDOUBLE, 0.2);
+   gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(spin_button), FALSE);
+   gtk_spin_button_set_digits(GTK_SPIN_BUTTON(spin_button), 2);
+   gtk_spin_button_set_value(GTK_SPIN_BUTTON(spin_button), ui_render->density);
+   g_signal_connect(G_OBJECT(spin_button), "value_changed", G_CALLBACK(change_density_cb), ui_render);
+-  gtk_table_attach(GTK_TABLE(packing_table), spin_button,1,2,
+-		   table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), spin_button, 1, table_row, 1, 1);
+   table_row++;
+ 
+ 
+@@ -618,8 +619,8 @@
+   temp_string = g_strdup_printf(_("%s: Transfer Function Dialog"),PACKAGE);
+   dialog = gtk_dialog_new_with_buttons (temp_string,  ui_render->window,
+ 					GTK_DIALOG_DESTROY_WITH_PARENT,
+-					GTK_STOCK_HELP, GTK_RESPONSE_HELP,
+-					GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
++					_("_Help"), GTK_RESPONSE_HELP,
++					_("_Close"), GTK_RESPONSE_CLOSE,
+ 					NULL);
+   g_free(temp_string);
+   ui_render->transfer_function_dialog = dialog;
+@@ -630,41 +631,40 @@
+ 		   
+ 
+   notebook = gtk_notebook_new();
+-  gtk_container_add (GTK_CONTAINER (GTK_DIALOG(dialog)->vbox), notebook);
++  gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area
++                                    (GTK_DIALOG(dialog))), notebook);
+ 
+ 
+   temp_list = ui_render->renderings;
+   while (temp_list != NULL) {
+-    packing_table = gtk_table_new(4,3,FALSE);
++    packing_table = gtk_grid_new();
++    gtk_grid_set_row_spacing(GTK_GRID(packing_table), Y_PADDING);
++    gtk_grid_set_column_spacing(GTK_GRID(packing_table), X_PADDING);
+     table_row=0;
+     label = gtk_label_new(temp_list->rendering->name);
+     gtk_notebook_append_page(GTK_NOTEBOOK(notebook), packing_table, label);
+ 
+     /* widgets to change the returned pixel type of the rendering */
+     label = gtk_label_new(_("Return Type"));
+-    gtk_table_attach(GTK_TABLE(packing_table), label, 0,1,
+-		   table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(packing_table), label, 0, table_row, 1, 1);
+ 
+-    menu = gtk_combo_box_new_text();
++    menu = gtk_combo_box_text_new();
+     for (i_pixel_type=0; i_pixel_type<NUM_PIXEL_TYPES; i_pixel_type++) 
+-      gtk_combo_box_append_text(GTK_COMBO_BOX(menu), _(pixel_type_names[i_pixel_type]));
++      gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(menu), _(pixel_type_names[i_pixel_type]));
+     g_object_set_data(G_OBJECT(menu), "ui_render", ui_render);
+     gtk_combo_box_set_active(GTK_COMBO_BOX(menu), temp_list->rendering->pixel_type);
+     g_signal_connect(G_OBJECT(menu), "changed", G_CALLBACK(change_pixel_type_cb), temp_list->rendering);
+-    gtk_table_attach(GTK_TABLE(packing_table), menu, 1,2, 
+-		     table_row,table_row+1, GTK_EXPAND | GTK_FILL, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(packing_table), menu, 1, table_row, 1, 1);
+     table_row++;
+ 
+     /* color table selector */
+     label = gtk_label_new(_("color table:"));
+-    gtk_table_attach(GTK_TABLE(packing_table), label, 0,1, table_row,table_row+1,
+-		     X_PACKING_OPTIONS | GTK_FILL, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(packing_table), label, 0, table_row, 1, 1);
+     gtk_widget_show(label);
+ 
+     menu = amitk_color_table_menu_new();
+     g_object_set_data(G_OBJECT(menu), "ui_render", ui_render);
+-    gtk_table_attach(GTK_TABLE(packing_table), menu, 1,2, table_row,table_row+1,
+-		     X_PACKING_OPTIONS | GTK_FILL, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(packing_table), menu, 1, table_row, 1, 1);
+     gtk_combo_box_set_active(GTK_COMBO_BOX(menu),temp_list->rendering->color_table);
+     g_signal_connect(G_OBJECT(menu), "changed", G_CALLBACK(color_table_cb), 
+ 		     temp_list->rendering);
+@@ -674,9 +674,8 @@
+ 
+ 
+     /* a separator for clarity */
+-    hseparator = gtk_hseparator_new();
+-    gtk_table_attach(GTK_TABLE(packing_table), hseparator,0,2,
+-		     table_row, table_row+1, GTK_FILL, GTK_FILL, X_PADDING, Y_PADDING);
++    hseparator = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
++    gtk_grid_attach(GTK_GRID(packing_table), hseparator, 0, table_row, 2, 1);
+     table_row++;
+ 
+     /* widgets for changing the density and gradient classification parameters */
+@@ -686,24 +685,19 @@
+ 	label = gtk_label_new(_("Density\nDependent\nOpacity"));
+       else /* gradient classification*/
+ 	label = gtk_label_new(_("Gradient\nDependent\nOpacity"));
+-      gtk_table_attach(GTK_TABLE(packing_table), label, 0,1,
+-		       table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++      gtk_grid_attach(GTK_GRID(packing_table), label, 0, table_row, 1, 1);
+   
+-      gamma_curve[i_classification] = gtk_gamma_curve_new();
++      gamma_curve[i_classification] = amitk_gamma_curve_new();
+       gtk_widget_set_size_request(gamma_curve[i_classification], GAMMA_CURVE_WIDTH, GAMMA_CURVE_HEIGHT);
+-      gtk_curve_set_range(GTK_CURVE(GTK_GAMMA_CURVE(gamma_curve[i_classification])->curve), 0.0, 
++      amitk_curve_set_range(AMITK_CURVE(AMITK_GAMMA_CURVE(gamma_curve[i_classification])->curve), 0.0,
+ 			  (i_classification == DENSITY_CLASSIFICATION) ? RENDERING_DENSITY_MAX: RENDERING_GRADIENT_MAX, 
+ 			  0.0, 1.0);
+ 
+       setup_curve(gamma_curve[i_classification], temp_list->rendering, i_classification);
+-      /* disable the gamma button and free drawing button */
+-      gtk_widget_destroy(GTK_GAMMA_CURVE(gamma_curve[i_classification])->button[3]);
+-      gtk_widget_destroy(GTK_GAMMA_CURVE(gamma_curve[i_classification])->button[2]);
+     
+       /* and attach */
+-      gtk_table_attach(GTK_TABLE(packing_table), gamma_curve[i_classification], 1,3,
+-		       table_row, table_row+1,
+-		       GTK_EXPAND | GTK_FILL, GTK_FILL, X_PADDING, Y_PADDING);
++      gtk_grid_attach(GTK_GRID(packing_table), gamma_curve[i_classification],
++                      1, table_row, 1, 1);
+       table_row++;
+     }
+ 
+@@ -714,8 +708,7 @@
+     g_object_set_data(G_OBJECT(button), "gamma_curve_gradient", gamma_curve[GRADIENT_CLASSIFICATION]);
+     g_object_set_data(G_OBJECT(button), "ui_render", ui_render);
+     /* and attach */
+-    gtk_table_attach(GTK_TABLE(packing_table), button, 1,3, table_row, table_row+1, 
+-		     GTK_EXPAND | GTK_FILL, GTK_FILL, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(packing_table), button, 1, table_row, 2, 1);
+     gtk_widget_show(button);
+     table_row++;
+     g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(change_opacity_cb), 
+--- amide.orig/amide-current/src/ui_render_movie.c
++++ amide/amide-current/src/ui_render_movie.c
+@@ -236,8 +236,8 @@
+     file_chooser = gtk_file_chooser_dialog_new(_("Output MPEG As"),
+ 					       GTK_WINDOW(dialog), /* parent window */
+ 					       GTK_FILE_CHOOSER_ACTION_SAVE,
+-					       GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+-					       GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
++					       _("_Cancel"), GTK_RESPONSE_CANCEL,
++					       _("_Save"), GTK_RESPONSE_ACCEPT,
+ 					       NULL);
+     gtk_file_chooser_set_local_only(GTK_FILE_CHOOSER(file_chooser), TRUE);
+     gtk_file_chooser_set_do_overwrite_confirmation(GTK_FILE_CHOOSER (file_chooser), TRUE);
+@@ -622,8 +622,8 @@
+   ui_render_movie->dialog = 
+     gtk_dialog_new_with_buttons(temp_string, ui_render->window,
+ 				GTK_DIALOG_DESTROY_WITH_PARENT,
+-				GTK_STOCK_HELP, GTK_RESPONSE_HELP,				
+-				GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
++				_("_Help"), GTK_RESPONSE_HELP,
++				_("_Cancel"), GTK_RESPONSE_CANCEL,
+ 				_("_Generate Movie"), AMITK_RESPONSE_EXECUTE,
+ 				NULL);
+   g_free(temp_string);
+@@ -641,14 +641,17 @@
+ 
+ 
+   /* start making the widgets for this dialog box */
+-  packing_table = gtk_table_new(5,3,FALSE);
++  packing_table = gtk_grid_new();
++  gtk_grid_set_row_spacing(GTK_GRID(packing_table), Y_PADDING);
++  gtk_grid_set_column_spacing(GTK_GRID(packing_table), X_PADDING);
+   table_row=0;
+-  gtk_container_add (GTK_CONTAINER (GTK_DIALOG(ui_render_movie->dialog)->vbox), packing_table);
++  gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area
++                                    (GTK_DIALOG(ui_render_movie->dialog))),
++                     packing_table);
+ 
+   /* widgets to specify how many frames */
+   label = gtk_label_new(_("Movie Duration (sec)"));
+-  gtk_table_attach(GTK_TABLE(packing_table), label, 0,1,
+-		   table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), label, 0, table_row, 1, 1);
+   ui_render_movie->duration_spin_button  = 
+     gtk_spin_button_new_with_range(0, G_MAXDOUBLE, 1.0);
+   gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(ui_render_movie->duration_spin_button), FALSE);
+@@ -658,14 +661,14 @@
+ 		   G_CALLBACK(change_frames_cb),  ui_render_movie);
+   g_signal_connect(G_OBJECT(ui_render_movie->duration_spin_button), "output",
+ 		   G_CALLBACK(amitk_spin_button_scientific_output), NULL);
+-  gtk_table_attach(GTK_TABLE(packing_table), ui_render_movie->duration_spin_button,1,2,
+-		   table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table),
++                  ui_render_movie->duration_spin_button,
++                  1, table_row, 1, 1);
+   table_row++;
+ 
+   /* a separator for clarity */
+-  hseparator = gtk_hseparator_new();
+-  gtk_table_attach(GTK_TABLE(packing_table), hseparator, 0,3,
+-		   table_row, table_row+1,GTK_FILL, 0, X_PADDING, Y_PADDING);
++  hseparator = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
++  gtk_grid_attach(GTK_GRID(packing_table), hseparator, 0, table_row, 3, 1);
+   table_row++;
+ 
+   /* widgets to specify number of rotations on the axis */
+@@ -674,8 +677,7 @@
+     temp_string = g_strdup_printf(_("Rotations on %s"), amitk_axis_get_name(i_axis));
+     label = gtk_label_new(temp_string);
+     g_free(temp_string);
+-    gtk_table_attach(GTK_TABLE(packing_table), label, 0,1,
+-		     table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(packing_table), label, 0, table_row, 1, 1);
+ 
+     ui_render_movie->axis_spin_button[i_axis] = 
+       gtk_spin_button_new_with_range(-G_MAXDOUBLE, G_MAXDOUBLE, 1.0);
+@@ -687,25 +689,23 @@
+ 		      "which_entry", GINT_TO_POINTER(i_axis));
+     g_signal_connect(G_OBJECT(ui_render_movie->axis_spin_button[i_axis]), 
+ 		     "value_changed", G_CALLBACK(change_rotation_cb), ui_render_movie);
+-    gtk_table_attach(GTK_TABLE(packing_table), ui_render_movie->axis_spin_button[i_axis],1,2,
+-		     table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(packing_table),
++                    ui_render_movie->axis_spin_button[i_axis],
++                    1, table_row, 1, 1);
+     table_row++;
+   }
+ 
+   /* a separator for clarity */
+-  hseparator = gtk_hseparator_new();
+-  gtk_table_attach(GTK_TABLE(packing_table), hseparator, 0,3,
+-		   table_row, table_row+1,GTK_FILL, 0, X_PADDING, Y_PADDING);
++  hseparator = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
++  gtk_grid_attach(GTK_GRID(packing_table), hseparator, 0, table_row, 3, 1);
+   table_row++;
+ 
+   /* do we want to make a movie over time or over frames */
+   label = gtk_label_new(_("Dynamic Movie:"));
+-  gtk_table_attach(GTK_TABLE(packing_table), label, 0,1,
+-		   table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), label, 0, table_row, 1, 1);
+ 
+-  hbox = gtk_hbox_new(FALSE, 0);
+-  gtk_table_attach(GTK_TABLE(packing_table), hbox,1,2,
+-		   table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++  hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
++  gtk_grid_attach(GTK_GRID(packing_table), hbox, 1, table_row, 1, 1);
+   gtk_widget_show(hbox);
+   table_row++;
+ 
+@@ -723,9 +723,8 @@
+   gtk_box_pack_start(GTK_BOX(hbox), radio_button3, FALSE, FALSE, 3);
+   g_object_set_data(G_OBJECT(radio_button3), "dynamic_type", GINT_TO_POINTER(OVER_FRAMES));
+ 
+-  hbox = gtk_hbox_new(FALSE, 0);
+-  gtk_table_attach(GTK_TABLE(packing_table), hbox,1,2,
+-		   table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++  hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
++  gtk_grid_attach(GTK_GRID(packing_table), hbox, 1, table_row, 1, 1);
+   gtk_widget_show(hbox);
+   table_row++;
+ 
+@@ -746,11 +745,11 @@
+ 
+   /* widgets to specify the start and end times */
+   ui_render_movie->start_time_label = gtk_label_new(_("Start Time (s)"));
+-  gtk_table_attach(GTK_TABLE(packing_table), ui_render_movie->start_time_label, 0,1,
+-		   table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), ui_render_movie->start_time_label,
++                  0, table_row, 1, 1);
+   ui_render_movie->start_frame_label = gtk_label_new(_("Start Frame"));
+-  gtk_table_attach(GTK_TABLE(packing_table), ui_render_movie->start_frame_label, 0,1,
+-		   table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), ui_render_movie->start_frame_label,
++                  0, table_row, 1, 1);
+ 
+   ui_render_movie->start_time_spin_button = 
+     gtk_spin_button_new_with_range(ui_render_movie->start_time, ui_render_movie->end_time, 1.0);
+@@ -761,8 +760,9 @@
+ 		   G_CALLBACK(change_start_time_cb), ui_render_movie);
+   g_signal_connect(G_OBJECT(ui_render_movie->start_time_spin_button), "output",
+ 		   G_CALLBACK(amitk_spin_button_scientific_output), NULL);
+-  gtk_table_attach(GTK_TABLE(packing_table), ui_render_movie->start_time_spin_button,1,2,
+-		   table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table),
++                  ui_render_movie->start_time_spin_button,
++                  1, table_row, 1, 1);
+ 
+   ui_render_movie->start_frame_spin_button =
+     gtk_spin_button_new_with_range(ui_render_movie->start_frame,ui_render_movie->end_frame+0.1, 1.0);
+@@ -771,16 +771,18 @@
+ 			    ui_render_movie->start_frame);
+   g_signal_connect(G_OBJECT(ui_render_movie->start_frame_spin_button), "value_changed", 
+ 		   G_CALLBACK(change_start_frame_cb), ui_render_movie);
+-  gtk_table_attach(GTK_TABLE(packing_table), ui_render_movie->start_frame_spin_button,1,2,
+-		   table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table),
++                  ui_render_movie->start_frame_spin_button,
++                  1, table_row, 1, 1);
+   table_row++;
+ 
+   ui_render_movie->end_time_label = gtk_label_new(_("End Time (s)"));
+-  gtk_table_attach(GTK_TABLE(packing_table), ui_render_movie->end_time_label, 0,1,
+-		   table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), ui_render_movie->end_time_label,
++
++                  0, table_row, 1, 1);
+   ui_render_movie->end_frame_label = gtk_label_new(_("End Frame"));
+-  gtk_table_attach(GTK_TABLE(packing_table), ui_render_movie->end_frame_label, 0,1,
+-		   table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), ui_render_movie->end_frame_label,
++                  0, table_row, 1, 1);
+ 
+ 
+   ui_render_movie->end_time_spin_button =
+@@ -792,8 +794,9 @@
+ 		   G_CALLBACK(change_end_time_cb), ui_render_movie);
+   g_signal_connect(G_OBJECT(ui_render_movie->end_time_spin_button), "output",
+ 		   G_CALLBACK(amitk_spin_button_scientific_output), NULL);
+-  gtk_table_attach(GTK_TABLE(packing_table), ui_render_movie->end_time_spin_button,1,2,
+-		   table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table),
++                  ui_render_movie->end_time_spin_button,
++                  1, table_row, 1, 1);
+ 
+   ui_render_movie->end_frame_spin_button =
+     gtk_spin_button_new_with_range(ui_render_movie->start_frame,ui_render_movie->end_frame+0.1, 1.0);
+@@ -802,21 +805,23 @@
+ 			    ui_render_movie->end_frame);
+   g_signal_connect(G_OBJECT(ui_render_movie->end_frame_spin_button), "value_changed", 
+ 		   G_CALLBACK(change_end_frame_cb), ui_render_movie);
+-  gtk_table_attach(GTK_TABLE(packing_table), ui_render_movie->end_frame_spin_button,1,2,
+-		   table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table),
++                  ui_render_movie->end_frame_spin_button,
++                  1, table_row, 1, 1);
+   table_row++;
+ 
+ 
+   ui_render_movie->time_on_image_label = gtk_label_new(_("Display time on image"));
+-  gtk_table_attach(GTK_TABLE(packing_table), ui_render_movie->time_on_image_label, 0,1,
+-		   table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), ui_render_movie->time_on_image_label,
++                  0, table_row, 1, 1);
+   ui_render_movie->time_on_image_button = gtk_check_button_new();
+   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ui_render_movie->time_on_image_button), 
+ 			       ui_render_movie->ui_render->time_label_on);
+   g_signal_connect(G_OBJECT(ui_render_movie->time_on_image_button), "toggled", 
+ 		   G_CALLBACK(time_label_on_cb), ui_render_movie);
+-  gtk_table_attach(GTK_TABLE(packing_table), ui_render_movie->time_on_image_button,1,2,
+-		   table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table),
++                  ui_render_movie->time_on_image_button,
++                  1, table_row, 1, 1);
+   table_row++;
+ 
+   /* progress dialog */
+--- amide.orig/amide-current/src/ui_series.c
++++ amide/amide-current/src/ui_series.c
+@@ -72,8 +72,8 @@
+   GtkWidget * canvas;
+   gint canvas_height;
+   gint canvas_width;
+-  GnomeCanvasItem ** images;
+-  GnomeCanvasItem ** captions;
++  GooCanvasItem ** images;
++  GooCanvasItem ** captions;
+   GList ** items;
+   GtkWidget * thresholds_dialog;
+   guint num_slices, rows, columns;
+@@ -87,12 +87,7 @@
+   gboolean in_generation;
+   gboolean quit_generation;
+   gint roi_width;
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+   gdouble roi_transparency;
+-#else
+-  GdkLineStyle line_style;
+-  gboolean fill_roi;
+-#endif
+   gint pixbuf_width;
+   gint pixbuf_height;
+ 
+@@ -119,14 +114,15 @@
+ 
+ 
+ 
++static gboolean button_release_cb(GtkWidget * widget, GdkEvent * event, gpointer data);
+ static void scroll_change_cb(GtkAdjustment* adjustment, gpointer data);
+ static void canvas_size_change_cb(GtkWidget * widget, GtkAllocation * allocation, gpointer ui_series);
+-static void export_cb(GtkAction * action, gpointer data);
++static void export_cb(GSimpleAction * action, GVariant * param, gpointer data);
+ static void changed_cb(gpointer dummy, gpointer ui_series);
+ static void color_table_changed_cb(gpointer dummy, AmitkViewMode view_mode, gpointer ui_series);
+ static void data_set_invalidate_slice_cache(AmitkDataSet *ds, gpointer ui_series);
+-static void threshold_cb(GtkAction * action, gpointer data);
+-static void close_cb(GtkAction * action, gpointer data);
++static void threshold_cb(GSimpleAction * action, GVariant * param, gpointer data);
++static void close_cb(GSimpleAction * action, GVariant * param, gpointer data);
+ static gboolean delete_event_cb(GtkWidget* widget, GdkEvent * event, gpointer data);
+ 
+ 
+@@ -139,6 +135,17 @@
+ static gboolean update_immediate(gpointer ui_series);
+ static void read_series_preferences(series_type_t * series_type, AmitkView * view);
+ 
++/* Compensate the lack of GTK_UPDATE_DISCONTINUOUS in GTK 3.  */
++static gboolean button_release_cb(GtkWidget * widget, GdkEvent * event, gpointer data) {
++
++  ui_series_t * ui_series = data;
++  GtkAdjustment * adjustment;
++
++  adjustment = gtk_range_get_adjustment(GTK_RANGE(widget));
++  scroll_change_cb(adjustment, ui_series);
++
++  return FALSE;
++}
+ 
+ /* function called by the adjustment in charge for scrolling */
+ static void scroll_change_cb(GtkAdjustment* adjustment, gpointer data) {
+@@ -147,14 +154,14 @@
+ 
+   switch(ui_series->series_type) {
+   case OVER_GATES:
+-    ui_series->view_gate = adjustment->value;
++    ui_series->view_gate = gtk_adjustment_get_value(adjustment);
+     break;
+   case OVER_FRAMES:
+-    ui_series->view_frame = adjustment->value;
++    ui_series->view_frame = gtk_adjustment_get_value(adjustment);
+     break;
+   case OVER_SPACE:
+   default:
+-    ui_series->z_point = adjustment->value-AMITK_VOLUME_Z_CORNER(ui_series->volume)/2.0;
++    ui_series->z_point = gtk_adjustment_get_value(adjustment)-AMITK_VOLUME_Z_CORNER(ui_series->volume)/2.0;
+     break;
+   }
+   add_update(ui_series);
+@@ -176,7 +183,7 @@
+ 
+ 
+ /* function to save the series as an image */
+-static void export_cb(GtkAction * action, gpointer data) {
++static void export_cb(GSimpleAction * action, GVariant * param, gpointer data) {
+   
+   ui_series_t * ui_series = data;
+   GList * objects;
+@@ -188,8 +195,8 @@
+   file_chooser = gtk_file_chooser_dialog_new(_("Export to Image"),
+ 					     GTK_WINDOW(ui_series->window), /* parent window */
+ 					     GTK_FILE_CHOOSER_ACTION_SAVE,
+-					     GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+-					     GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
++					     _("_Cancel"), GTK_RESPONSE_CANCEL,
++					     _("_Save"), GTK_RESPONSE_ACCEPT,
+ 					     NULL);
+   gtk_file_chooser_set_local_only(GTK_FILE_CHOOSER(file_chooser), TRUE);
+   gtk_file_chooser_set_do_overwrite_confirmation(GTK_FILE_CHOOSER(file_chooser), TRUE);
+@@ -246,7 +253,7 @@
+ 
+   if (filename == NULL) return; /* inappropriate name or don't want to overwrite */
+ 
+-  pixbuf = amitk_get_pixbuf_from_canvas(GNOME_CANVAS(ui_series->canvas),0,0,
++  pixbuf = amitk_get_pixbuf_from_canvas(GOO_CANVAS(ui_series->canvas),0,0,
+ 					ui_series->columns*(ui_series->pixbuf_width+UI_SERIES_R_MARGIN+UI_SERIES_L_MARGIN),
+ 					ui_series->rows*(ui_series->pixbuf_height+UI_SERIES_TOP_MARGIN+UI_SERIES_BOTTOM_MARGIN));
+ 
+@@ -302,7 +309,7 @@
+ }
+ 
+ /* function called when we hit the threshold button */
+-static void threshold_cb(GtkAction * action, gpointer data) {
++static void threshold_cb(GSimpleAction * action, GVariant * param, gpointer data) {
+ 
+   ui_series_t * ui_series = data;
+ 
+@@ -330,7 +337,7 @@
+ 
+ 
+ /* function ran when closing a series window */
+-static void close_cb(GtkAction * action, gpointer data) {
++static void close_cb(GSimpleAction * action, GVariant * param, gpointer data) {
+ 
+   ui_series_t * ui_series = data;
+   GtkWindow * window = ui_series->window;
+@@ -368,74 +375,69 @@
+ 
+ 
+ 
+-static const GtkActionEntry normal_items[] = {
+-  /* Toplevel */
+-  { "FileMenu", NULL, N_("_File") },
+-  { "HelpMenu", NULL, N_("_Help") },
+-  
+-  /* File menu */
+-  { "ExportSeries", NULL, N_("_Export Series"), NULL, N_("Export the series to a JPEG image file"), G_CALLBACK(export_cb)},
+-  { "Close", GTK_STOCK_CLOSE, NULL, "<control>W", N_("Close the series dialog"), G_CALLBACK (close_cb)},
+-  
+-  /* Toolbar items */
+-  { "Threshold", "amide_icon_thresholding", N_("Threshold"), NULL, N_("Set the thresholds and colormaps for the data sets in the series view"), G_CALLBACK(threshold_cb)}
++static const GActionEntry normal_items[] = {
++  { "export", export_cb },
++  { "close", close_cb },
++  { "threshold", threshold_cb }
+ };
+ 
+-static const char *ui_description =
+-"<ui>"
+-"  <menubar name='MainMenu'>"
+-"    <menu action='FileMenu'>"
+-"      <menuitem action='ExportSeries'/>"
+-"      <separator/>"
+-"      <menuitem action='Close'/>"
+-"    </menu>"
+-HELP_MENU_UI_DESCRIPTION
+-"  </menubar>"
+-"  <toolbar name='ToolBar'>"
+-"    <toolitem action='Threshold'/>"
+-"  </toolbar>"
+-"</ui>";
+ 
+ /* function to setup the menus for the series ui */
+ static void menus_toolbar_create(ui_series_t * ui_series) {
+ 
++  GtkApplication *app;
+   GtkWidget *menubar;
+   GtkWidget *toolbar;
+-  GtkActionGroup *action_group;
+-  GtkUIManager *ui_manager;
+-  GtkAccelGroup *accel_group;
+-  GError *error;
++  GtkWidget *icon;
++  GtkBuilder *builder;
++  GtkToolItem *tool_item;
++  GSimpleActionGroup *action_group;
++  GMenuModel *model;
++  GMenu *menu;
++  const gchar *close[] = { "<Control>w", NULL };
++  const gchar *help[] = { "F1", NULL };
+       
+   /* sanity check */
+   g_assert(ui_series!=NULL);
+ 
+   /* create an action group with all the menu actions */
+-  action_group = gtk_action_group_new ("MenuActions");
+-  gtk_action_group_set_translation_domain(action_group, GETTEXT_PACKAGE);
+-  gtk_action_group_add_actions(action_group, normal_items, G_N_ELEMENTS(normal_items),ui_series);
+-  gtk_action_group_add_actions(action_group, ui_common_help_menu_items, G_N_ELEMENTS(ui_common_help_menu_items),ui_series);
+-
+-  /* create the ui manager, and add the actions and accel's */
+-  ui_manager = gtk_ui_manager_new ();
+-  gtk_ui_manager_insert_action_group (ui_manager, action_group, 0);
+-  accel_group = gtk_ui_manager_get_accel_group (ui_manager);
+-  gtk_window_add_accel_group (ui_series->window, accel_group);
++  app = gtk_window_get_application(ui_series->window);
++  action_group = g_simple_action_group_new ();
++  g_action_map_add_action_entries(G_ACTION_MAP(action_group),
++                                  normal_items, G_N_ELEMENTS(normal_items),
++                                  ui_series);
++  g_action_map_add_action_entries(G_ACTION_MAP(app), ui_common_help_menu_items,
++                                  G_N_ELEMENTS(ui_common_help_menu_items),
++                                  ui_series);
++  gtk_widget_insert_action_group(ui_series->window_vbox, "series",
++                                 G_ACTION_GROUP(action_group));
++
++  gtk_application_set_accels_for_action(app, "series.close", close);
++  gtk_application_set_accels_for_action(app, "app.manual", help);
+ 
+   /* create the actual menu/toolbar ui */
+-  error = NULL;
+-  if (!gtk_ui_manager_add_ui_from_string (ui_manager, ui_description, -1, &error)) {
+-    g_warning ("%s: building menus failed in %s: %s", PACKAGE, __FILE__, error->message);
+-    g_error_free (error);
+-    return;
+-  }
++  builder = gtk_builder_new_from_resource("/com/github/ferdymercury/amide/series.ui");
++  gtk_builder_set_translation_domain(builder, GETTEXT_PACKAGE);
+ 
+   /* pack in the menu and toolbar */
+-  menubar = gtk_ui_manager_get_widget (ui_manager, "/MainMenu");
++  model = G_MENU_MODEL (gtk_builder_get_object (builder, "menubar"));
++  menu = gtk_application_get_menu_by_id (app, "help");
++  g_menu_append_submenu (G_MENU (model), _("_Help"), G_MENU_MODEL (menu));
++  menubar = gtk_menu_bar_new_from_model (model);
++  g_object_unref (builder);
+   gtk_box_pack_start (GTK_BOX (ui_series->window_vbox), menubar, FALSE, FALSE, 0);
+ 
+-  toolbar = gtk_ui_manager_get_widget (ui_manager, "/ToolBar");
++  toolbar = gtk_toolbar_new ();
+   gtk_box_pack_start (GTK_BOX (ui_series->window_vbox), toolbar, FALSE, FALSE, 0);
+   gtk_toolbar_set_style(GTK_TOOLBAR(toolbar), GTK_TOOLBAR_ICONS);
++
++  icon = gtk_image_new_from_icon_name("amide_icon_thresholding",
++                                      GTK_ICON_SIZE_LARGE_TOOLBAR);
++  tool_item = gtk_tool_button_new(icon, _("Threshold"));
++  gtk_tool_item_set_tooltip_text(tool_item,
++                                 _("Set the thresholds and colormaps for the data sets in the series view"));
++  gtk_actionable_set_action_name(GTK_ACTIONABLE(tool_item), "series.threshold");
++  gtk_toolbar_insert(GTK_TOOLBAR(toolbar), tool_item, -1);
+ 			      
+   return;
+ 
+@@ -589,12 +591,7 @@
+   ui_series->in_generation=FALSE;
+   ui_series->quit_generation=FALSE;
+   ui_series->roi_width = 1.0;
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+   ui_series->roi_transparency = 0.5;
+-#else
+-  ui_series->line_style = 0;
+-  ui_series->fill_roi = TRUE;
+-#endif
+   ui_series->pixbuf_width = 0;
+   ui_series->pixbuf_height = 0;
+ 
+@@ -621,7 +618,7 @@
+ static GtkAdjustment * ui_series_create_scroll_adjustment(ui_series_t * ui_series) { 
+ 
+   amide_real_t thickness;
+-  GtkObject * adjustment;
++  GtkAdjustment * adjustment;
+ 
+   switch(ui_series->series_type) {
+   case OVER_GATES:
+@@ -674,7 +671,8 @@
+   gboolean can_continue=TRUE;
+   gboolean return_val = TRUE;
+   GList * objects;
+-  GnomeCanvasItem * item;
++  GooCanvasItem * item;
++  GooCanvasItem * root;
+   rgba_t outline_color;
+   gint rows, columns;
+ 
+@@ -686,18 +684,18 @@
+ 
+   /* allocate space for the following if this is the first time through */
+   if (ui_series->images == NULL) {
+-    if ((ui_series->images = g_try_new(GnomeCanvasItem *,ui_series->num_slices)) == NULL) {
+-      g_warning(_("couldn't allocate memory space for pointers to image GnomeCanvasItem's"));
++    if ((ui_series->images = g_try_new(GooCanvasItem *,ui_series->num_slices)) == NULL) {
++      g_warning(_("couldn't allocate memory space for pointers to image GooCanvasItem's"));
+       return_val = FALSE;
+       goto exit_update;
+     }
+-    if ((ui_series->captions = g_try_new(GnomeCanvasItem *,ui_series->num_slices)) == NULL) {
+-      g_warning(_("couldn't allocate memory space for pointers to caption GnomeCanvasItem's"));
++    if ((ui_series->captions = g_try_new(GooCanvasItem *,ui_series->num_slices)) == NULL) {
++      g_warning(_("couldn't allocate memory space for pointers to caption GooCanvasItem's"));
+       return_val = FALSE;
+       goto exit_update;
+     }
+     if ((ui_series->items = g_try_new(GList *,ui_series->num_slices)) == NULL) {
+-      g_warning(_("couldn't allocate memory space for pointers to GnomeCanavasItem lists"));
++      g_warning(_("couldn't allocate memory space for pointers to GooCanavasItem lists"));
+       return_val = FALSE;
+       goto exit_update;
+     }
+@@ -729,24 +727,24 @@
+ 
+     for (i=0; i < ui_series->num_slices ; i++) {
+       if (ui_series->images[i] != NULL) {
+-	gtk_object_destroy(GTK_OBJECT(ui_series->images[i]));
++	goo_canvas_item_remove(ui_series->images[i]);
+ 	ui_series->images[i] = NULL;
+       }
+       if (ui_series->captions[i] != NULL) {
+-	gtk_object_destroy(GTK_OBJECT(ui_series->captions[i]));
++	goo_canvas_item_remove(ui_series->captions[i]);
+ 	ui_series->captions[i] = NULL;
+       }
+       if (ui_series->items[i] != NULL) {
+ 	while (ui_series->items[i] != NULL) { 
+ 	  item = ui_series->items[i]->data;
+ 	  ui_series->items[i] = g_list_remove(ui_series->items[i], item);
+-	  gtk_object_destroy(GTK_OBJECT(item));
++	  goo_canvas_item_remove(item);
+ 	}
+ 	ui_series->items[i] = NULL;
+       }
+     }
+ 
+-    gnome_canvas_set_scroll_region(GNOME_CANVAS(ui_series->canvas), 0.0, 0.0, 
++    goo_canvas_set_bounds(GOO_CANVAS(ui_series->canvas), 0.0, 0.0,
+ 				   (double) (ui_series->columns*image_width), 
+ 				   (double) (ui_series->rows*image_height));
+   }
+@@ -822,6 +820,7 @@
+     y = floor((i-start_i)/ui_series->columns)*image_height;
+     x = (i-start_i-ui_series->columns*floor((i-start_i)/ui_series->columns))*image_width;
+ 
++    root = goo_canvas_get_root_item(GOO_CANVAS(ui_series->canvas));
+     if (amitk_objects_has_type(ui_series->objects, AMITK_OBJECT_TYPE_DATA_SET, FALSE)) {
+       pixbuf = image_from_data_sets(NULL,
+ 				    &(ui_series->slice_cache),
+@@ -838,14 +837,10 @@
+     
+       if (ui_series->images[i-start_i] == NULL) 
+ 	ui_series->images[i-start_i] = 
+-	  gnome_canvas_item_new(gnome_canvas_root(GNOME_CANVAS(ui_series->canvas)),
+-				gnome_canvas_pixbuf_get_type(),
+-				"pixbuf", pixbuf,
+-				"x", x+UI_SERIES_L_MARGIN,
+-				"y", y+UI_SERIES_TOP_MARGIN,
+-				NULL);
++          goo_canvas_image_new(root, pixbuf, x+UI_SERIES_L_MARGIN,
++                               y+UI_SERIES_TOP_MARGIN, NULL);
+       else
+-	gnome_canvas_item_set(ui_series->images[i-start_i], "pixbuf", pixbuf, NULL);
++	g_object_set(ui_series->images[i-start_i], "pixbuf", pixbuf, NULL);
+       g_object_unref(pixbuf);
+     }
+ 
+@@ -853,7 +848,7 @@
+     while (ui_series->items[i-start_i] != NULL) { /* first, delete the old objects */
+       item = ui_series->items[i-start_i]->data;
+       ui_series->items[i-start_i] = g_list_remove(ui_series->items[i-start_i], item);
+-      gtk_object_destroy(GTK_OBJECT(item));
++      goo_canvas_item_remove(item);
+     }
+ 
+     /* add the new item to the canvas */
+@@ -866,7 +861,7 @@
+ 	else
+ 	  outline_color = amitk_color_table_outline_color(AMITK_COLOR_TABLE_BW_LINEAR, TRUE);
+ 
+-	item = amitk_canvas_object_draw(GNOME_CANVAS(ui_series->canvas), 
++	item = amitk_canvas_object_draw(GOO_CANVAS(ui_series->canvas),
+ 					view_volume, objects->data,
+ 					AMITK_VIEW_MODE_SINGLE, NULL,
+ 					ui_series->pixel_dim,
+@@ -875,12 +870,7 @@
+ 					x+UI_SERIES_L_MARGIN, y+UI_SERIES_TOP_MARGIN,
+ 					outline_color, 
+ 					ui_series->roi_width,
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+ 					ui_series->roi_transparency
+-#else
+-					ui_series->line_style,
+-					ui_series->fill_roi
+-#endif
+ 					);
+ 	if (item != NULL)
+ 	  ui_series->items[i-start_i] = g_list_append(ui_series->items[i-start_i], item);
+@@ -905,18 +895,13 @@
+ 
+     if (ui_series->captions[i-start_i] == NULL) 
+       ui_series->captions[i-start_i] =
+-	gnome_canvas_item_new(gnome_canvas_root(GNOME_CANVAS(ui_series->canvas)),
+-			      gnome_canvas_text_get_type(),
+-			      "justification", GTK_JUSTIFY_LEFT,
+-			      "anchor", GTK_ANCHOR_NORTH_WEST,
+-			      "text", temp_string,
+-			      "x", x+UI_SERIES_L_MARGIN,
+-			      "y", y+image_height-UI_SERIES_BOTTOM_MARGIN,
+-			      "fill_color", "black", 
+-			      "font_desc", amitk_fixed_font_desc, 
+-			      NULL);
++        goo_canvas_text_new(root, temp_string, x+UI_SERIES_L_MARGIN,
++                            y+image_height-UI_SERIES_BOTTOM_MARGIN, -1,
++                            GOO_CANVAS_ANCHOR_NORTH_WEST,
++                            "fill-color", "black",
++                            "font-desc", amitk_fixed_font_desc, NULL);
+     else
+-      gnome_canvas_item_set(ui_series->captions[i-start_i],
++      g_object_set(ui_series->captions[i-start_i],
+ 			    "text", temp_string,
+ 			    NULL);
+     g_free(temp_string);
+@@ -963,6 +948,7 @@
+   GtkWidget * packing_table;
+   GtkAdjustment * adjustment;
+   GtkWidget * scale;
++  GdkRectangle geom;
+   amide_time_t min_duration;
+   GList * temp_objects;
+   guint num_data_sets = 0;
+@@ -979,25 +965,24 @@
+   title = g_strdup_printf(_("Series: %s (%s - %s)"), AMITK_OBJECT_NAME(study),
+ 			  amitk_view_get_name(view), _(series_names[series_type]));
+   window = GTK_WINDOW(gtk_window_new(GTK_WINDOW_TOPLEVEL));
++  gtk_application_add_window(GTK_APPLICATION(g_application_get_default()),
++                             GTK_WINDOW(window));
+   gtk_window_set_title(window, title);
+   g_free(title);
+   gtk_window_set_resizable(window, TRUE);
+-  width = 0.5*gdk_screen_width();
+-  height = 0.5*gdk_screen_height();
++  gdk_monitor_get_geometry(gdk_display_get_primary_monitor
++                           (gdk_display_get_default()), &geom);
++  width = 0.5*geom.width;
++  height = 0.5*geom.height;
+   gtk_window_set_default_size(window, width, height);
+ 
+-  window_vbox = gtk_vbox_new(FALSE,0);
++  window_vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
+   gtk_container_add (GTK_CONTAINER (window), window_vbox);
+ 
+   ui_series = ui_series_init(window, window_vbox);
+   ui_series->preferences = g_object_ref(preferences);
+   ui_series->series_type = series_type;
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+   ui_series->roi_transparency = AMITK_STUDY_CANVAS_ROI_TRANSPARENCY(study);
+-#else
+-  ui_series->line_style = AMITK_STUDY_CANVAS_LINE_STYLE(study);
+-  ui_series->fill_roi = AMITK_STUDY_CANVAS_FILL_ROI(study);
+-#endif
+   ui_series->roi_width = AMITK_STUDY_CANVAS_ROI_WIDTH(study);
+ 
+   ui_series->objects = amitk_objects_ref(selected_objects);
+@@ -1267,34 +1252,28 @@
+   menus_toolbar_create(ui_series); /* setup the menu and toolbar */
+ 
+   /* make the widgets for this dialog box */
+-  packing_table = gtk_table_new(1,2,FALSE);
++  packing_table = gtk_grid_new();
++  gtk_grid_set_row_spacing(GTK_GRID(packing_table), Y_PADDING);
+   gtk_box_pack_start (GTK_BOX (ui_series->window_vbox), packing_table, TRUE,TRUE, 0);
+ 
+   /* setup the canvas */
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+-  ui_series->canvas = gnome_canvas_new_aa();
+-#else
+-  ui_series->canvas = gnome_canvas_new();
+-#endif
++  ui_series->canvas = goo_canvas_new();
+   g_signal_connect(G_OBJECT(ui_series->canvas), "size_allocate", 
+ 		   G_CALLBACK(canvas_size_change_cb), ui_series);
+ 
+-  gtk_table_attach(GTK_TABLE(packing_table), 
+-		   ui_series->canvas, 0,1,1,2,
+-		   X_PACKING_OPTIONS | GTK_FILL,
+-		   Y_PACKING_OPTIONS | GTK_FILL,
+-		   X_PADDING, Y_PADDING);
++  gtk_widget_set_hexpand(ui_series->canvas, TRUE);
++  gtk_widget_set_vexpand(ui_series->canvas, TRUE);
++  gtk_grid_attach(GTK_GRID(packing_table), ui_series->canvas, 0, 1, 1, 1);
+ 
+   /* make a nice scroll bar */
+   adjustment = ui_series_create_scroll_adjustment(ui_series);
+-  scale = gtk_hscale_new(adjustment);
++  scale = gtk_scale_new(GTK_ORIENTATION_HORIZONTAL, adjustment);
+   if ((ui_series->series_type == OVER_FRAMES) || (ui_series->series_type == OVER_GATES))
+     gtk_scale_set_digits(GTK_SCALE(scale), 0); /* want integer for frames */
+-  gtk_range_set_update_policy(GTK_RANGE(scale), GTK_UPDATE_DISCONTINUOUS);
+-  gtk_table_attach(GTK_TABLE(packing_table), 
+-		   GTK_WIDGET(scale), 0,1,0,1,
+-		   X_PACKING_OPTIONS | GTK_FILL, 0, X_PADDING, Y_PADDING);
+-  g_signal_connect(G_OBJECT(adjustment), "value_changed", G_CALLBACK(scroll_change_cb), ui_series);
++  gtk_widget_set_hexpand(scale, TRUE);
++  gtk_grid_attach(GTK_GRID(packing_table), scale, 0, 0, 1, 1);
++  g_signal_connect(scale, "button-release-event",
++                   G_CALLBACK(button_release_cb), ui_series);
+ 
+   /* show all our widgets */
+   gtk_widget_show_all(GTK_WIDGET(ui_series->window));
+@@ -1344,8 +1323,8 @@
+   temp_string = g_strdup_printf(_("%s: Series Initialization Dialog"), PACKAGE);
+   dialog = gtk_dialog_new_with_buttons (temp_string,  parent,
+ 					GTK_DIALOG_DESTROY_WITH_PARENT,
+-					GTK_STOCK_CANCEL, GTK_RESPONSE_CLOSE, 
+-					GTK_STOCK_EXECUTE, AMITK_RESPONSE_EXECUTE,
++					_("_Cancel"), GTK_RESPONSE_CLOSE,
++					_("_Execute"), AMITK_RESPONSE_EXECUTE,
+ 					NULL);
+   gtk_window_set_title(GTK_WINDOW(dialog), temp_string);
+   g_free(temp_string);
+@@ -1356,14 +1335,16 @@
+   gtk_container_set_border_width(GTK_CONTAINER(dialog), 10);
+ 
+   /* start making the widgets for this dialog box */
+-  table = gtk_table_new(7,3,FALSE);
++  table = gtk_grid_new();
++  gtk_grid_set_row_spacing(GTK_GRID(table), Y_PADDING);
++  gtk_grid_set_column_spacing(GTK_GRID(table), X_PADDING);
+   table_row=0;
+-  gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), table);
++  gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area
++                                  (GTK_DIALOG(dialog))), table);
+ 
+   /* what series type do we want */
+   label = gtk_label_new(_("Series Type:"));
+-  gtk_table_attach(GTK_TABLE(table), label, 0,1, 
+-		   table_row, table_row+1, X_PACKING_OPTIONS, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), label, 0, table_row, 1, 1);
+ 
+   for (i_series_type = 0; i_series_type < NUM_SERIES_TYPES; i_series_type++) {
+     if (i_series_type == 0) 
+@@ -1375,8 +1356,8 @@
+ 						    _(series_names[i_series_type]));
+     gtk_widget_set_tooltip_text(radio_button[i_series_type], 
+ 				_(series_explanations[i_series_type]));
+-    gtk_table_attach(GTK_TABLE(table), radio_button[i_series_type], 1, 2, 
+-		     table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(table), radio_button[i_series_type],
++                    1, table_row, 1, 1);
+     g_object_set_data(G_OBJECT(radio_button[i_series_type]), "series_type", 
+ 		      GINT_TO_POINTER(i_series_type));
+     table_row++;
+@@ -1387,15 +1368,13 @@
+     g_signal_connect(G_OBJECT(radio_button[i_series_type]), "clicked", G_CALLBACK(init_series_type_cb), NULL);
+   }
+ 
+-  hseparator = gtk_hseparator_new();
+-  gtk_table_attach(GTK_TABLE(table), hseparator, 0,2,
+-		   table_row, table_row+1,GTK_FILL, 0, X_PADDING, Y_PADDING);
++  hseparator = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
++  gtk_grid_attach(GTK_GRID(table), hseparator, 0, table_row, 2, 1);
+   table_row++;
+ 
+   /* what view type do we want */
+   label = gtk_label_new(_("View Type:"));
+-  gtk_table_attach(GTK_TABLE(table), label, 0,1, 
+-		   table_row, table_row+1, X_PACKING_OPTIONS, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(table), label, 0, table_row, 1, 1);
+ 
+   for (i_view = 0; i_view < AMITK_VIEW_NUM; i_view++) {
+     if (i_view == 0) 
+@@ -1405,8 +1384,7 @@
+       radio_button[i_view] = 
+ 	gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(radio_button[0]), 
+ 						    amitk_view_get_name(i_view));
+-    gtk_table_attach(GTK_TABLE(table), radio_button[i_view], 1, 2, 
+-		     table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++    gtk_grid_attach(GTK_GRID(table), radio_button[i_view], 1, table_row, 1, 1);
+     g_object_set_data(G_OBJECT(radio_button[i_view]), "view",
+ 		      GINT_TO_POINTER(i_view));
+     table_row++;
+@@ -1428,10 +1406,8 @@
+   gtk_widget_set_size_request(scrolled,250,-1);
+   gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled), 
+ 				 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+-  gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrolled), 
+-					tree_view);
+-  gtk_table_attach(GTK_TABLE(table), scrolled, 2,3,
+-		   0, table_row,GTK_FILL, GTK_FILL | GTK_EXPAND, X_PADDING, Y_PADDING);
++  gtk_container_add(GTK_CONTAINER(scrolled), tree_view);
++  gtk_grid_attach(GTK_GRID(table), scrolled, 2, 0, 1, table_row);
+ 
+   /* and show all our widgets */
+   gtk_widget_show_all(dialog);
+--- amide.orig/amide-current/src/ui_study.c
++++ amide/amide-current/src/ui_study.c
+@@ -157,37 +157,32 @@
+ /* updates the settings of the interpolation radio button/rendering combo box, will not change canvas */
+ static void update_interpolation_and_rendering(ui_study_t * ui_study) {
+ 
+-  AmitkInterpolation i_interpolation;
+   AmitkInterpolation interpolation;
+ 
+   
+   if (AMITK_IS_STUDY(ui_study->active_object)) {
+-    for (i_interpolation = 0; i_interpolation < AMITK_INTERPOLATION_NUM; i_interpolation++)
+-      gtk_action_set_sensitive(ui_study->interpolation_action[i_interpolation], FALSE);
++    g_simple_action_set_enabled(G_SIMPLE_ACTION(ui_study->interpolation_action), FALSE);
+     gtk_widget_set_sensitive(ui_study->rendering_menu, FALSE);
+   } else if (AMITK_IS_DATA_SET(ui_study->active_object)) {
+-    for (i_interpolation = 0; i_interpolation < AMITK_INTERPOLATION_NUM; i_interpolation++)
+-      gtk_action_set_sensitive(ui_study->interpolation_action[i_interpolation], TRUE);
++    g_simple_action_set_enabled(G_SIMPLE_ACTION(ui_study->interpolation_action), TRUE);
+     gtk_widget_set_sensitive(ui_study->rendering_menu, TRUE);
+ 
+ 
+     /* block signals, as we only want to change the value, it's up to the caller of this
+        function to change anything on the actual canvases... 
+        we'll unblock at the end of this function */
+-    for (i_interpolation = 0; i_interpolation < AMITK_INTERPOLATION_NUM; i_interpolation++) 
+-      g_signal_handlers_block_by_func(G_OBJECT(ui_study->interpolation_action[i_interpolation]),
++    g_signal_handlers_block_by_func(ui_study->interpolation_action,
+ 				      G_CALLBACK(ui_study_cb_interpolation), ui_study);
+     g_signal_handlers_block_by_func(G_OBJECT(ui_study->rendering_menu),
+ 				    G_CALLBACK(ui_study_cb_rendering), ui_study);
+ 
+     interpolation = AMITK_DATA_SET_INTERPOLATION(ui_study->active_object);
+-    gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(ui_study->interpolation_action[interpolation]),
+-				 TRUE);
++    g_simple_action_set_state(G_SIMPLE_ACTION(ui_study->interpolation_action),
++                              g_variant_new_int32(interpolation));
+     gtk_combo_box_set_active(GTK_COMBO_BOX(ui_study->rendering_menu), 
+ 			     AMITK_DATA_SET_RENDERING(ui_study->active_object));
+ 
+-    for (i_interpolation = 0; i_interpolation < AMITK_INTERPOLATION_NUM; i_interpolation++)
+-      g_signal_handlers_unblock_by_func(G_OBJECT(ui_study->interpolation_action[i_interpolation]),
++    g_signal_handlers_unblock_by_func(ui_study->interpolation_action,
+ 					G_CALLBACK(ui_study_cb_interpolation),  ui_study);
+     g_signal_handlers_unblock_by_func(G_OBJECT(ui_study->rendering_menu),
+ 				      G_CALLBACK(ui_study_cb_rendering), ui_study);
+@@ -369,364 +364,319 @@
+ 
+ 
+ 
+-static const GtkActionEntry normal_items[] = {
+-  /* Toplevel */
+-  { "FileMenu", NULL, N_("_File") },
+-  { "EditMenu", NULL, N_("_Edit") },
+-  { "ViewMenu", NULL, N_("_View") },
+-  { "ToolsMenu", NULL, N_("_Tools") },
+-  { "HelpMenu", NULL, N_("_Help") },
+-
+-  /* submenus */
+-  { "ImportSpecificMenu", NULL, N_("Import File (_specify)")},
+-  //N_("Import an image data file into this study, specifying the import type"), 
+-  { "ExportView", NULL, N_("_Export View")},
+-  //N_("Export one of the views to a picture file")
+-  { "AddRoi", NULL, N_("Add _ROI")},
+-  //N_("Add a new ROI"),
+-#if (AMIDE_FFMPEG_SUPPORT || AMIDE_LIBFAME_SUPPORT)
+-  { "FlyThrough",NULL,N_("Generate _Fly Through")},
+-  //N_("generate an mpeg fly through of the data sets")
+-#endif
+-  
+-  /* FileMenu */
+-  { "NewStudy",         GTK_STOCK_NEW,     N_("_New Study"), NULL, N_("Create a new study viewer window"), G_CALLBACK(ui_study_cb_new_study)},
+-  { "OpenXIFFile",      GTK_STOCK_OPEN,    N_("_Open Study"), NULL, N_("Open a previously saved study (XIF file)"), G_CALLBACK(ui_study_cb_open_xif_file)},
+-  { "SaveAsXIFFile",    GTK_STOCK_SAVE_AS, N_("Save Study As"), NULL, N_("Save current study (as a XIF file)"), G_CALLBACK(ui_study_cb_save_as_xif_file)},
+-  { "ImportGuess",      NULL,              N_("Import File (guess)"), NULL, N_("Import an image data file into this study, guessing at the file type"),G_CALLBACK(ui_study_cb_import)},
+-  { "ImportObject",     NULL,              N_("Import _Object from Study"),NULL, N_("Import an object, such as an ROI, from a preexisting study (XIF file)"),G_CALLBACK(ui_study_cb_import_object_from_xif_file)},
+-  { "ExportDataSet",    NULL,              N_("Export _Data Set"),NULL,N_("Export data set(s) to a medical image format"),G_CALLBACK(ui_study_cb_export_data_set)},
+-  { "RecoverXIFFile",     NULL,              N_("_Recover Study"),NULL,N_("Try to recover a corrupted XIF file"),G_CALLBACK(ui_study_cb_recover_xif_file)},
+-  { "OpenXIFDir",       NULL,              N_("Open XIF Directory"), NULL, N_("Open a study stored in XIF directory format"), G_CALLBACK(ui_study_cb_open_xif_dir)},
+-  { "SaveAsXIFDir",     NULL,              N_("Save As XIF Drectory"), NULL, N_("Save a study in XIF directory format"), G_CALLBACK(ui_study_cb_save_as_xif_dir)},
+-  { "ImportFromXIFDir", NULL,              N_("Import from XIF Directory"),NULL, N_("Import an object, such as an ROI, from a preexisting XIF directory"),G_CALLBACK(ui_study_cb_import_object_from_xif_dir)},
+-  { "Close",            GTK_STOCK_CLOSE,   NULL, "<control>W", N_("Close the current study"), G_CALLBACK (ui_study_cb_close)},
+-  { "Quit",             GTK_STOCK_QUIT,    NULL, "<control>Q", N_("Quit AMIDE"), G_CALLBACK (ui_study_cb_quit)},
+-  
+-  /* ExportView Submenu */
+-  { "ExportViewTransverse", NULL, N_("_Transverse"),NULL,N_("Export the current transaxial view to an image file (JPEG/TIFF/PNG/etc.)"),G_CALLBACK(ui_study_cb_export_view)},
+-  { "ExportViewCoronal",NULL, N_("_Coronal"),NULL,N_("Export the current coronal view to an image file (JPEG/TIFF/PNG/etc.)"),G_CALLBACK(ui_study_cb_export_view)},
+-  { "ExportViewSagittal",NULL, N_("_Sagittal"),NULL,N_("Export the current sagittal view to an image file (JPEG/TIFF/PNG/etc.)"),G_CALLBACK(ui_study_cb_export_view)},
+-
+-  /* EditMenu */
+-  { "AddFiducial", NULL, N_("Add _Fiducial Mark"),NULL,N_("Add a new fiducial mark to the active data set"),G_CALLBACK(ui_study_cb_add_fiducial_mark)},
+-  { "Preferences", GTK_STOCK_PREFERENCES,NULL, NULL,NULL,G_CALLBACK(ui_study_cb_preferences)},
+-
+-  /* ViewMenu */
+-  { "ViewSeries", NULL, N_("_Series"),NULL,N_("Look at a series of images"), G_CALLBACK(ui_study_cb_series)},
++static const GActionEntry normal_items[] = {
++  { "new", ui_study_cb_new_study },
++  { "open", ui_study_cb_open_xif_file },
++  { "save", ui_study_cb_save_as_xif_file },
++  { "import", ui_study_cb_import, "(ii)" },
++  { "import-object", ui_study_cb_import_object_from_xif_file },
++  { "export", ui_study_cb_export_data_set },
++  { "recover", ui_study_cb_recover_xif_file },
++  { "open-dir", ui_study_cb_open_xif_dir },
++  { "save-dir", ui_study_cb_save_as_xif_dir },
++  { "import-dir", ui_study_cb_import_object_from_xif_dir },
++  { "close", ui_study_cb_close },
++  { "quit", ui_study_cb_quit },
++  { "export-view", ui_study_cb_export_view, "i" },
++  { "add-roi", ui_study_cb_add_roi, "i" },
++  { "fiducial", ui_study_cb_add_fiducial_mark },
++  { "preferences", ui_study_cb_preferences },
++  { "series", ui_study_cb_series },
+ #if AMIDE_LIBVOLPACK_SUPPORT
+-  { "ViewRendering",NULL,N_("_Volume Rendering"),NULL,N_("perform a volume rendering on the currently selected objects"),G_CALLBACK(ui_study_cb_render)},
++  { "rendering", ui_study_cb_render },
+ #endif
+-
+-  /* ToolsMenu */
+-  { "AlignmentWizard",NULL,N_("_Alignment Wizard"),NULL,N_("guides you throw the processing of alignment"),G_CALLBACK(ui_study_cb_alignment_selected)},
+-  { "CropWizard",NULL,N_("_Crop Active Data Set"),NULL,N_("allows you to crop the active data set"),G_CALLBACK(ui_study_cb_crop_selected)},
+-  { "DistanceWizard",NULL,N_("Distance Measurements"),NULL,N_("calculate distances between fiducial marks and ROIs"),G_CALLBACK(ui_study_cb_distance_selected)},
+-  { "FactorAnalysisWizard", NULL,N_("_Factor Analysis"),NULL,N_("allows you to do factor analysis of dynamic data on the active data set"),G_CALLBACK(ui_study_cb_fads_selected)},
+-  { "FilterWizard",NULL,N_("_Filter Active Data Set"),NULL,N_("allows you to filter the active data set"),G_CALLBACK(ui_study_cb_filter_selected)},
+-  { "LineProfile",NULL,N_("Generate Line _Profile"),NULL,N_("allows generating a line profile between two fiducial marks"),G_CALLBACK(ui_study_cb_profile_selected)},
+-  { "MathWizard",NULL,N_("Perform _Math on Data Set(s)"),NULL,N_("perform simple math operations on a data set or between data sets"),G_CALLBACK(ui_study_cb_data_set_math_selected)},
+-  { "RoiStats",NULL,N_("Calculate _ROI Statistics"),NULL,N_("calculate ROI statistics"),G_CALLBACK(ui_study_cb_roi_statistics)},
+-
+-  /* Flythrough Submenu */
++  { "alignment", ui_study_cb_alignment_selected },
++  { "crop", ui_study_cb_crop_selected },
++  { "distance", ui_study_cb_distance_selected },
++  { "fads", ui_study_cb_fads_selected },
++  { "filter", ui_study_cb_filter_selected },
++  { "profile", ui_study_cb_profile_selected },
++  { "math", ui_study_cb_data_set_math_selected },
++  { "roi", ui_study_cb_roi_statistics },
+ #if (AMIDE_FFMPEG_SUPPORT || AMIDE_LIBFAME_SUPPORT)
+-  { "FlyThroughTransverse",NULL,N_("_Transverse"),NULL,N_("Generate a fly through using transaxial slices"),G_CALLBACK(ui_study_cb_fly_through)},
+-  { "FlyThroughCoronal",NULL,N_("_Coronal"),NULL,N_("Generate a fly through using coronal slices"),G_CALLBACK(ui_study_cb_fly_through)},
+-  { "FlyThroughSagittal",NULL,N_("_Sagittal"),NULL,N_("Generate a fly through using sagittal slices"),G_CALLBACK(ui_study_cb_fly_through)},
++  { "fly-through", ui_study_cb_fly_through, "i" },
+ #endif
+-
+-  /* Toolbar items */
+-  { "Thresholding", "amide_icon_thresholding", N_("_Threshold"),NULL,N_("Set the thresholds and colormaps for the active data set"), G_CALLBACK(ui_study_cb_thresholding)},
++  { "thresholding", ui_study_cb_thresholding }
+ };
+ 
+-
+-static const GtkRadioActionEntry interpolation_radio_entries[AMITK_INTERPOLATION_NUM] = {
+-  { "InterpolationNearestNeighbor", "amide_icon_interpolation_nearest_neighbor", N_("Near."), NULL,  N_("interpolate using nearest neighbor (fast)"),AMITK_INTERPOLATION_NEAREST_NEIGHBOR},
+-  { "InterpolationTrilinear", "amide_icon_interpolation_trilinear", N_("Tri."), NULL, N_("interpolate using trilinear interpolation (slow)"), AMITK_INTERPOLATION_TRILINEAR},
+-};
+- 
+-static const GtkRadioActionEntry fuse_type_radio_entries[AMITK_FUSE_TYPE_NUM] = {
+-  { "FuseTypeBlend", "amide_icon_fuse_type_blend", N_("Blend"), NULL,  N_("blend all data sets"), AMITK_FUSE_TYPE_BLEND },
+-  { "FuseTypeOverlay", "amide_icon_fuse_type_overlay", N_("Overlay"), NULL, N_("overlay active data set on blended data sets"),AMITK_FUSE_TYPE_OVERLAY },
++static const GActionEntry stateful_entries[] = {
++  { "interpolation", NULL, "i", "@i 0", ui_study_cb_interpolation },
++  { "fuse-type", NULL, "i", "@i 0", ui_study_cb_fuse_type },
++  { "view-mode", NULL, "i", "@i 0", ui_study_cb_view_mode },
++  { "target", NULL, NULL, "false", ui_study_cb_canvas_target },
++  { "view-transverse", NULL, NULL, "true", ui_study_cb_canvas_visible },
++  { "view-coronal", NULL, NULL, "true", ui_study_cb_canvas_visible },
++  { "view-sagittal", NULL, NULL, "true", ui_study_cb_canvas_visible }
+ };
+ 
+-static const GtkRadioActionEntry view_mode_radio_entries[AMITK_VIEW_MODE_NUM] = {
+-  { "CanvasViewModeSingle", "amide_icon_view_mode_single", N_("Single"), NULL, N_("All objects are shown in a single view"),AMITK_VIEW_MODE_SINGLE },
+-  { "CanvasViewModeLinked2Way", "amide_icon_view_mode_linked_2way", N_("2-way"), NULL,N_("Objects are shown between 2 linked views"), AMITK_VIEW_MODE_LINKED_2WAY },
+-  { "CanvasViewModeLinked3Way", "amide_icon_view_mode_linked_3way", N_("3-way"), NULL,N_("Objects are shown between 3 linked views"), AMITK_VIEW_MODE_LINKED_3WAY },
+-};
+-
+- 
+-/* Toggle items */
+-static const GtkToggleActionEntry toggle_entries[] = {
+-  { "CanvasTarget", "amide_icon_canvas_target", N_("Target"), NULL, N_("Leave crosshairs on views"), G_CALLBACK(ui_study_cb_canvas_target), FALSE},
+-  { "CanvasViewTransverse", "amide_icon_view_transverse", N_("Transverse"), NULL, N_("Enable transverse view"), G_CALLBACK(ui_study_cb_canvas_visible), FALSE},
+-  { "CanvasViewCoronal", "amide_icon_view_coronal", N_("Coronal"), NULL, N_("Enable coronal view"), G_CALLBACK(ui_study_cb_canvas_visible), FALSE},
+-  { "CanvasViewSagittal", "amide_icon_view_sagittal", N_("Sagittal"), NULL, N_("Enable sagittal view"), G_CALLBACK(ui_study_cb_canvas_visible), FALSE},
+-};
+-
+-static const char *ui_description =
+-"<ui>"
+-"  <menubar name='MainMenu'>"
+-"    <menu action='FileMenu'>"
+-"      <menuitem action='NewStudy'/>"
+-"      <menuitem action='OpenXIFFile'/>"
+-"      <menuitem action='SaveAsXIFFile'/>"
+-"      <separator/>"
+-"      <menuitem action='ImportGuess'/>"
+-"      <menu action='ImportSpecificMenu'>"
+-  /* filled in the function */
+-"      </menu>"
+-"      <menuitem action='ImportObject'/>"
+-"      <separator/>"
+-"      <menu action='ExportView'>"
+-"               <menuitem action='ExportViewTransverse'/>"
+-"               <menuitem action='ExportViewCoronal'/>"
+-"               <menuitem action='ExportViewSagittal'/>"
+-"      </menu>"
+-"      <menuitem action='ExportDataSet'/>"
+-"      <separator/>"
+-"      <menuitem action='RecoverXIFFile'/>"
+-"      <menuitem action='OpenXIFDir'/>"
+-"      <menuitem action='SaveAsXIFDir'/>"
+-"      <menuitem action='ImportFromXIFDir'/>"
+-"      <separator/>"
+-"      <menuitem action='Close'/>"
+-"      <menuitem action='Quit'/>"
+-"    </menu>"
+-"    <menu action='EditMenu'>"
+-"      <menu action='AddRoi'>"
+-  /* filled in the function */
+-"      </menu>"
+-"      <menuitem action='AddFiducial'/>"
+-"      <separator/>"
+-"      <menuitem action='Preferences'/>"
+-"    </menu>"
+-"    <menu action='ViewMenu'>"
+-"       <menuitem action='ViewSeries'/>"
+-#if AMIDE_LIBVOLPACK_SUPPORT
+-"       <menuitem action='ViewRendering'/>"
+-#endif
+-"    </menu>"
+-"    <menu action='ToolsMenu'>"
+-"       <menuitem action='AlignmentWizard'/>"
+-"       <menuitem action='CropWizard'/>"
+-"       <menuitem action='DistanceWizard'/>"
+-"       <menuitem action='FactorAnalysisWizard'/>"
+-"       <menuitem action='FilterWizard'/>"
+-#if (AMIDE_FFMPEG_SUPPORT || AMIDE_LIBFAME_SUPPORT)
+-"       <menu action='FlyThrough'>"
+-"          <menuitem action='FlyThroughTransverse'/>"
+-"          <menuitem action='FlyThroughCoronal'/>"
+-"          <menuitem action='FlyThroughSagittal'/>"
+-"       </menu>"
+-#endif
+-"       <menuitem action='LineProfile'/>"
+-"       <menuitem action='MathWizard'/>"
+-"       <menuitem action='RoiStats'/>"
+-"    </menu>"
+-HELP_MENU_UI_DESCRIPTION
+-"  </menubar>"
+-"  <toolbar name='ToolBar'>"
+-"    <toolitem action='InterpolationNearestNeighbor'/>"
+-"    <toolitem action='InterpolationTrilinear'/>"
+-"    <placeholder name='RenderingCombo'/>"
+-"    <separator/>"
+-"    <toolitem action='FuseTypeBlend'/>"
+-"    <toolitem action='FuseTypeOverlay'/>"
+-"    <separator/>"
+-"    <toolitem action='CanvasTarget'/>"
+-"    <separator/>"
+-"    <toolitem action='CanvasViewTransverse'/>"
+-"    <toolitem action='CanvasViewCoronal'/>"
+-"    <toolitem action='CanvasViewSagittal'/>"
+-"    <separator/>"
+-"    <toolitem action='CanvasViewModeSingle'/>"
+-"    <toolitem action='CanvasViewModeLinked2Way'/>"
+-"    <toolitem action='CanvasViewModeLinked3Way'/>"
+-"    <separator/>"
+-"    <toolitem action='Thresholding'/>"
+-  /*"    <separator/>"  */
+-  /* "    <placeholder name='Zoom' />" */
+-"  </toolbar>"
+-"</ui>";
+-
+ 
+ 
+ /* function to setup the menus for the study ui */
+ static void menus_toolbar_create(ui_study_t * ui_study) {
+ 
+-  GtkWidget *menubar;
++  GtkApplication *app;
+   GtkWidget *toolbar;
+-  GtkActionGroup *action_group;
+-  GtkUIManager *ui_manager;
+-  GtkAccelGroup *accel_group;
+-  GError *error;
+   GtkWidget * label;
+   AmitkImportMethod i_import_method;
+   AmitkRendering i_rendering;
+-  GtkAction * action;
+-  GtkWidget * menu;
+-  GtkWidget * submenu;
+-  GtkWidget * menu_item;
++  GMenu * menu;
++  GMenuItem * menu_item;
++  GtkToolItem * tool_item;
++  GtkWidget * icon;
+ #ifdef AMIDE_LIBMDC_SUPPORT
+   libmdc_import_t i_libmdc_import;
+ #endif
+   AmitkRoiType i_roi_type;
+-  GtkObject * adjustment;
+-  GtkWidget * placeholder;
++  GtkAdjustment * adjustment;
++  gchar *name;
++  const gchar *new[] = { "<Control>n", NULL };
++  const gchar *open[] = { "<Control>o", NULL };
++  const gchar *close[] = { "<Control>w", NULL };
++  const gchar *quit[] = { "<Control>q", NULL };
++  const gchar *help[] = { "F1", NULL };
++  static gboolean menus_built = FALSE;
+   
+   g_assert(ui_study!=NULL); /* sanity check */
+ 
+-  /* create an action group with all the menu actions */
+-  action_group = gtk_action_group_new ("MenuActions");
+-  gtk_action_group_set_translation_domain(action_group, GETTEXT_PACKAGE);
+-
+-  gtk_action_group_add_actions(action_group, normal_items, G_N_ELEMENTS(normal_items),ui_study);
+-  gtk_action_group_add_actions(action_group, ui_common_help_menu_items, G_N_ELEMENTS(ui_common_help_menu_items),ui_study);
+-  gtk_action_group_add_toggle_actions(action_group, toggle_entries, G_N_ELEMENTS (toggle_entries), ui_study);
+-  gtk_action_group_add_radio_actions(action_group, interpolation_radio_entries, G_N_ELEMENTS (interpolation_radio_entries), 
+-				     0, G_CALLBACK(ui_study_cb_interpolation), ui_study);
+-  gtk_action_group_add_radio_actions(action_group, fuse_type_radio_entries, G_N_ELEMENTS (fuse_type_radio_entries), 
+-				     0, G_CALLBACK(ui_study_cb_fuse_type), ui_study);
+-  gtk_action_group_add_radio_actions(action_group, view_mode_radio_entries, G_N_ELEMENTS (view_mode_radio_entries), 
+-				     0, G_CALLBACK(ui_study_cb_view_mode), ui_study);
+-
+-  /* create the ui manager, and add the actions and accel's */
+-  ui_manager = gtk_ui_manager_new ();
+-  gtk_ui_manager_insert_action_group (ui_manager, action_group, 0);
+-  accel_group = gtk_ui_manager_get_accel_group (ui_manager);
+-  gtk_window_add_accel_group (ui_study->window, accel_group);
+-
+-  /* create the actual menu/toolbar ui */
+-  error = NULL;
+-  if (!gtk_ui_manager_add_ui_from_string (ui_manager, ui_description, -1, &error)) {
+-    g_warning ("%s: building menus failed in %s: %s", PACKAGE, __FILE__, error->message);
+-    g_error_free (error);
+-    return;
+-  }
+-
+ 
+-  /* set additional info so we can tell the menus apart */
+-  g_object_set_data(G_OBJECT(gtk_action_group_get_action (action_group, "ExportViewTransverse")),
+-		    "view", GINT_TO_POINTER(AMITK_VIEW_TRANSVERSE));
+-  g_object_set_data(G_OBJECT(gtk_action_group_get_action (action_group, "ExportViewCoronal")),
+-		    "view", GINT_TO_POINTER(AMITK_VIEW_CORONAL));
+-  g_object_set_data(G_OBJECT(gtk_action_group_get_action (action_group, "ExportViewSagittal")),
+-		    "view", GINT_TO_POINTER(AMITK_VIEW_SAGITTAL));
+-#if (AMIDE_FFMPEG_SUPPORT || AMIDE_LIBFAME_SUPPORT)
+-  g_object_set_data(G_OBJECT(gtk_action_group_get_action (action_group, "FlyThroughTransverse")),
+-		    "view", GINT_TO_POINTER(AMITK_VIEW_TRANSVERSE));
+-  g_object_set_data(G_OBJECT(gtk_action_group_get_action (action_group, "FlyThroughCoronal")),
+-		    "view", GINT_TO_POINTER(AMITK_VIEW_CORONAL));
+-  g_object_set_data(G_OBJECT(gtk_action_group_get_action (action_group, "FlyThroughSagittal")),
+-		    "view", GINT_TO_POINTER(AMITK_VIEW_SAGITTAL));
++  app = gtk_window_get_application(ui_study->window);
++  g_action_map_add_action_entries(G_ACTION_MAP(ui_study->window),
++                                  normal_items, G_N_ELEMENTS(normal_items),
++                                  ui_study);
++  g_action_map_add_action_entries(G_ACTION_MAP(app),
++                                  ui_common_help_menu_items,
++                                  G_N_ELEMENTS(ui_common_help_menu_items),
++                                  ui_study);
++  g_action_map_add_action_entries(G_ACTION_MAP(ui_study->window),
++                                  stateful_entries,
++                                  G_N_ELEMENTS(stateful_entries), ui_study);
++
++  gtk_application_set_accels_for_action(app, "win.new", new);
++  gtk_application_set_accels_for_action(app, "win.open", open);
++  gtk_application_set_accels_for_action(app, "win.close", close);
++  gtk_application_set_accels_for_action(app, "win.quit", quit);
++  gtk_application_set_accels_for_action(app, "app.manual", help);
++
++  /* Because the main (study) menu (src/menus.ui) is so-called
++     "automatic resource" loaded by GtkApplication, manipulating it
++     should be done only once, for the first study window.  */
++  if (!menus_built) {
++#if !AMIDE_LIBVOLPACK_SUPPORT
++    /* Remove "Volume Rendering" menu item.  */
++    menu = gtk_application_get_menu_by_id(app, "view");
++    g_menu_remove(menu, 1);
++#endif
++#if !(AMIDE_FFMPEG_SUPPORT || AMIDE_LIBFAME_SUPPORT)
++    /* Remove "Generate Fly Through" submenu.  */
++    menu = gtk_application_get_menu_by_id(app, "tools");
++    g_menu_remove(menu, 5);
+ #endif
+ 
+-  /* build the import menu */
+-  submenu = gtk_menu_new();
+-  for (i_import_method = AMITK_IMPORT_METHOD_RAW; i_import_method < AMITK_IMPORT_METHOD_NUM; i_import_method++) {
++    /* build the import menu */
++    menu = gtk_application_get_menu_by_id(app, "import");
++    for (i_import_method = AMITK_IMPORT_METHOD_RAW; i_import_method < AMITK_IMPORT_METHOD_NUM; i_import_method++) {
+ #ifdef AMIDE_LIBMDC_SUPPORT
+-    if (i_import_method == AMITK_IMPORT_METHOD_LIBMDC) {
+-      for (i_libmdc_import = 0; i_libmdc_import < LIBMDC_NUM_IMPORT_METHODS; i_libmdc_import++) {
+-  	if (libmdc_supports(libmdc_import_to_format[i_libmdc_import])) {
+-	  menu_item = gtk_menu_item_new_with_mnemonic(libmdc_import_menu_names[i_libmdc_import]);
+-	  /* if tooltip support existed - libmdc_import_menu_explanations[i_libmdc_import] */
+-	  gtk_menu_shell_append(GTK_MENU_SHELL(submenu), menu_item);
+-  	  g_object_set_data(G_OBJECT(menu_item), "method", GINT_TO_POINTER(i_import_method));
+-  	  g_object_set_data(G_OBJECT(menu_item), "submethod", GINT_TO_POINTER(libmdc_import_to_format[i_libmdc_import]));
+-	  g_signal_connect(G_OBJECT(menu_item), "activate",  G_CALLBACK(ui_study_cb_import), ui_study);
+-	  gtk_widget_show(menu_item);
+-	}
+-      }
+-    } else 
++      if (i_import_method == AMITK_IMPORT_METHOD_LIBMDC) {
++        for (i_libmdc_import = 0; i_libmdc_import < LIBMDC_NUM_IMPORT_METHODS; i_libmdc_import++) {
++          if (libmdc_supports(libmdc_import_to_format[i_libmdc_import])) {
++            name = g_strdup_printf("win.import((%d,%d))", i_import_method,
++                                   libmdc_import_to_format[i_libmdc_import]);
++            menu_item = g_menu_item_new(libmdc_import_menu_names[i_libmdc_import],
++                                        name);
++            g_free(name);
++            /* if tooltip support existed - libmdc_import_menu_explanations[i_libmdc_import] */
++            g_menu_insert_item(menu, i_libmdc_import, menu_item);
++            g_object_unref(menu_item);
++          }
++        }
++      } else
+ #endif
+-      {
+-	menu_item = gtk_menu_item_new_with_mnemonic(amitk_import_menu_names[i_import_method]);
+-	/* if tooltip support existed - amitk_import_menu_explanations[i_import_method] */
+-	gtk_menu_shell_append(GTK_MENU_SHELL(submenu), menu_item);
+-  	g_object_set_data(G_OBJECT(menu_item), "method", GINT_TO_POINTER(i_import_method));
+-  	g_object_set_data(G_OBJECT(menu_item), "submethod", GINT_TO_POINTER(0));
+-	g_signal_connect(G_OBJECT(menu_item), "activate",  G_CALLBACK(ui_study_cb_import), ui_study);
+-	gtk_widget_show(menu_item);
+-      }
++        {
++          name = g_strdup_printf("win.import((%d,0))", i_import_method);
++          menu_item = g_menu_item_new(amitk_import_menu_names[i_import_method],
++                                      name);
++          g_free(name);
++          /* if tooltip support existed - amitk_import_menu_explanations[i_import_method] */
++          g_menu_insert_item(menu, i_import_method, menu_item);
++          g_object_unref(menu_item);
++        }
++    }
++
++    /* build the add roi menu */
++    menu = gtk_application_get_menu_by_id(app, "roi");
++    for (i_roi_type=0; i_roi_type<AMITK_ROI_TYPE_NUM; i_roi_type++) {
++      name = g_strdup_printf("win.add-roi(%d)", i_roi_type);
++      menu_item = g_menu_item_new(_(amitk_roi_menu_names[i_roi_type]), name);
++      g_free(name);
++      /* if tooltip support existed - amitk_roi_menu_explanation[i_roi_type] */
++      g_menu_insert_item(menu, i_roi_type, menu_item);
++      g_object_unref(menu_item);
++    }
++    menus_built = TRUE;
+   }
+-  menu = gtk_ui_manager_get_widget(ui_manager, "ui/MainMenu/FileMenu/ImportSpecificMenu");
+-  gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu), submenu);
+-  gtk_widget_show(submenu);
+-  gtk_widget_show(menu);
+-
+-  /* build the add roi menu */
+-  submenu = gtk_menu_new();
+-  for (i_roi_type=0; i_roi_type<AMITK_ROI_TYPE_NUM; i_roi_type++) {
+-    menu_item = gtk_menu_item_new_with_mnemonic(_(amitk_roi_menu_names[i_roi_type]));
+-    /* if tooltip support existed - amitk_roi_menu_explanation[i_roi_type] */
+-    gtk_menu_shell_append(GTK_MENU_SHELL(submenu), menu_item);
+-    g_object_set_data(G_OBJECT(menu_item), "roi_type", GINT_TO_POINTER(i_roi_type)); 
+-    g_signal_connect(G_OBJECT(menu_item), "activate",  G_CALLBACK(ui_study_cb_add_roi), ui_study);
+-    gtk_widget_show(menu_item);
+-  }
+-  menu = gtk_ui_manager_get_widget(ui_manager, "ui/MainMenu/EditMenu/AddRoi");
+-  gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu), submenu);
+-  gtk_widget_show(submenu);
+-  gtk_widget_show(menu);
+ 
+   /* record the radio/toggle items so that we can change which one is depressed later */
+-  ui_study->interpolation_action[AMITK_INTERPOLATION_NEAREST_NEIGHBOR] = 
+-    gtk_action_group_get_action(action_group, "InterpolationNearestNeighbor");
+-  ui_study->interpolation_action[AMITK_INTERPOLATION_TRILINEAR] = 
+-    gtk_action_group_get_action(action_group, "InterpolationTrilinear");
+-  g_assert(AMITK_INTERPOLATION_TRILINEAR+1 == AMITK_INTERPOLATION_NUM); /* make sure we handle all types */
+-
+-  ui_study->fuse_type_action[AMITK_FUSE_TYPE_BLEND] = 
+-    gtk_action_group_get_action(action_group, "FuseTypeBlend");
+-  ui_study->fuse_type_action[AMITK_FUSE_TYPE_OVERLAY] = 
+-    gtk_action_group_get_action(action_group, "FuseTypeOverlay");
+-  g_assert(AMITK_FUSE_TYPE_OVERLAY+1 == AMITK_FUSE_TYPE_NUM); /* make sure we handle all types */
+-
+-  ui_study->view_mode_action[AMITK_VIEW_MODE_SINGLE] = 
+-    gtk_action_group_get_action(action_group, "CanvasViewModeSingle");
+-  ui_study->view_mode_action[AMITK_VIEW_MODE_LINKED_2WAY] = 
+-    gtk_action_group_get_action(action_group, "CanvasViewModeLinked2Way");
+-  ui_study->view_mode_action[AMITK_VIEW_MODE_LINKED_3WAY] = 
+-    gtk_action_group_get_action(action_group, "CanvasViewModeLinked3Way");
+-  g_assert(AMITK_VIEW_MODE_LINKED_3WAY+1 == AMITK_VIEW_MODE_NUM); /* make sure we handle all types */
+-
+-  ui_study->canvas_target_action = 
+-    gtk_action_group_get_action(action_group, "CanvasTarget");
+-
+-  action = gtk_action_group_get_action(action_group, "CanvasViewTransverse");
+-  ui_study->canvas_visible_action[AMITK_VIEW_TRANSVERSE] = action;
+-  g_object_set_data(G_OBJECT(action), "view", GINT_TO_POINTER(AMITK_VIEW_TRANSVERSE));
+-    
+-  action = gtk_action_group_get_action(action_group, "CanvasViewCoronal");
+-  ui_study->canvas_visible_action[AMITK_VIEW_CORONAL] = action;
+-  g_object_set_data(G_OBJECT(action), "view", GINT_TO_POINTER(AMITK_VIEW_CORONAL));
+-    
+-  action = gtk_action_group_get_action(action_group, "CanvasViewSagittal");
+-  ui_study->canvas_visible_action[AMITK_VIEW_SAGITTAL] = action;
+-  g_object_set_data(G_OBJECT(action), "view", GINT_TO_POINTER(AMITK_VIEW_SAGITTAL));
+-
+-  /* pack in the menu and toolbar */
+-  menubar = gtk_ui_manager_get_widget (ui_manager, "/MainMenu");
+-  gtk_box_pack_start (GTK_BOX (ui_study->window_vbox), menubar, FALSE, FALSE, 0);
++  ui_study->interpolation_action =
++    g_action_map_lookup_action(G_ACTION_MAP(ui_study->window), "interpolation");
++
++  ui_study->fuse_type_action =
++    g_action_map_lookup_action(G_ACTION_MAP(ui_study->window), "fuse-type");
+ 
+-  toolbar = gtk_ui_manager_get_widget (ui_manager, "/ToolBar");
++  ui_study->view_mode_action =
++    g_action_map_lookup_action(G_ACTION_MAP(ui_study->window), "view-mode");
++
++  ui_study->canvas_target_action =
++    g_action_map_lookup_action(G_ACTION_MAP(ui_study->window), "target");
++
++  ui_study->canvas_visible_action[AMITK_VIEW_TRANSVERSE] =
++    g_action_map_lookup_action(G_ACTION_MAP(ui_study->window), "view-transverse");
++  ui_study->canvas_visible_action[AMITK_VIEW_CORONAL] =
++    g_action_map_lookup_action(G_ACTION_MAP(ui_study->window), "view-coronal");
++  ui_study->canvas_visible_action[AMITK_VIEW_SAGITTAL] =
++    g_action_map_lookup_action(G_ACTION_MAP(ui_study->window), "view-sagittal");
++
++  /* Construct the toolbar.  All of this is a bit verbose but easier
++     to do than writing an XML description (or doing it in Glade).  */
++  toolbar = gtk_toolbar_new();
+   gtk_box_pack_start (GTK_BOX (ui_study->window_vbox), toolbar, FALSE, FALSE, 0);
+   gtk_toolbar_set_style(GTK_TOOLBAR(toolbar), GTK_TOOLBAR_ICONS);
+   gtk_toolbar_set_show_arrow(GTK_TOOLBAR(toolbar), FALSE);
+ 
++  tool_item = gtk_radio_tool_button_new(NULL);
++  gtk_tool_button_set_label(GTK_TOOL_BUTTON(tool_item), _("Near."));
++  gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(tool_item),
++                                "amide_icon_interpolation_nearest_neighbor");
++  gtk_tool_item_set_tooltip_text(tool_item,
++                                 _("interpolate using nearest neighbor (fast)"));
++  gtk_actionable_set_detailed_action_name(GTK_ACTIONABLE(tool_item),
++                                          "win.interpolation(0)");
++  gtk_toolbar_insert(GTK_TOOLBAR(toolbar), tool_item, -1);
++  tool_item =
++    gtk_radio_tool_button_new_from_widget(GTK_RADIO_TOOL_BUTTON(tool_item));
++  gtk_tool_button_set_label(GTK_TOOL_BUTTON(tool_item), _("Tri."));
++  gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(tool_item),
++                                "amide_icon_interpolation_trilinear");
++  gtk_tool_item_set_tooltip_text(tool_item,
++                                 _("interpolate using trilinear interpolation (slow)"));
++  gtk_actionable_set_detailed_action_name(GTK_ACTIONABLE(tool_item),
++                                          "win.interpolation(1)");
++  gtk_toolbar_insert(GTK_TOOLBAR(toolbar), tool_item, -1);
++
+   /* insert the rendering menu into the toolbar */
+-  placeholder = gtk_ui_manager_get_widget (ui_manager, "/ToolBar/RenderingCombo");
+-  ui_study->rendering_menu = gtk_combo_box_new_text(); 
+-  /*  gtk_widget_set_tooltip_text(ui_study->rendering_menu, _(amitk_rendering_explanation)); 
+-      combo box's (as of 2.24 at least, don't have functioning tool tips */
++  ui_study->rendering_menu = gtk_combo_box_text_new();
+ 
+   for (i_rendering = 0; i_rendering < AMITK_RENDERING_NUM; i_rendering++) 
+-    gtk_combo_box_append_text(GTK_COMBO_BOX(ui_study->rendering_menu), amitk_rendering_get_name(i_rendering));
++    gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(ui_study->rendering_menu), amitk_rendering_get_name(i_rendering));
+   g_signal_connect(G_OBJECT(ui_study->rendering_menu), "changed", G_CALLBACK(ui_study_cb_rendering), ui_study);
+-  ui_common_toolbar_insert_widget(toolbar, ui_study->rendering_menu, "", 
+-				  gtk_toolbar_get_item_index(GTK_TOOLBAR(toolbar), GTK_TOOL_ITEM(placeholder)));
++  ui_common_toolbar_insert_widget(toolbar, ui_study->rendering_menu,
++                                  _(amitk_rendering_explanation),
++                                  gtk_toolbar_get_n_items(GTK_TOOLBAR(toolbar)));
++
++  ui_common_toolbar_append_separator(toolbar);
++
++  tool_item = gtk_radio_tool_button_new(NULL);
++  gtk_tool_button_set_label(GTK_TOOL_BUTTON(tool_item), _("Blend"));
++  gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(tool_item),
++                                "amide_icon_fuse_type_blend");
++  gtk_tool_item_set_tooltip_text(tool_item, _("blend all data sets"));
++  gtk_actionable_set_detailed_action_name(GTK_ACTIONABLE(tool_item),
++                                          "win.fuse-type(0)");
++  gtk_toolbar_insert(GTK_TOOLBAR(toolbar), tool_item, -1);
++  tool_item =
++    gtk_radio_tool_button_new_from_widget(GTK_RADIO_TOOL_BUTTON(tool_item));
++  gtk_tool_button_set_label(GTK_TOOL_BUTTON(tool_item), _("Overlay"));
++  gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(tool_item),
++                                "amide_icon_fuse_type_overlay");
++  gtk_tool_item_set_tooltip_text(tool_item,
++                                 _("overlay active data set on blended data sets"));
++  gtk_actionable_set_detailed_action_name(GTK_ACTIONABLE(tool_item),
++                                          "win.fuse-type(1)");
++  gtk_toolbar_insert(GTK_TOOLBAR(toolbar), tool_item, -1);
++
++  ui_common_toolbar_append_separator(toolbar);
++
++  tool_item = gtk_toggle_tool_button_new();
++  gtk_tool_button_set_label(GTK_TOOL_BUTTON(tool_item), _("Target"));
++  gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(tool_item),
++                                "amide_icon_canvas_target");
++  gtk_tool_item_set_tooltip_text(tool_item, _("Leave crosshairs on views"));
++  gtk_actionable_set_action_name(GTK_ACTIONABLE(tool_item), "win.target");
++  gtk_toolbar_insert(GTK_TOOLBAR(toolbar), tool_item, -1);
++
++  ui_common_toolbar_append_separator(toolbar);
++
++  tool_item = gtk_toggle_tool_button_new();
++  gtk_tool_button_set_label(GTK_TOOL_BUTTON(tool_item), _("Transverse"));
++  gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(tool_item),
++                                "amide_icon_view_transverse");
++  gtk_tool_item_set_tooltip_text(tool_item, _("Enable transverse view"));
++  gtk_actionable_set_detailed_action_name(GTK_ACTIONABLE(tool_item),
++                                          "win.view-transverse");
++  g_object_set_data(G_OBJECT(ui_study->canvas_visible_action[AMITK_VIEW_TRANSVERSE]),
++                    "button", tool_item);
++  gtk_toolbar_insert(GTK_TOOLBAR(toolbar), tool_item, -1);
++  tool_item = gtk_toggle_tool_button_new();
++  gtk_tool_button_set_label(GTK_TOOL_BUTTON(tool_item), _("Coronal"));
++  gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(tool_item),
++                                "amide_icon_view_coronal");
++  gtk_tool_item_set_tooltip_text(tool_item, _("Enable coronal view"));
++  gtk_actionable_set_detailed_action_name(GTK_ACTIONABLE(tool_item),
++                                          "win.view-coronal");
++  g_object_set_data(G_OBJECT(ui_study->canvas_visible_action[AMITK_VIEW_CORONAL]),
++                    "button", tool_item);
++  gtk_toolbar_insert(GTK_TOOLBAR(toolbar), tool_item, -1);
++  tool_item = gtk_toggle_tool_button_new();
++  gtk_tool_button_set_label(GTK_TOOL_BUTTON(tool_item), _("Sagittal"));
++  gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(tool_item),
++                           "amide_icon_view_sagittal");
++  gtk_tool_item_set_tooltip_text(tool_item, _("Enable sagittal view"));
++  gtk_actionable_set_detailed_action_name(GTK_ACTIONABLE(tool_item),
++                                          "win.view-sagittal");
++  g_object_set_data(G_OBJECT(ui_study->canvas_visible_action[AMITK_VIEW_SAGITTAL]),
++                    "button", tool_item);
++  gtk_toolbar_insert(GTK_TOOLBAR(toolbar), tool_item, -1);
++
++  ui_common_toolbar_append_separator(toolbar);
++
++  tool_item = gtk_radio_tool_button_new(NULL);
++  gtk_tool_button_set_label(GTK_TOOL_BUTTON(tool_item), _("Single"));
++  gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(tool_item),
++                                 "amide_icon_view_mode_single");
++  gtk_tool_item_set_tooltip_text(tool_item,
++                                 _("All objects are shown in a single view"));
++  gtk_actionable_set_detailed_action_name(GTK_ACTIONABLE(tool_item),
++                                          "win.view-mode(0)");
++  gtk_toolbar_insert(GTK_TOOLBAR(toolbar), tool_item, -1);
++  tool_item =
++    gtk_radio_tool_button_new_from_widget(GTK_RADIO_TOOL_BUTTON(tool_item));
++  gtk_tool_button_set_label(GTK_TOOL_BUTTON(tool_item), _("2-way"));
++  gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(tool_item),
++                                "amide_icon_view_mode_linked_2way");
++  gtk_tool_item_set_tooltip_text(tool_item,
++                                 _("Objects are shown between 2 linked views"));
++  gtk_actionable_set_detailed_action_name(GTK_ACTIONABLE(tool_item),
++                                          "win.view-mode(1)");
++  gtk_toolbar_insert(GTK_TOOLBAR(toolbar), tool_item, -1);
++  tool_item =
++    gtk_radio_tool_button_new_from_widget(GTK_RADIO_TOOL_BUTTON(tool_item));
++  gtk_tool_button_set_label(GTK_TOOL_BUTTON(tool_item), _("3-way"));
++  gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(tool_item),
++                                "amide_icon_view_mode_linked_3way");
++  gtk_tool_item_set_tooltip_text(tool_item,
++                                 _("Objects are shown between 3 linked views"));
++  gtk_actionable_set_detailed_action_name(GTK_ACTIONABLE(tool_item),
++                                          "win.view-mode(2)");
++  gtk_toolbar_insert(GTK_TOOLBAR(toolbar), tool_item, -1);
++
++  ui_common_toolbar_append_separator(toolbar);
++
++  icon = gtk_image_new_from_icon_name("amide_icon_thresholding",
++                                      GTK_ICON_SIZE_LARGE_TOOLBAR);
++  tool_item = gtk_tool_button_new(icon, _("_Threshold"));
++  gtk_tool_item_set_tooltip_text(tool_item,
++                                 _("Set the thresholds and colormaps for the active data set"));
++  gtk_actionable_set_action_name(GTK_ACTIONABLE(tool_item), "win.thresholding");
++  gtk_toolbar_insert(GTK_TOOLBAR(toolbar), tool_item, -1);
+ 
+   /* and finish off the rest of the toolbar */
+   /* starting with a separator for clarity */
+@@ -1087,13 +1037,17 @@
+ 
+ void ui_study_update_canvas_visible_buttons(ui_study_t * ui_study) {
+ 
++  GVariant * state;
+   AmitkView i_view;
+ 
+   for (i_view=0; i_view < AMITK_VIEW_NUM; i_view++) {
+     g_signal_handlers_block_by_func(G_OBJECT(ui_study->canvas_visible_action[i_view]),
+ 				    G_CALLBACK(ui_study_cb_canvas_visible), ui_study);
+-    gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(ui_study->canvas_visible_action[i_view]),
+-				 AMITK_STUDY_CANVAS_VISIBLE(ui_study->study, i_view));
++    state = g_variant_new_boolean(AMITK_STUDY_CANVAS_VISIBLE(ui_study->study,
++                                                             i_view));
++    g_simple_action_set_state(G_SIMPLE_ACTION
++                              (ui_study->canvas_visible_action[i_view]),
++                              state);
+     g_signal_handlers_unblock_by_func(G_OBJECT(ui_study->canvas_visible_action[i_view]),
+ 				      G_CALLBACK(ui_study_cb_canvas_visible), ui_study);
+ 
+@@ -1142,6 +1096,7 @@
+ void ui_study_update_help_info(ui_study_t * ui_study, AmitkHelpInfo which_info, 
+ 			       AmitkPoint point, amide_data_t value) {
+ 
++  GooCanvasItem * root;
+   help_info_line_t i_line;
+   gchar * location_text[2];
+   gchar * legend;
+@@ -1150,6 +1105,7 @@
+ 
+   /* put up the help lines... except for the given info types, in which case
+      we leave the last one displayed up */
++  root = goo_canvas_get_root_item(GOO_CANVAS(ui_study->help_info));
+   if ((which_info != AMITK_HELP_INFO_UPDATE_LOCATION) &&
+       (which_info != AMITK_HELP_INFO_UPDATE_SHIFT) &&
+       (which_info != AMITK_HELP_INFO_UPDATE_THETA)) {
+@@ -1173,17 +1129,14 @@
+       }
+       if (ui_study->help_legend[i_line] == NULL) 
+ 	ui_study->help_legend[i_line] = 
+-	  gnome_canvas_item_new(gnome_canvas_root(ui_study->help_info),
+-				gnome_canvas_text_get_type(),
+-				"justification", GTK_JUSTIFY_RIGHT,
+-				"anchor", GTK_ANCHOR_NORTH_EAST,
+-				"text", legend,
+-				"x", (gdouble) 55.0,
+-				"y", (gdouble) (i_line*HELP_INFO_LINE_HEIGHT),
+-				"fill_color", "black", 
+-				"font_desc", amitk_fixed_font_desc, NULL);
++          goo_canvas_text_new(root, legend, 55.0,
++                              (gdouble) (i_line*HELP_INFO_LINE_HEIGHT),
++                              -1, GOO_CANVAS_ANCHOR_NORTH_EAST,
++                              "alignment", PANGO_ALIGN_RIGHT,
++                              "fill-color", "black",
++                              "font-desc", amitk_fixed_font_desc, NULL);
+       else /* just need to change the text */
+-	gnome_canvas_item_set(ui_study->help_legend[i_line], "text", legend, NULL);
++	g_object_set(ui_study->help_legend[i_line], "text", legend, NULL);
+       
+       /* gettext can't handle "" */
+       if (g_strcmp0(help_info_lines[which_info][i_line],"") != 0)
+@@ -1194,17 +1147,13 @@
+       /* and the button info */
+       if (ui_study->help_line[i_line] == NULL) 
+ 	ui_study->help_line[i_line] = 
+-	  gnome_canvas_item_new(gnome_canvas_root(ui_study->help_info),
+-				gnome_canvas_text_get_type(),
+-				"justification", GTK_JUSTIFY_LEFT,
+-				"anchor", GTK_ANCHOR_NORTH_WEST,
+-				"text", help_info_line,
+-				"x", (gdouble) 65.0,
+-				"y", (gdouble) (i_line*HELP_INFO_LINE_HEIGHT),
+-				"fill_color", "black", 
+-				"font_desc", amitk_fixed_font_desc, NULL);
++          goo_canvas_text_new(root, help_info_line, 65.0,
++                              (gdouble) (i_line*HELP_INFO_LINE_HEIGHT),
++                              -1, GOO_CANVAS_ANCHOR_NORTH_WEST,
++                              "fill-color", "black",
++                              "font-desc", amitk_fixed_font_desc, NULL);
+       else /* just need to change the text */
+-	gnome_canvas_item_set(ui_study->help_line[i_line], "text", 
++	g_object_set(ui_study->help_line[i_line], "text",
+ 			      help_info_line, NULL);
+     }
+   }
+@@ -1239,18 +1188,15 @@
+   for (i_line=HELP_INFO_LINE_LOCATION1; i_line <= HELP_INFO_LINE_LOCATION2;i_line++) {
+     if (ui_study->help_line[i_line] == NULL) 
+       ui_study->help_line[i_line] =
+-	gnome_canvas_item_new(gnome_canvas_root(ui_study->help_info),
+-			      gnome_canvas_text_get_type(),
+-			      "justification", GTK_JUSTIFY_LEFT,
+-			      "anchor", GTK_ANCHOR_NORTH_WEST,
+-			      "text", location_text[i_line-HELP_INFO_LINE_LOCATION1],
+-			      "x", (gdouble) 2.0,
+-			      "y", (gdouble) (i_line*HELP_INFO_LINE_HEIGHT),
+-			      "fill_color", "black",
+-			      "font_desc", amitk_fixed_font_desc, NULL);
++        goo_canvas_text_new(root,
++                            location_text[i_line-HELP_INFO_LINE_LOCATION1],
++                            2.0, (gdouble) (i_line*HELP_INFO_LINE_HEIGHT),
++                            -1, GOO_CANVAS_ANCHOR_NORTH_WEST,
++                            "fill-color", "black",
++                            "font-desc", amitk_fixed_font_desc, NULL);
+ 
+     else /* just need to change the text */
+-      gnome_canvas_item_set(ui_study->help_line[i_line], "text", 
++      g_object_set(ui_study->help_line[i_line], "text",
+ 			    location_text[i_line-HELP_INFO_LINE_LOCATION1],  NULL);
+ 
+     g_free(location_text[i_line-HELP_INFO_LINE_LOCATION1]);
+@@ -1340,11 +1286,14 @@
+ /* updates the settings of the canvas target button */
+ void ui_study_update_canvas_target(ui_study_t * ui_study) {
+ 
++  GVariant * state;
++
+   g_signal_handlers_block_by_func(G_OBJECT(ui_study->canvas_target_action),
+ 				  G_CALLBACK(ui_study_cb_canvas_target), ui_study);
+   
+-  gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(ui_study->canvas_target_action),
+-			       AMITK_STUDY_CANVAS_TARGET(ui_study->study));
++  state = g_variant_new_boolean(AMITK_STUDY_CANVAS_TARGET(ui_study->study));
++  g_simple_action_set_state(G_SIMPLE_ACTION(ui_study->canvas_target_action),
++                            state);
+   
+   g_signal_handlers_unblock_by_func(G_OBJECT(ui_study->canvas_target_action),
+ 				    G_CALLBACK(ui_study_cb_canvas_target), ui_study);
+@@ -1355,38 +1304,35 @@
+ 
+ void ui_study_update_fuse_type(ui_study_t * ui_study) {
+ 
+-  AmitkFuseType i_fuse_type;
++  GVariant * state;
+   
+   g_return_if_fail(ui_study->study != NULL);
+ 
+-  for (i_fuse_type = 0; i_fuse_type < AMITK_FUSE_TYPE_NUM; i_fuse_type++) 
+-    g_signal_handlers_block_by_func(G_OBJECT(ui_study->fuse_type_action[i_fuse_type]),
++  g_signal_handlers_block_by_func(ui_study->fuse_type_action,
+ 				    G_CALLBACK(ui_study_cb_fuse_type), ui_study);
+ 
+-  gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(ui_study->fuse_type_action[AMITK_STUDY_FUSE_TYPE(ui_study->study)]),
+-			       TRUE);
++  state = g_variant_new_int32(AMITK_STUDY_FUSE_TYPE(ui_study->study));
++  g_simple_action_set_state(G_SIMPLE_ACTION(ui_study->fuse_type_action),
++                            state);
+ 
+-  for (i_fuse_type = 0; i_fuse_type < AMITK_FUSE_TYPE_NUM; i_fuse_type++)
+-    g_signal_handlers_unblock_by_func(G_OBJECT(ui_study->fuse_type_action[i_fuse_type]),
++  g_signal_handlers_unblock_by_func(ui_study->fuse_type_action,
+ 				      G_CALLBACK(ui_study_cb_fuse_type),  ui_study);
+ 
+ }
+ 
+ void ui_study_update_view_mode(ui_study_t * ui_study) {
+ 
+-  AmitkViewMode i_view_mode;
++  GVariant * state;
+ 
+   g_return_if_fail(ui_study->study != NULL);
+ 
+-  for (i_view_mode = 0; i_view_mode < AMITK_VIEW_MODE_NUM; i_view_mode++) 
+-    g_signal_handlers_block_by_func(G_OBJECT(ui_study->view_mode_action[i_view_mode]),
++  g_signal_handlers_block_by_func(ui_study->view_mode_action,
+ 				   G_CALLBACK(ui_study_cb_view_mode), ui_study);
+ 
+-  gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(ui_study->view_mode_action[AMITK_STUDY_VIEW_MODE(ui_study->study)]),
+-			       TRUE);
++  state = g_variant_new_int32(AMITK_STUDY_VIEW_MODE(ui_study->study));
++  g_simple_action_set_state(G_SIMPLE_ACTION(ui_study->view_mode_action), state);
+   
+-  for (i_view_mode = 0; i_view_mode < AMITK_VIEW_MODE_NUM; i_view_mode++)
+-    g_signal_handlers_unblock_by_func(G_OBJECT(ui_study->view_mode_action[i_view_mode]),
++  g_signal_handlers_unblock_by_func(ui_study->view_mode_action,
+ 				      G_CALLBACK(ui_study_cb_view_mode),ui_study);
+ 
+ }
+@@ -1411,22 +1357,6 @@
+ 
+ }
+ 
+-/* taken/modified from gtkhandlebox.c - note, no reattach signal gets called when this is used */
+-static void handle_box_reattach (GtkHandleBox *hb) {
+-  GtkWidget *widget = GTK_WIDGET (hb);
+-  
+-  if (hb->child_detached) {
+-    hb->child_detached = FALSE;
+-    if (GTK_WIDGET_REALIZED (hb)) {
+-      gdk_window_hide (hb->float_window);
+-      gdk_window_reparent (hb->bin_window, widget->window, 0, 0);
+-
+-    }
+-    hb->float_window_mapped = FALSE;
+-  }
+-  gtk_widget_queue_resize (GTK_WIDGET (hb));
+-}
+-
+ 
+ void ui_study_update_layout(ui_study_t * ui_study) {
+ 
+@@ -1444,8 +1374,6 @@
+     if (ui_study->canvas_table[i_view_mode] != NULL) {
+       gtk_widget_destroy(ui_study->canvas_table[i_view_mode]);
+       ui_study->canvas_table[i_view_mode] = NULL;
+-      gtk_widget_destroy(ui_study->canvas_handle[i_view_mode]);
+-      ui_study->canvas_handle[i_view_mode] = NULL;
+       for (i_view=0; i_view < AMITK_VIEW_NUM; i_view++)
+ 	ui_study->canvas[i_view_mode][i_view] = NULL;
+     }
+@@ -1464,37 +1392,15 @@
+   for (i_view_mode = 0; i_view_mode <= AMITK_STUDY_VIEW_MODE(ui_study->study); i_view_mode++) {
+ 
+     if (ui_study->canvas_table[i_view_mode] == NULL) {
+-      ui_study->canvas_table[i_view_mode] = gtk_table_new(3, 2,FALSE);
++      ui_study->canvas_table[i_view_mode] = gtk_grid_new();
++      gtk_grid_set_row_spacing(GTK_GRID(ui_study->canvas_table[i_view_mode]),
++                               Y_PADDING);
++      gtk_grid_set_column_spacing(GTK_GRID(ui_study->canvas_table[i_view_mode]),
++                                  X_PADDING);
+       
+       // scrolled = gtk_scrolled_window_new(NULL, NULL);
+       // gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+       // gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrolled), ui_study->canvas_table[i_view_mode]);
+-
+-      ui_study->canvas_handle[i_view_mode] = gtk_handle_box_new();
+-      g_object_ref(G_OBJECT(ui_study->canvas_handle[i_view_mode])); /* gets removed below */
+-      gtk_handle_box_set_shadow_type(GTK_HANDLE_BOX(ui_study->canvas_handle[i_view_mode]), GTK_SHADOW_NONE);
+-      gtk_handle_box_set_handle_position(GTK_HANDLE_BOX(ui_study->canvas_handle[i_view_mode]), GTK_POS_TOP);
+-      gtk_container_add(GTK_CONTAINER(ui_study->canvas_handle[i_view_mode]), ui_study->canvas_table[i_view_mode]);
+-      //      gtk_container_add(GTK_CONTAINER(ui_study->canvas_handle[i_view_mode]), scrolled);
+-
+-    } else {
+-      g_return_if_fail(ui_study->canvas_handle[i_view_mode] != NULL);
+-
+-      /* extra ref so widget not destroyed on container_remove  - gets removed below */
+-      g_object_ref(G_OBJECT(ui_study->canvas_handle[i_view_mode])); 
+-
+-      /* note, ui_study->panel_layout doesn't get set till end of function, but first time
+-	 through this function we never hit this condition */
+-      if (ui_study->panel_layout != AMITK_STUDY_PANEL_LAYOUT(ui_study->study)) {
+-
+-	/* hack! to force handle box to reattach.  If we don't force a reattach,
+-	   the widget doesn't get enough size allocated to it on the gtk_table_attach
+-	   that follows */
+-	handle_box_reattach(GTK_HANDLE_BOX(ui_study->canvas_handle[i_view_mode])); 
+-
+-	gtk_container_remove(GTK_CONTAINER(ui_study->center_table),
+-			     ui_study->canvas_handle[i_view_mode]);
+-      }
+     }
+ 
+ 
+@@ -1544,42 +1450,53 @@
+     case AMITK_LAYOUT_ORTHOGONAL:
+       row = column = 0;
+       if (ui_study->canvas[i_view_mode][AMITK_VIEW_TRANSVERSE] != NULL) {
+-	if (gtk_widget_get_parent(ui_study->canvas[i_view_mode][AMITK_VIEW_TRANSVERSE]) == NULL)
+-	  gtk_table_attach(GTK_TABLE(ui_study->canvas_table[i_view_mode]), 
+-			   ui_study->canvas[i_view_mode][AMITK_VIEW_TRANSVERSE], 
+-			   column,column+1, row,row+1,FALSE,FALSE, X_PADDING, Y_PADDING);
++        if (gtk_widget_get_parent(ui_study->canvas[i_view_mode][AMITK_VIEW_TRANSVERSE]) == NULL) {
++          gtk_widget_set_valign(ui_study->canvas[i_view_mode][AMITK_VIEW_TRANSVERSE],
++                                GTK_ALIGN_CENTER);
++          gtk_grid_attach(GTK_GRID(ui_study->canvas_table[i_view_mode]),
++                          ui_study->canvas[i_view_mode][AMITK_VIEW_TRANSVERSE],
++                          column, row, 1, 1);
++        }
+ 	row++;
+       }
+       if (ui_study->canvas[i_view_mode][AMITK_VIEW_CORONAL] != NULL) {
+-	if (gtk_widget_get_parent(ui_study->canvas[i_view_mode][AMITK_VIEW_CORONAL]) == NULL)
+-	  gtk_table_attach(GTK_TABLE(ui_study->canvas_table[i_view_mode]), 
+-			   ui_study->canvas[i_view_mode][AMITK_VIEW_CORONAL], 
+-			   column, column+1, row, row+1, FALSE,FALSE, X_PADDING, Y_PADDING);
++        if (gtk_widget_get_parent(ui_study->canvas[i_view_mode][AMITK_VIEW_CORONAL]) == NULL) {
++          gtk_widget_set_valign(ui_study->canvas[i_view_mode][AMITK_VIEW_CORONAL],
++                                GTK_ALIGN_CENTER);
++          gtk_grid_attach(GTK_GRID(ui_study->canvas_table[i_view_mode]),
++                          ui_study->canvas[i_view_mode][AMITK_VIEW_CORONAL],
++                          column, row, 1, 1);
++        }
+       }
+       row = 0;
+       column++;
+       if (ui_study->canvas[i_view_mode][AMITK_VIEW_SAGITTAL] != NULL)
+-	if (gtk_widget_get_parent(ui_study->canvas[i_view_mode][AMITK_VIEW_SAGITTAL]) == NULL)
+-	  gtk_table_attach(GTK_TABLE(ui_study->canvas_table[i_view_mode]), 
+-			   ui_study->canvas[i_view_mode][AMITK_VIEW_SAGITTAL], 
+-			   column, column+1,row, row+1, FALSE,FALSE, X_PADDING, Y_PADDING);
++        if (gtk_widget_get_parent(ui_study->canvas[i_view_mode][AMITK_VIEW_SAGITTAL]) == NULL) {
++          gtk_widget_set_valign(ui_study->canvas[i_view_mode][AMITK_VIEW_SAGITTAL],
++                                GTK_ALIGN_CENTER);
++          gtk_grid_attach(GTK_GRID(ui_study->canvas_table[i_view_mode]),
++                          ui_study->canvas[i_view_mode][AMITK_VIEW_SAGITTAL],
++                          column, row, 1, 1);
++        }
+ 
+       break;
+     case AMITK_LAYOUT_LINEAR:
+     default:
+       for (i_view=0;i_view< AMITK_VIEW_NUM;i_view++)
+ 	if (ui_study->canvas[i_view_mode][i_view] != NULL)
+-	  if (gtk_widget_get_parent(ui_study->canvas[i_view_mode][i_view]) == NULL)
+-	    gtk_table_attach(GTK_TABLE(ui_study->canvas_table[i_view_mode]), 
+-			     ui_study->canvas[i_view_mode][i_view], 
+-			     i_view, i_view+1, 0,1, FALSE, FALSE, X_PADDING, Y_PADDING);
++          if (gtk_widget_get_parent(ui_study->canvas[i_view_mode][i_view]) == NULL) {
++            gtk_widget_set_valign(ui_study->canvas[i_view_mode][i_view],
++                                  GTK_ALIGN_CENTER);
++            gtk_grid_attach(GTK_GRID(ui_study->canvas_table[i_view_mode]),
++                            ui_study->canvas[i_view_mode][i_view],
++                            i_view, 0, 1, 1);
++          }
+ 
+       break;
+     }
+ 
+ 
+-    /* place the handleboxes */
+-    if (gtk_widget_get_parent(ui_study->canvas_handle[i_view_mode]) == NULL) {
++    if (gtk_widget_get_parent(ui_study->canvas_table[i_view_mode]) == NULL) {
+ 
+       switch(AMITK_STUDY_PANEL_LAYOUT(ui_study->study)) {
+       case AMITK_PANEL_LAYOUT_LINEAR_X:
+@@ -1597,10 +1514,9 @@
+ 	break;
+       }
+ 
+-      gtk_table_attach(GTK_TABLE(ui_study->center_table), ui_study->canvas_handle[i_view_mode],
+-		       table_column, table_column+1, table_row, table_row+1,
+-		       X_PACKING_OPTIONS | GTK_FILL, Y_PACKING_OPTIONS | GTK_FILL,  
+-		       X_PADDING, Y_PADDING);
++      gtk_grid_attach(GTK_GRID(ui_study->center_table),
++                      ui_study->canvas_table[i_view_mode],
++                      table_column, table_row, 1, 1);
+ 
+     }
+ 
+@@ -1608,9 +1524,8 @@
+     for (i_view = 0; i_view < AMITK_VIEW_NUM; i_view++)
+       if (ui_study->canvas[i_view_mode][i_view] != NULL)
+ 	g_object_unref(G_OBJECT(ui_study->canvas[i_view_mode][i_view]));
+-    g_object_unref(ui_study->canvas_handle[i_view_mode]);
+ 
+-    gtk_widget_show_all(ui_study->canvas_handle[i_view_mode]); /* and show */
++    gtk_widget_show_all(ui_study->canvas_table[i_view_mode]); /* and show */
+       
+   }
+ 
+@@ -1627,22 +1542,16 @@
+   GtkWidget * scrolled;
+   GtkWidget * left_vbox;
+   GtkWidget * hbox;
+-  GtkWidget * handle_box;
+ 
+ 
+   /* the hbox that'll contain everything in the ui besides the menu and toolbar */
+-  hbox = gtk_hbox_new(FALSE,0);
++  hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL,0);
+   gtk_box_pack_start (GTK_BOX (ui_study->window_vbox), hbox, TRUE, TRUE, 0);
+ 
+   /* make and add the left packing table */
+-  left_vbox = gtk_vbox_new(FALSE,0);
+-
+-  handle_box = gtk_handle_box_new();
+-  gtk_handle_box_set_shadow_type(GTK_HANDLE_BOX(handle_box), GTK_SHADOW_NONE);
+-  gtk_handle_box_set_handle_position(GTK_HANDLE_BOX(handle_box), GTK_POS_TOP);
+-  gtk_container_add(GTK_CONTAINER(handle_box), left_vbox);
++  left_vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
+ 
+-  gtk_box_pack_start(GTK_BOX(hbox), handle_box, FALSE, FALSE, X_PADDING);
++  gtk_box_pack_start(GTK_BOX(hbox), left_vbox, FALSE, FALSE, X_PADDING);
+ 
+   /* connect the blank help signal */
+   g_object_set_data(G_OBJECT(ui_study->window), "which_help", GINT_TO_POINTER(AMITK_HELP_INFO_BLANK));
+@@ -1669,26 +1578,24 @@
+   gtk_widget_set_size_request(scrolled,LEFT_COLUMN_WIDTH,250);
+   gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled), 
+ 				 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+-  gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrolled), 
+-					ui_study->tree_view);
++  gtk_container_add(GTK_CONTAINER(scrolled), ui_study->tree_view);
+   gtk_box_pack_start(GTK_BOX(left_vbox), scrolled, TRUE, TRUE,Y_PADDING);
+ 
+ 
+   /* the help information canvas */
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+-  ui_study->help_info = GNOME_CANVAS(gnome_canvas_new_aa());
+-#else
+-  ui_study->help_info = GNOME_CANVAS(gnome_canvas_new());
+-#endif
++  ui_study->help_info = GOO_CANVAS(goo_canvas_new());
+   gtk_box_pack_start(GTK_BOX(left_vbox), GTK_WIDGET(ui_study->help_info), FALSE, TRUE, Y_PADDING);
+   gtk_widget_set_size_request(GTK_WIDGET(ui_study->help_info), LEFT_COLUMN_WIDTH,
+ 			      HELP_INFO_LINE_HEIGHT*NUM_HELP_INFO_LINES+2);
+-  gnome_canvas_set_scroll_region(ui_study->help_info, 0.0, 0.0, LEFT_COLUMN_WIDTH, 
++  goo_canvas_set_bounds(ui_study->help_info, 0.0, 0.0, LEFT_COLUMN_WIDTH,
+ 				 HELP_INFO_LINE_HEIGHT*NUM_HELP_INFO_LINES+2.0);
+ 
+   /* make the stuff in the center */
+-  ui_study->center_table = gtk_table_new(2, 2,FALSE);
++  ui_study->center_table = gtk_grid_new();
++  gtk_grid_set_row_spacing(GTK_GRID(ui_study->center_table), Y_PADDING);
++  gtk_grid_set_column_spacing(GTK_GRID(ui_study->center_table), X_PADDING);
+   gtk_box_pack_start(GTK_BOX(hbox),ui_study->center_table, TRUE, TRUE, X_PADDING);
++  gtk_widget_show(ui_study->center_table);
+   
+   return;
+ }
+@@ -1712,18 +1619,21 @@
+ 
+   ui_study_t * ui_study;
+   GdkPixbuf * pixbuf;
++  GtkApplication * app;
+ 
+   g_return_val_if_fail(preferences != NULL, NULL);
+ 
+   ui_study = ui_study_init(preferences);
++  app = GTK_APPLICATION(g_application_get_default());
+ 
+   /* setup the study window */
+-  ui_study->window = GTK_WINDOW(gtk_window_new(GTK_WINDOW_TOPLEVEL));
+-  ui_study->window_vbox = gtk_vbox_new(FALSE,0);
++  ui_study->window = GTK_WINDOW(gtk_application_window_new(app));
++  ui_study->window_vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL,0);
+   gtk_container_add(GTK_CONTAINER (ui_study->window), ui_study->window_vbox);
+ 
+   /* set the icon that the window manager knows about */
+-  pixbuf = gtk_widget_render_icon(GTK_WIDGET(ui_study->window), "amide_icon_logo", -1, 0);
++  pixbuf = gtk_icon_theme_load_icon(gtk_icon_theme_get_default(),
++                                    "amide_icon_logo", 90, 0, NULL);
+   gtk_window_set_icon(ui_study->window, pixbuf);
+   gtk_window_set_default_icon(pixbuf); /* sets it as the default for all additional windows */
+   g_object_unref(pixbuf);
+--- amide.orig/amide-current/src/ui_study_cb.c
++++ amide/amide-current/src/ui_study_cb.c
+@@ -78,8 +78,8 @@
+   temp_string = g_strdup_printf(_("%s: Pick Object(s) to Import"), PACKAGE);
+   dialog = gtk_dialog_new_with_buttons (temp_string,  ui_study->window,
+ 					GTK_DIALOG_DESTROY_WITH_PARENT,
+-					GTK_STOCK_EXECUTE, AMITK_RESPONSE_EXECUTE,
+-					GTK_STOCK_CANCEL, GTK_RESPONSE_CLOSE, NULL);
++					_("_Execute"), AMITK_RESPONSE_EXECUTE,
++					_("_Cancel"), GTK_RESPONSE_CLOSE, NULL);
+   gtk_window_set_title(GTK_WINDOW(dialog), temp_string);
+   g_free(temp_string);
+ 
+@@ -89,9 +89,12 @@
+   gtk_container_set_border_width(GTK_CONTAINER(dialog), 10);
+ 
+   /* start making the widgets for this dialog box */
+-  table = gtk_table_new(5,2,FALSE);
++  table = gtk_grid_new();
++  gtk_grid_set_row_spacing(GTK_GRID(table), Y_PADDING);
++  gtk_grid_set_column_spacing(GTK_GRID(table), X_PADDING);
+   table_row=0;
+-  gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), table);
++  gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area
++                                  (GTK_DIALOG(dialog))), table);
+ 
+   tree_view = amitk_tree_view_new(AMITK_TREE_VIEW_MODE_MULTIPLE_SELECTION,NULL, NULL);
+   g_object_set_data(G_OBJECT(dialog), "tree_view", tree_view);
+@@ -103,10 +106,8 @@
+   gtk_widget_set_size_request(scrolled,250,250);
+   gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled), 
+ 				 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+-  gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrolled), 
+-					tree_view);
+-  gtk_table_attach(GTK_TABLE(table), scrolled, 0,2,
+-		   table_row, table_row+1,GTK_FILL, GTK_FILL | GTK_EXPAND, X_PADDING, Y_PADDING);
++  gtk_container_add(GTK_CONTAINER(scrolled), tree_view);
++  gtk_grid_attach(GTK_GRID(table), scrolled, 0, table_row, 2, 1);
+   table_row++;
+ 
+   /* and show all our widgets */
+@@ -170,8 +171,8 @@
+   file_chooser = gtk_file_chooser_dialog_new (recovery_mode ? _("Recover AMIDE XIF FILE") : _("Open AMIDE XIF File"),
+ 					      GTK_WINDOW(ui_study->window), /* parent window */
+ 					      as_directory ? GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER : GTK_FILE_CHOOSER_ACTION_OPEN, 
+-					      GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+-					      GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
++					      _("_Cancel"), GTK_RESPONSE_CANCEL,
++					      _("_Open"), GTK_RESPONSE_ACCEPT,
+ 					      NULL);
+   gtk_file_chooser_set_local_only(GTK_FILE_CHOOSER(file_chooser), TRUE);
+   amitk_preferences_set_file_chooser_directory(ui_study->preferences, file_chooser); /* set the default directory if applicable */
+@@ -221,31 +222,31 @@
+ } 
+ 
+ /* function to load a study into the  study widget */
+-void ui_study_cb_open_xif_file(GtkAction * action, gpointer data) {
++void ui_study_cb_open_xif_file(GSimpleAction * action, GVariant * param, gpointer data) {
+   ui_study_t * ui_study=data;
+   read_xif(ui_study, FALSE, FALSE, FALSE);
+   return;
+ }
+-void ui_study_cb_open_xif_dir(GtkAction * action, gpointer data) {
++void ui_study_cb_open_xif_dir(GSimpleAction * action, GVariant * param, gpointer data) {
+   ui_study_t * ui_study=data;
+   read_xif(ui_study, FALSE, TRUE, FALSE);
+   return;
+ }
+ 
+ /* function to load an object from a pre-existing study into the current study widget */
+-void ui_study_cb_import_object_from_xif_file(GtkAction * action, gpointer data) {
++void ui_study_cb_import_object_from_xif_file(GSimpleAction * action, GVariant * param, gpointer data) {
+   ui_study_t * ui_study = data;
+   read_xif(ui_study, TRUE, FALSE, FALSE);
+   return;
+ }
+-void ui_study_cb_import_object_from_xif_dir(GtkAction * action, gpointer data) {
++void ui_study_cb_import_object_from_xif_dir(GSimpleAction * action, GVariant * param, gpointer data) {
+   ui_study_t * ui_study = data;
+   read_xif(ui_study, TRUE, TRUE, FALSE);
+   return;
+ }
+ 
+ /* try to recover portions of a study file */
+-void ui_study_cb_recover_xif_file(GtkAction * action, gpointer data) {
++void ui_study_cb_recover_xif_file(GSimpleAction * action, GVariant * param, gpointer data) {
+   ui_study_t * ui_study=data;
+   read_xif(ui_study, FALSE, FALSE, TRUE);
+   return;
+@@ -253,7 +254,7 @@
+ 
+ 
+ /* function to create a new study widget */
+-void ui_study_cb_new_study(GtkAction * action, gpointer data) {
++void ui_study_cb_new_study(GSimpleAction * action, GVariant * param, gpointer data) {
+   ui_study_t * ui_study = data;
+   ui_study_create(NULL, ui_study->preferences);
+   return;
+@@ -323,8 +324,8 @@
+   file_chooser = gtk_file_chooser_dialog_new (_("Save AMIDE XIF File"),
+ 					      GTK_WINDOW(ui_study->window), /* parent window */
+ 					      as_directory ? GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER : GTK_FILE_CHOOSER_ACTION_SAVE, 
+-					      GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+-					      GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
++					      _("_Cancel"), GTK_RESPONSE_CANCEL,
++					      _("_Save"), GTK_RESPONSE_ACCEPT,
+ 					      NULL);
+   gtk_file_chooser_set_local_only(GTK_FILE_CHOOSER(file_chooser), TRUE);
+ 
+@@ -405,19 +406,19 @@
+   g_free(final_filename);
+ }
+ 
+-void ui_study_cb_save_as_xif_file(GtkAction * action, gpointer data) {
++void ui_study_cb_save_as_xif_file(GSimpleAction * action, GVariant * param, gpointer data) {
+   ui_study_t * ui_study = data;
+   save_xif(ui_study, FALSE);
+   return;
+ }
+-void ui_study_cb_save_as_xif_dir(GtkAction * action, gpointer data) {
++void ui_study_cb_save_as_xif_dir(GSimpleAction * action, GVariant * param, gpointer data) {
+   ui_study_t * ui_study = data;
+   save_xif(ui_study, TRUE);
+   return;
+ }
+ 
+ /* function to selection which file to import */
+-void ui_study_cb_import(GtkAction * action, gpointer data) {
++void ui_study_cb_import(GSimpleAction * action, GVariant * param, gpointer data) {
+ 
+   ui_study_t * ui_study = data;
+   GtkWidget * file_chooser;
+@@ -432,8 +433,8 @@
+   file_chooser = gtk_file_chooser_dialog_new (_("Import File"),
+ 					      GTK_WINDOW(ui_study->window), /* parent window */
+ 					      GTK_FILE_CHOOSER_ACTION_OPEN,
+-					      GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+-					      GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
++					      _("_Cancel"), GTK_RESPONSE_CANCEL,
++					      _("_Open"), GTK_RESPONSE_ACCEPT,
+ 					      NULL);
+   gtk_file_chooser_set_local_only(GTK_FILE_CHOOSER(file_chooser), TRUE);
+   amitk_preferences_set_file_chooser_directory(ui_study->preferences, file_chooser); /* set the default directory if applicable */
+@@ -456,8 +457,7 @@
+ #endif
+ 
+   /* method we're trying to use to read in the file */
+-  method = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(action), "method"));
+-  submethod = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(action), "submethod"));
++  g_variant_get(param, "(ii)", &method, &submethod);
+   
+   ui_common_place_cursor(UI_CURSOR_WAIT, ui_study->canvas[AMITK_VIEW_MODE_SINGLE][AMITK_VIEW_TRANSVERSE]);
+ 
+@@ -499,7 +499,7 @@
+     
+ 
+ /* function to selection which file to export to */
+-void ui_study_cb_export_data_set(GtkAction * action, gpointer data) {
++void ui_study_cb_export_data_set(GSimpleAction * action, GVariant * param, gpointer data) {
+   ui_study_t * ui_study = data;
+ 
+   if (!AMITK_IS_DATA_SET(ui_study->active_object)) {
+@@ -517,7 +517,7 @@
+ }
+ 
+ /* function to save a view as an external data format */
+-void ui_study_cb_export_view(GtkAction * action, gpointer data) {
++void ui_study_cb_export_view(GSimpleAction * action, GVariant * param, gpointer data) {
+   
+   ui_study_t * ui_study = data;
+   GList * current_data_sets;
+@@ -543,15 +543,15 @@
+   file_chooser = gtk_file_chooser_dialog_new(_("Export to File"),
+ 					     GTK_WINDOW(ui_study->window), /* parent window */
+ 					     GTK_FILE_CHOOSER_ACTION_SAVE,
+-					     GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+-					     GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
++					     _("_Cancel"), GTK_RESPONSE_CANCEL,
++					     _("_Save"), GTK_RESPONSE_ACCEPT,
+ 					     NULL);
+   gtk_file_chooser_set_local_only(GTK_FILE_CHOOSER(file_chooser), TRUE);
+   gtk_file_chooser_set_do_overwrite_confirmation(GTK_FILE_CHOOSER (file_chooser), TRUE);
+   amitk_preferences_set_file_chooser_directory(ui_study->preferences, file_chooser); /* set the default directory if applicable */
+ 
+ 
+-  view = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(action), "view"));
++  view = g_variant_get_int32(param);
+ 
+   if (ui_study->canvas[AMITK_VIEW_MODE_SINGLE][view] == NULL) return;
+ 
+@@ -960,7 +960,7 @@
+ 
+ 
+ /* callbacks for setting up a set of slices in a new window */
+-void ui_study_cb_series(GtkAction * action, gpointer data) {
++void ui_study_cb_series(GSimpleAction * action, GVariant * param, gpointer data) {
+ 
+   GtkWidget * dialog;
+   ui_study_t * ui_study = data;
+@@ -991,12 +991,12 @@
+ }
+ 
+ #if (AMIDE_FFMPEG_SUPPORT || AMIDE_LIBFAME_SUPPORT)
+-void ui_study_cb_fly_through(GtkAction * action, gpointer data) {
++void ui_study_cb_fly_through(GSimpleAction * action, GVariant * param, gpointer data) {
+ 
+   ui_study_t * ui_study = data;
+   AmitkView view;
+   
+-  view = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(action), "view"));
++  view = g_variant_get_int32(param);
+ 
+   tb_fly_through(ui_study->study, view, ui_study->preferences, ui_study->window);
+ 
+@@ -1006,7 +1006,7 @@
+ 
+ #ifdef AMIDE_LIBVOLPACK_SUPPORT
+ /* callback for starting up volume rendering */
+-void ui_study_cb_render(GtkAction * action, gpointer data) {
++void ui_study_cb_render(GSimpleAction * action, GVariant * param, gpointer data) {
+ 
+   GtkWidget * dialog;
+   ui_study_t * ui_study = data;
+@@ -1036,7 +1036,7 @@
+ 
+ 
+ /* do roi calculations */
+-void ui_study_cb_roi_statistics(GtkAction * action, gpointer data) {
++void ui_study_cb_roi_statistics(GSimpleAction * action, GVariant * param, gpointer data) {
+   ui_study_t * ui_study = data;
+   GtkWidget * dialog;
+   gint return_val;
+@@ -1059,7 +1059,7 @@
+ }
+ 
+ /* user wants to run the alignment wizard */
+-void ui_study_cb_alignment_selected(GtkAction * action, gpointer data) {
++void ui_study_cb_alignment_selected(GSimpleAction * action, GVariant * param, gpointer data) {
+   ui_study_t * ui_study = data;
+   tb_alignment(ui_study->study, ui_study->window);
+   return;
+@@ -1068,7 +1068,7 @@
+ 
+ 
+ /* user wants to run the crop wizard */
+-void ui_study_cb_crop_selected(GtkAction * action, gpointer data) {
++void ui_study_cb_crop_selected(GSimpleAction * action, GVariant * param, gpointer data) {
+   ui_study_t * ui_study = data;
+ 
+   if (!AMITK_IS_DATA_SET(ui_study->active_object)) 
+@@ -1079,7 +1079,7 @@
+ }
+ 
+ /* user wants to run the distance wizard */
+-void ui_study_cb_distance_selected(GtkAction * action, gpointer data) {
++void ui_study_cb_distance_selected(GSimpleAction * action, GVariant * param, gpointer data) {
+   ui_study_t * ui_study = data;
+ 
+   tb_distance(ui_study->study, ui_study->window);
+@@ -1088,7 +1088,7 @@
+ }
+ 
+ /* user wants to run the fads wizard */
+-void ui_study_cb_fads_selected(GtkAction * action, gpointer data) {
++void ui_study_cb_fads_selected(GSimpleAction * action, GVariant * param, gpointer data) {
+   ui_study_t * ui_study = data;
+ 
+   if (!AMITK_IS_DATA_SET(ui_study->active_object)) 
+@@ -1104,7 +1104,7 @@
+ }
+ 
+ /* user wants to run the filter wizard */
+-void ui_study_cb_filter_selected(GtkAction * action, gpointer data) {
++void ui_study_cb_filter_selected(GSimpleAction * action, GVariant * param, gpointer data) {
+   ui_study_t * ui_study = data;
+ 
+   if (!AMITK_IS_DATA_SET(ui_study->active_object)) 
+@@ -1116,7 +1116,7 @@
+ }
+ 
+ /* user wants to run the profile wizard */
+-void ui_study_cb_profile_selected(GtkAction * action, gpointer data) {
++void ui_study_cb_profile_selected(GSimpleAction * action, GVariant * param, gpointer data) {
+   ui_study_t * ui_study = data;
+ 
+   tb_profile(ui_study->study, ui_study->preferences, ui_study->window);
+@@ -1126,7 +1126,7 @@
+ 
+ 
+ /* user wants to run the image math wizard */
+-void ui_study_cb_data_set_math_selected(GtkAction * action, gpointer data) {
++void ui_study_cb_data_set_math_selected(GSimpleAction * action, GVariant * param, gpointer data) {
+   ui_study_t * ui_study = data;
+ 
+   tb_math(ui_study->study, ui_study->window);
+@@ -1146,16 +1146,18 @@
+ 
+ 
+ /* function called when target button toggled on toolbar */
+-void ui_study_cb_canvas_target(GtkToggleAction * action, gpointer data) {
++void ui_study_cb_canvas_target(GSimpleAction * action, GVariant * state, gpointer data) {
+ 
+   ui_study_t * ui_study = data;
+-  amitk_study_set_canvas_target(ui_study->study,
+-				gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(action)));  
++  gboolean val;
++
++  val = g_variant_get_boolean(state);
++  amitk_study_set_canvas_target(ui_study->study, val);
++  g_simple_action_set_state(action, state);
+ }
+ 
+ /* function called when hitting the threshold button, pops up a dialog */
+-void ui_study_cb_thresholding(GtkAction * action, gpointer data) {
+-
++void ui_study_cb_thresholding(GSimpleAction * action, GVariant * param, gpointer data) {
+   ui_study_t * ui_study = data;
+ 
+   if (!AMITK_IS_DATA_SET(ui_study->active_object)) return;
+@@ -1182,13 +1184,13 @@
+ }
+ 
+ /* callback function for adding an roi */
+-void ui_study_cb_add_roi(GtkWidget * widget, gpointer data) {
++void ui_study_cb_add_roi(GSimpleAction * action, GVariant * param, gpointer data) {
+ 
+   ui_study_t * ui_study = data;
+   AmitkRoiType roi_type;
+ 
+   /* figure out which menu item called me */
+-  roi_type = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(widget),"roi_type"));
++  roi_type = g_variant_get_int32(param);
+   ui_study_add_roi(ui_study, AMITK_OBJECT(ui_study->study), roi_type);
+ 
+   return;
+@@ -1196,7 +1198,7 @@
+ 
+ 
+ /* callback function for adding a fiducial mark */
+-void ui_study_cb_add_fiducial_mark(GtkAction * action, gpointer data) {
++void ui_study_cb_add_fiducial_mark(GSimpleAction * action, GVariant * param, gpointer data) {
+ 
+   ui_study_t * ui_study = data;
+ 
+@@ -1209,7 +1211,7 @@
+ }
+ 
+ /* callback function for changing user's preferences */
+-void ui_study_cb_preferences(GtkAction * action, gpointer data) {
++void ui_study_cb_preferences(GSimpleAction * action, GVariant * param, gpointer data) {
+ 
+   ui_study_t * ui_study=data;
+   ui_preferences_dialog_create(ui_study);
+@@ -1218,12 +1220,16 @@
+ 
+ 
+ /* function to switch the interpolation method */
+-void ui_study_cb_interpolation(GtkRadioAction * action, GtkRadioAction * current, gpointer data) {
++void ui_study_cb_interpolation(GSimpleAction * action, GVariant * state, gpointer data) {
+   ui_study_t * ui_study = data;
++  int val;
+   g_return_if_fail(AMITK_IS_DATA_SET(ui_study->active_object));
+ 
++  val = g_variant_get_int32(state);
+   amitk_data_set_set_interpolation(AMITK_DATA_SET(ui_study->active_object),
+-				   gtk_radio_action_get_current_value((GTK_RADIO_ACTION(current))));	
++                                   val);
++  g_simple_action_set_state(action, state);
++
+   return;
+ }
+ 
+@@ -1270,37 +1276,54 @@
+ }
+ 
+ /* function to switch the image fusion type */
+-void ui_study_cb_fuse_type(GtkRadioAction * action, GtkRadioAction * current, gpointer data) {
++void ui_study_cb_fuse_type(GSimpleAction * action, GVariant * state, gpointer data) {
+ 
+   ui_study_t * ui_study = data;
++  int val;
+ 
+-  amitk_study_set_fuse_type(ui_study->study,  
+-			    gtk_radio_action_get_current_value((GTK_RADIO_ACTION(current))));	
++  val = g_variant_get_int32(state);
++  amitk_study_set_fuse_type(ui_study->study, val);
+   ui_study_update_fuse_type(ui_study);
+ 				
+   return;
+ }
+ 
+-void ui_study_cb_canvas_visible(GtkToggleAction * action, gpointer data) {
++void ui_study_cb_canvas_visible(GSimpleAction * action, GVariant * state, gpointer data) {
+ 
+   ui_study_t * ui_study = data;
+ 
+   AmitkView view;
++  GtkToggleToolButton * button;
++  gboolean val;
++  const gchar * name;
++
++  val = g_variant_get_boolean(state);
++  name = g_action_get_name(G_ACTION(action));
++  if (g_str_has_suffix(name, "transverse"))
++    view = AMITK_VIEW_TRANSVERSE;
++  else if (g_str_has_suffix(name, "coronal"))
++    view = AMITK_VIEW_CORONAL;
++  else
++    view = AMITK_VIEW_SAGITTAL;
+ 
+-  view = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(action),"view"));
+-  amitk_study_set_canvas_visible(ui_study->study, view, 
+-				 gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(action)));
+-  ui_study_update_canvas_visible_buttons(ui_study);
++  if (!amitk_study_set_canvas_visible(ui_study->study, view, val)) {
++    button = GTK_TOGGLE_TOOL_BUTTON(g_object_get_data(G_OBJECT(action),
++                                                      "button"));
++    gtk_toggle_tool_button_set_active(button, TRUE);
++  } else {
++    ui_study_update_canvas_visible_buttons(ui_study);
++  }
+ 
+   return;
+ }
+ 
+-void ui_study_cb_view_mode(GtkRadioAction * action, GtkRadioAction * current, gpointer data) {
++void ui_study_cb_view_mode(GSimpleAction * action, GVariant * state, gpointer data) {
+ 
+   ui_study_t * ui_study = data;
++  gint val;
+ 
+-  amitk_study_set_view_mode(ui_study->study, 
+-			    gtk_radio_action_get_current_value((GTK_RADIO_ACTION(current))));	
++  val = g_variant_get_int32(state);
++  amitk_study_set_view_mode(ui_study->study, val);
+   ui_study_update_view_mode(ui_study);
+ 
+   return;
+@@ -1308,7 +1331,7 @@
+ 
+ 
+ /* function ran to exit the program */
+-void ui_study_cb_quit(GtkAction * action, gpointer data) {
++void ui_study_cb_quit(GSimpleAction * action, GVariant * param, gpointer data) {
+ 
+   ui_study_t * ui_study = data;
+   GtkWindow * window = ui_study->window;
+@@ -1326,7 +1349,7 @@
+ }
+ 
+ /* function ran when closing a study window */
+-void ui_study_cb_close(GtkAction* action, gpointer data) {
++void ui_study_cb_close(GSimpleAction * action, GVariant * param, gpointer data) {
+ 
+   ui_study_t * ui_study = data;
+   GtkWindow * window = ui_study->window;
+--- amide.orig/amide-current/src/ui_time_dialog.c
++++ amide/amide-current/src/ui_time_dialog.c
+@@ -458,10 +458,11 @@
+   column_type_t i_column;
+ 
+   temp_string = g_strdup_printf(_("%s: Time Dialog"),PACKAGE);
+-  dialog = gtk_dialog_new_with_buttons(temp_string,  parent,
+-				       GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR,
+-				       NULL);
++  dialog = gtk_dialog_new();
++  gtk_window_set_title(GTK_WINDOW(dialog), temp_string);
+   g_free(temp_string);
++  gtk_window_set_transient_for(GTK_WINDOW(dialog), parent);
++  gtk_window_set_destroy_with_parent(GTK_WINDOW(dialog), TRUE);
+   gtk_window_set_resizable(GTK_WINDOW(dialog), TRUE);
+ 
+ 
+@@ -480,13 +481,15 @@
+ 
+ 
+   /* start making the widgets for this dialog box */
+-  packing_table = gtk_table_new(4,4,FALSE);
++  packing_table = gtk_grid_new();
++  gtk_grid_set_row_spacing(GTK_GRID(packing_table), Y_PADDING);
++  gtk_grid_set_column_spacing(GTK_GRID(packing_table), X_PADDING);
+   table_row=0;
+-  gtk_container_add (GTK_CONTAINER (GTK_DIALOG(dialog)->vbox), packing_table);
++  gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area
++                                    (GTK_DIALOG(dialog))), packing_table);
+ 
+   label = gtk_label_new(_("Start (s)"));
+-  gtk_table_attach(GTK_TABLE(packing_table), label, 0,1,
+-		   table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), label, 0, table_row, 1, 1);
+ 
+   td->start_spin = gtk_spin_button_new_with_range(-G_MAXDOUBLE, G_MAXDOUBLE, 1.0);
+   gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(td->start_spin), FALSE);
+@@ -497,15 +500,13 @@
+ 		   G_CALLBACK(change_spin_cb), dialog);
+   g_signal_connect(G_OBJECT(td->start_spin), "output",
+ 		   G_CALLBACK(amitk_spin_button_scientific_output), NULL);
+-  gtk_table_attach(GTK_TABLE(packing_table), td->start_spin,1,2,
+-		   table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), td->start_spin, 1, table_row, 1, 1);
+   table_row++;
+ 
+ 
+ 
+   label = gtk_label_new(_("End (s)"));
+-  gtk_table_attach(GTK_TABLE(packing_table), label, 0,1,
+-		   table_row, table_row+1, 0, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), label, 0, table_row, 1, 1);
+     
+   td->end_spin = gtk_spin_button_new_with_range(-G_MAXDOUBLE, G_MAXDOUBLE, 1.0);
+   gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(td->end_spin), FALSE);
+@@ -516,17 +517,14 @@
+ 		   G_CALLBACK(change_spin_cb), dialog);
+   g_signal_connect(G_OBJECT(td->end_spin), "output",
+ 		   G_CALLBACK(amitk_spin_button_scientific_output), NULL);
+-  gtk_table_attach(GTK_TABLE(packing_table), td->end_spin,1,2,
+-		   table_row, table_row+1, GTK_FILL, 0, X_PADDING, Y_PADDING);
++  gtk_grid_attach(GTK_GRID(packing_table), td->end_spin, 1, table_row, 1, 1);
+   table_row++;
+ 
+ 
+ 
+   /* a separator for clarity */
+-  hseparator = gtk_hseparator_new();
+-  gtk_table_attach(GTK_TABLE(packing_table), hseparator, 0, 4, 
+-		   table_row, table_row+1,
+-		   GTK_FILL, 0, X_PADDING, Y_PADDING);
++  hseparator = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
++  gtk_grid_attach(GTK_GRID(packing_table), hseparator, 0, table_row, 4, 1);
+   table_row++;
+ 
+   /* the scroll widget which the list will go into */
+@@ -535,11 +533,9 @@
+   gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled),
+   				 GTK_POLICY_AUTOMATIC,
+   				 GTK_POLICY_AUTOMATIC);
+-  gtk_table_attach(GTK_TABLE(packing_table), scrolled, 0,2, 
+-  		   table_row, table_row+1, 
+-  		   X_PACKING_OPTIONS | GTK_FILL, 
+-  		   Y_PACKING_OPTIONS | GTK_FILL, 
+-  		   X_PADDING, Y_PADDING);
++  gtk_widget_set_hexpand(scrolled, TRUE);
++  gtk_widget_set_vexpand(scrolled, TRUE);
++  gtk_grid_attach(GTK_GRID(packing_table), scrolled, 0, table_row, 2, 1);
+   table_row++;
+     
+ 
+--- amide.orig/amide-current/src/Makefile.am
++++ amide/amide-current/src/Makefile.am
+@@ -29,8 +29,7 @@
+ 	$(XMEDCON_CFLAGS) \
+ 	$(VISTAIO_CFLAGS) \
+ 	$(LIBOPENJP2_CFLAGS) \
+-	$(LIBAVCODEC_CFLAGS) \
+-	-DG_DISABLE_DEPRECATED
++	$(LIBAVCODEC_CFLAGS)
+ 
+ 
+ 
+@@ -90,10 +89,14 @@
+ 	amitk_canvas_object.c \
+ 	amitk_color_table.c \
+ 	amitk_color_table_menu.c \
++	amitk_curve.h \
++	amitk_curve.c \
+ 	amitk_data_set.c \
+ 	amitk_dial.c \
+ 	amitk_fiducial_mark.c \
+ 	amitk_filter.c \
++	amitk_gamma.h \
++	amitk_gamma.c \
+ 	amitk_line_profile.c \
+ 	amitk_object.c \
+ 	amitk_object_dialog.c \
+@@ -447,9 +450,25 @@
+ 	&& echo timestamp > $(@F)
+ 
+ 
++compile_resources = $(GLIB_COMPILE_RESOURCES)
++BUILT_SOURCES = gresource.c
++XML = $(builddir)/gresource.xml
++
++$(srcdir)/gresource.c: menus.ui render.ui series.ui
++	@echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" > $(XML)
++	@echo "<gresources>" >> $(XML)
++	@echo "<gresource prefix=\"/com/github/ferdymercury/amide\">" >> $(XML)
++	@echo "<file alias=\"gtk/menus.ui\">$(srcdir)/menus.ui</file>" >> $(XML)
++	@echo "<file alias=\"render.ui\">$(srcdir)/render.ui</file>" >> $(XML)
++	@echo "<file alias=\"series.ui\">$(srcdir)/series.ui</file>" >> $(XML)
++	@echo "</gresource>" >> $(XML)
++	@echo "</gresources>" >> $(XML)
++	$(compile_resources) --generate-source $(XML)
+ 
+ 
+ CLEANFILES = \
++	$(XML) \
++	$(BUILT_SOURCES) \
+ 	$(AMITK_ROI_VARIABLE_C) \
+ 	$(AMITK_ROI_VARIABLE_H) \
+ 	$(AMITK_DATA_SET_VARIABLE_C) \
+@@ -463,3 +482,4 @@
+ 
+ DISTCLEANFILES = *~ 
+ 
++EXTRA_DIST = gamma_icons.c menus.ui render.ui series.ui
+--- /dev/null
++++ amide/amide-current/src/amitk_curve.c
+@@ -0,0 +1,911 @@
++/* This is the GTK 2 GtkCurve widget, ported to GTK 3.
++   Incorporated in AMIDE by Yavor Doganov <yavor at gnu.org>, 2024.  */
++
++/* GTK - The GIMP Toolkit
++ * Copyright (C) 1997 David Mosberger
++ *
++ * This library is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU Lesser General Public
++ * License as published by the Free Software Foundation; either
++ * version 2 of the License, or (at your option) any later version.
++ *
++ * This library is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++ * Lesser General Public License for more details.
++ *
++ * You should have received a copy of the GNU Lesser General Public
++ * License along with this library; if not, write to the
++ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
++ * Boston, MA 02111-1307, USA.
++ */
++
++/*
++ * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
++ * file for a list of people on the GTK+ Team.  See the ChangeLog
++ * files for a list of changes.  These files are distributed with
++ * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
++ */
++
++#include <math.h>
++#include "amitk_curve.h"
++
++#define RADIUS          3       /* radius of the control points */
++#define MIN_DISTANCE    8       /* min distance between control points */
++
++#define GRAPH_MASK       (GDK_EXPOSURE_MASK |            \
++                          GDK_POINTER_MOTION_MASK |      \
++                          GDK_POINTER_MOTION_HINT_MASK | \
++                          GDK_ENTER_NOTIFY_MASK |        \
++                          GDK_BUTTON_PRESS_MASK |        \
++                          GDK_BUTTON_RELEASE_MASK |      \
++                          GDK_BUTTON1_MOTION_MASK)
++
++enum {
++  PROP_0,
++  PROP_CURVE_TYPE,
++  PROP_MIN_X,
++  PROP_MAX_X,
++  PROP_MIN_Y,
++  PROP_MAX_Y
++};
++
++static GtkDrawingAreaClass *parent_class = NULL;
++static guint curve_type_changed_signal = 0;
++
++/* forward declarations: */
++static void amitk_curve_class_init       (AmitkCurveClass *class);
++static void amitk_curve_init             (AmitkCurve      *curve);
++static void amitk_curve_get_property     (GObject         *object,
++                                          guint            param_id,
++                                          GValue          *value,
++                                          GParamSpec      *pspec);
++static void amitk_curve_set_property     (GObject         *object,
++                                          guint            param_id,
++                                          const GValue    *value,
++                                          GParamSpec      *pspec);
++static void amitk_curve_finalize         (GObject         *object);
++static gboolean amitk_curve_graph_events (GtkWidget       *widget,
++                                          GdkEvent        *event,
++                                          AmitkCurve      *c);
++static gboolean amitk_curve_draw_real    (GtkWidget       *widget,
++                                          cairo_t         *cr,
++                                          AmitkCurve      *c);
++static void amitk_curve_state_changed    (GtkWidget       *widget,
++                                          GtkStateFlags    flags,
++                                          AmitkCurve      *c);
++static void amitk_curve_size_graph       (AmitkCurve      *curve);
++
++GType
++amitk_curve_type_get_type (void)
++{
++    static GType etype = 0;
++    if (G_UNLIKELY(etype == 0))
++      {
++        static const GEnumValue values[] = {
++          { AMITK_CURVE_TYPE_LINEAR, "AMITK_CURVE_TYPE_LINEAR", "linear" },
++          { AMITK_CURVE_TYPE_SPLINE, "AMITK_CURVE_TYPE_SPLINE", "spline" },
++          { 0, NULL, NULL }
++        };
++        etype = g_enum_register_static (g_intern_static_string
++                                        ("AmikCurveType"), values);
++    }
++    return etype;
++}
++
++GType
++amitk_curve_get_type (void)
++{
++  static GType curve_type = 0;
++
++  if (!curve_type)
++    {
++      const GTypeInfo curve_info =
++        {
++          sizeof (AmitkCurveClass),
++          NULL,            /* base_init */
++          NULL,            /* base_finalize */
++          (GClassInitFunc) amitk_curve_class_init,
++          NULL,            /* class_finalize */
++          NULL,            /* class_data */
++          sizeof (AmitkCurve),
++          0,               /* n_preallocs */
++          (GInstanceInitFunc) amitk_curve_init,
++        };
++
++      curve_type = g_type_register_static (GTK_TYPE_DRAWING_AREA, "AmitkCurve",
++                                           &curve_info, 0);
++    }
++  return curve_type;
++}
++
++static void
++amitk_curve_class_init (AmitkCurveClass *class)
++{
++  GObjectClass *gobject_class = G_OBJECT_CLASS (class);
++
++  parent_class = g_type_class_peek_parent (class);
++
++  gobject_class->finalize = amitk_curve_finalize;
++
++  gobject_class->set_property = amitk_curve_set_property;
++  gobject_class->get_property = amitk_curve_get_property;
++
++  g_object_class_install_property (gobject_class,
++                                   PROP_CURVE_TYPE,
++                                   g_param_spec_enum ("curve-type",
++                                                      "Curve type",
++                                                      "Is this curve linear or spline interpolated",
++                                                      AMITK_TYPE_CURVE_TYPE,
++                                                      AMITK_CURVE_TYPE_SPLINE,
++                                                      G_PARAM_READWRITE));
++  g_object_class_install_property (gobject_class,
++                                   PROP_MIN_X,
++                                   g_param_spec_float ("min-x",
++                                                       "Minimum X",
++                                                       "Minimum possible value for X",
++                                                       -G_MAXFLOAT,
++                                                       G_MAXFLOAT,
++                                                       0.0,
++                                                       G_PARAM_READWRITE));
++  g_object_class_install_property (gobject_class,
++                                   PROP_MAX_X,
++                                   g_param_spec_float ("max-x",
++                                                       "Maximum X",
++                                                       "Maximum possible X value",
++                                                       -G_MAXFLOAT,
++                                                       G_MAXFLOAT,
++                                                       1.0,
++                                                       G_PARAM_READWRITE));
++  g_object_class_install_property (gobject_class,
++                                   PROP_MIN_Y,
++                                   g_param_spec_float ("min-y",
++                                                       "Minimum Y",
++                                                       "Minimum possible value for Y",
++                                                       -G_MAXFLOAT,
++                                                       G_MAXFLOAT,
++                                                       0.0,
++                                                       G_PARAM_READWRITE));
++  g_object_class_install_property (gobject_class,
++                                   PROP_MAX_Y,
++                                   g_param_spec_float ("max-y",
++                                                       "Maximum Y",
++                                                       "Maximum possible value for Y",
++                                                       -G_MAXFLOAT,
++                                                       G_MAXFLOAT,
++                                                       1.0,
++                                                       G_PARAM_READWRITE));
++
++  curve_type_changed_signal =
++    g_signal_new ("curve-type-changed",
++                   G_OBJECT_CLASS_TYPE (gobject_class),
++                   G_SIGNAL_RUN_FIRST,
++                   G_STRUCT_OFFSET (AmitkCurveClass, curve_type_changed),
++                   NULL, NULL,
++                   g_cclosure_marshal_VOID__VOID,
++                   G_TYPE_NONE, 0);
++}
++
++static void
++amitk_curve_init (AmitkCurve *curve)
++{
++  gint old_mask;
++
++  curve->cursor_type = GDK_TOP_LEFT_ARROW;
++  curve->surface = NULL;
++  curve->curve_type = AMITK_CURVE_TYPE_SPLINE;
++  curve->height = 0;
++  curve->grab_point = -1;
++
++  curve->num_points = 0;
++  curve->point = NULL;
++
++  curve->num_ctlpoints = 0;
++  curve->ctlpoint = NULL;
++
++  curve->min_x = 0.0;
++  curve->max_x = 1.0;
++  curve->min_y = 0.0;
++  curve->max_y = 1.0;
++
++  old_mask = gtk_widget_get_events (GTK_WIDGET (curve));
++  gtk_widget_set_events (GTK_WIDGET (curve), old_mask | GRAPH_MASK);
++  g_signal_connect (curve, "event",
++                    G_CALLBACK (amitk_curve_graph_events), curve);
++  g_signal_connect (curve, "state-flags-changed",
++                    G_CALLBACK (amitk_curve_state_changed), curve);
++  g_signal_connect (curve, "draw", G_CALLBACK (amitk_curve_draw_real), curve);
++  /* Setting the "hexpand" property has to be done before the first
++     size_request call (by amitk_curve_size_graph); the second graph
++     is computed with shorter width and there is no way to expand it
++     in the GtkGrid.  Setting it afterwards has no effect.  */
++  gtk_widget_set_hexpand (GTK_WIDGET (curve), TRUE);
++  amitk_curve_size_graph (curve);
++}
++
++static void
++amitk_curve_set_property (GObject      *object,
++                          guint         prop_id,
++                          const GValue *value,
++                          GParamSpec   *pspec)
++{
++  AmitkCurve *curve = AMITK_CURVE (object);
++
++  switch (prop_id)
++    {
++    case PROP_CURVE_TYPE:
++      amitk_curve_set_curve_type (curve, g_value_get_enum (value));
++      break;
++    case PROP_MIN_X:
++      amitk_curve_set_range (curve, g_value_get_float (value), curve->max_x,
++                             curve->min_y, curve->max_y);
++      break;
++    case PROP_MAX_X:
++      amitk_curve_set_range (curve, curve->min_x, g_value_get_float (value),
++                             curve->min_y, curve->max_y);
++      break;
++    case PROP_MIN_Y:
++      amitk_curve_set_range (curve, curve->min_x, curve->max_x,
++                             g_value_get_float (value), curve->max_y);
++      break;
++    case PROP_MAX_Y:
++      amitk_curve_set_range (curve, curve->min_x, curve->max_x,
++                             curve->min_y, g_value_get_float (value));
++      break;
++    default:
++      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
++      break;
++    }
++}
++
++static void
++amitk_curve_get_property (GObject    *object,
++                          guint       prop_id,
++                          GValue     *value,
++                          GParamSpec *pspec)
++{
++  AmitkCurve *curve = AMITK_CURVE (object);
++
++  switch (prop_id)
++    {
++    case PROP_CURVE_TYPE:
++      g_value_set_enum (value, curve->curve_type);
++      break;
++    case PROP_MIN_X:
++      g_value_set_float (value, curve->min_x);
++      break;
++    case PROP_MAX_X:
++      g_value_set_float (value, curve->max_x);
++      break;
++    case PROP_MIN_Y:
++      g_value_set_float (value, curve->min_y);
++      break;
++    case PROP_MAX_Y:
++      g_value_set_float (value, curve->max_y);
++      break;
++    default:
++      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
++      break;
++    }
++}
++
++static int
++project (gfloat value, gfloat min, gfloat max, int norm)
++{
++  return (norm - 1) * ((value - min) / (max - min)) + 0.5;
++}
++
++static gfloat
++unproject (gint value, gfloat min, gfloat max, int norm)
++{
++  return value / (gfloat) (norm - 1) * (max - min) + min;
++}
++
++/* Solve the tridiagonal equation system that determines the second
++   derivatives for the interpolation points.  (Based on Numerical
++   Recipies 2nd Edition.) */
++static void
++spline_solve (int n, gfloat x[], gfloat y[], gfloat y2[])
++{
++  gfloat p, sig, *u;
++  gint i, k;
++
++  u = g_malloc ((n - 1) * sizeof (u[0]));
++
++  y2[0] = u[0] = 0.0;   /* set lower boundary condition to "natural" */
++
++  for (i = 1; i < n - 1; ++i)
++    {
++      sig = (x[i] - x[i - 1]) / (x[i + 1] - x[i - 1]);
++      p = sig * y2[i - 1] + 2.0;
++      y2[i] = (sig - 1.0) / p;
++      u[i] = ((y[i + 1] - y[i])
++              / (x[i + 1] - x[i]) - (y[i] - y[i - 1]) / (x[i] - x[i - 1]));
++      u[i] = (6.0 * u[i] / (x[i + 1] - x[i - 1]) - sig * u[i - 1]) / p;
++    }
++
++  y2[n - 1] = 0.0;
++  for (k = n - 2; k >= 0; --k)
++    y2[k] = y2[k] * y2[k + 1] + u[k];
++
++  g_free (u);
++}
++
++static gfloat
++spline_eval (int n, gfloat x[], gfloat y[], gfloat y2[], gfloat val)
++{
++  gint k_lo, k_hi, k;
++  gfloat h, b, a;
++
++  /* do a binary search for the right interval: */
++  k_lo = 0; k_hi = n - 1;
++  while (k_hi - k_lo > 1)
++    {
++      k = (k_hi + k_lo) / 2;
++      if (x[k] > val)
++        k_hi = k;
++      else
++        k_lo = k;
++    }
++
++  h = x[k_hi] - x[k_lo];
++  g_assert (h > 0.0);
++
++  a = (x[k_hi] - val) / h;
++  b = (val - x[k_lo]) / h;
++  return a*y[k_lo] + b*y[k_hi] +
++    ((a*a*a - a)*y2[k_lo] + (b*b*b - b)*y2[k_hi]) * (h*h)/6.0;
++}
++
++static void
++amitk_curve_interpolate (AmitkCurve *c, gint width, gint height)
++{
++  gfloat *vector;
++  int i;
++
++  vector = g_malloc (width * sizeof (vector[0]));
++
++  amitk_curve_get_vector (c, width, vector);
++
++  c->height = height;
++  if (c->num_points != width)
++    {
++      c->num_points = width;
++      g_free (c->point);
++      c->point = g_malloc (c->num_points * sizeof (c->point[0]));
++    }
++
++  for (i = 0; i < width; ++i)
++    {
++      c->point[i].x = RADIUS + i;
++      c->point[i].y = RADIUS + height
++        - project (vector[i], c->min_y, c->max_y, height);
++    }
++
++  g_free (vector);
++}
++
++static void
++amitk_curve_draw (AmitkCurve *c, gint width, gint height)
++{
++  GtkStateFlags state;
++  GdkRGBA color;
++  GtkStyleContext *ctxt;
++  GtkWidget *w;
++  cairo_t *cr;
++  gdouble offset;
++  gint i;
++
++  g_return_if_fail (c->surface != NULL);
++
++  if (c->height != height || c->num_points != width)
++    amitk_curve_interpolate (c, width, height);
++
++  w = GTK_WIDGET (c);
++
++  /* Get the style context from the toplevel because this widget (and
++     apparently its parent) do not have bacgkround set so
++     gtk_render_background silently does nothing.  */
++  ctxt = gtk_widget_get_style_context (gtk_widget_get_toplevel (w));
++  state = gtk_style_context_get_state (ctxt);
++
++  cr = cairo_create (c->surface);
++
++  /* Erase what has been drawn during the last call.  */
++  gtk_render_background (ctxt, cr, 0, 0,
++                         width + RADIUS * 2, height + RADIUS * 2);
++
++  ctxt = gtk_widget_get_style_context (w);
++  state = gtk_style_context_get_state (ctxt);
++  gtk_style_context_get_color (ctxt, state, &color);
++  gdk_cairo_set_source_rgba (cr, &color);
++  cairo_set_line_width (cr, 1.0);
++  cairo_set_line_cap (cr, CAIRO_LINE_CAP_SQUARE);
++
++  /* Draw the grid lines.  Orignal code uses w->style->dark_gc[state]
++     which makes them a bit lighter than the graph itself.  I guess we
++     could pass modified GdkRGBA struct members to achieve the same
++     effect but this looks risky with some setups/themes.  */
++  for (i = 0; i < 5; i++)
++    {
++      if (i % 2)
++        offset = 0;
++      else
++        offset = 0.5;
++
++      cairo_move_to (cr, RADIUS, i * (height / 4.0) + RADIUS + offset);
++      cairo_line_to (cr, width + RADIUS, i * (height / 4.0) + RADIUS + offset);
++      cairo_move_to (cr, i * (width / 4.0) + RADIUS, RADIUS + 0.5);
++      cairo_line_to (cr, i * (width / 4.0) + RADIUS, height + RADIUS);
++    }
++  cairo_stroke (cr);
++
++  for (i = 0; i < c->num_points; i++)
++    cairo_rectangle (cr, c->point[i].x, c->point[i].y, 1, 1);
++  cairo_fill (cr);
++
++  for (i = 0; i < c->num_ctlpoints; ++i)
++    {
++      gint x, y;
++
++      if (c->ctlpoint[i][0] < c->min_x)
++        continue;
++
++      x = project (c->ctlpoint[i][0], c->min_x, c->max_x, width);
++      y = height - project (c->ctlpoint[i][1], c->min_y, c->max_y, height);
++
++      /* Draw the control point (a bullet).  */
++      cairo_arc (cr, x + RADIUS, y + RADIUS, RADIUS, 0, 2 * M_PI);
++      cairo_fill (cr);
++    }
++
++  cairo_surface_flush (c->surface);
++  cairo_destroy (cr);
++  gtk_widget_queue_draw (w);
++}
++
++static void
++amitk_curve_state_changed (GtkWidget *widget, GtkStateFlags flags,
++                           AmitkCurve *c)
++{
++  gint width, height;
++
++  width = gtk_widget_get_allocated_width (widget) - RADIUS * 2;
++  height = gtk_widget_get_allocated_height (widget) - RADIUS * 2;
++
++  /* Trigger a redraw of the graph so that the widget is consitent
++     with the rest of the widgets in the dialog window.  */
++  amitk_curve_draw (c, width, height);
++}
++
++static gboolean
++amitk_curve_draw_real (GtkWidget *widget, cairo_t *cr, AmitkCurve *c)
++{
++  cairo_set_source_surface (cr, c->surface, 0, 0);
++  cairo_paint (cr);
++
++  return FALSE;
++}
++
++static gboolean
++amitk_curve_graph_events (GtkWidget *widget, GdkEvent *event, AmitkCurve *c)
++{
++  GdkCursorType new_type = c->cursor_type;
++  gint i, src, dst, leftbound, rightbound;
++  GdkSeat *seat;
++  GtkWidget *w;
++  gint tx, ty;
++  gint cx, x, y, width, height;
++  gint closest_point = 0;
++  gfloat rx, ry, min_x;
++  guint distance;
++  gboolean retval = FALSE;
++
++  w = GTK_WIDGET (c);
++  width = gtk_widget_get_allocated_width (w) - RADIUS * 2;
++  height = gtk_widget_get_allocated_height (w) - RADIUS * 2;
++
++  if ((width < 0) || (height < 0))
++    return FALSE;
++
++  /*  Get the pointer position.  */
++  seat = gdk_display_get_default_seat (gtk_widget_get_display (w));
++  gdk_window_get_device_position (gtk_widget_get_window (w),
++                                  gdk_seat_get_pointer (seat),
++                                  &tx, &ty, NULL);
++  x = CLAMP ((tx - RADIUS), 0, width - 1);
++  y = CLAMP ((ty - RADIUS), 0, height - 1);
++
++  min_x = c->min_x;
++
++  distance = ~0U;
++  for (i = 0; i < c->num_ctlpoints; ++i)
++    {
++      cx = project (c->ctlpoint[i][0], min_x, c->max_x, width);
++      if ((guint) abs (x - cx) < distance)
++        {
++          distance = abs (x - cx);
++          closest_point = i;
++        }
++    }
++
++  switch (event->type)
++    {
++    case GDK_CONFIGURE:
++      if (c->surface)
++        cairo_surface_destroy (c->surface);
++      c->surface = NULL;
++      /* fall through */
++    case GDK_EXPOSE:
++      if (!c->surface)
++        c->surface =
++          cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
++                                      gtk_widget_get_allocated_width (w),
++                                      gtk_widget_get_allocated_height (w));
++      amitk_curve_draw (c, width, height);
++      break;
++
++    case GDK_BUTTON_PRESS:
++      gtk_grab_add (widget);
++
++      new_type = GDK_TCROSS;
++
++      if (distance > MIN_DISTANCE)
++        {
++          /* insert a new control point */
++          if (c->num_ctlpoints > 0)
++            {
++              cx = project (c->ctlpoint[closest_point][0], min_x,
++                            c->max_x, width);
++              if (x > cx)
++                ++closest_point;
++            }
++          ++c->num_ctlpoints;
++          c->ctlpoint = g_realloc (c->ctlpoint,
++                                   c->num_ctlpoints * sizeof (*c->ctlpoint));
++          for (i = c->num_ctlpoints - 1; i > closest_point; --i)
++            memcpy (c->ctlpoint + i, c->ctlpoint + i - 1,
++                    sizeof (*c->ctlpoint));
++        }
++      c->grab_point = closest_point;
++      c->ctlpoint[c->grab_point][0] =
++        unproject (x, min_x, c->max_x, width);
++      c->ctlpoint[c->grab_point][1] =
++        unproject (height - y, c->min_y, c->max_y, height);
++
++      amitk_curve_interpolate (c, width, height);
++
++      amitk_curve_draw (c, width, height);
++      retval = TRUE;
++      break;
++
++    case GDK_BUTTON_RELEASE:
++      gtk_grab_remove (widget);
++
++      /* delete inactive points: */
++      for (src = dst = 0; src < c->num_ctlpoints; ++src)
++        {
++          if (c->ctlpoint[src][0] >= min_x)
++            {
++              memcpy (c->ctlpoint + dst, c->ctlpoint + src,
++                      sizeof (*c->ctlpoint));
++              ++dst;
++            }
++        }
++      if (dst < src)
++        {
++          c->num_ctlpoints -= (src - dst);
++          if (c->num_ctlpoints <= 0)
++            {
++              c->num_ctlpoints = 1;
++              c->ctlpoint[0][0] = min_x;
++              c->ctlpoint[0][1] = c->min_y;
++              amitk_curve_interpolate (c, width, height);
++              amitk_curve_draw (c, width, height);
++            }
++          c->ctlpoint = g_realloc (c->ctlpoint,
++                                   c->num_ctlpoints * sizeof (*c->ctlpoint));
++        }
++      new_type = GDK_FLEUR;
++      c->grab_point = -1;
++      retval = TRUE;
++      break;
++
++    case GDK_MOTION_NOTIFY:
++      if (c->grab_point == -1)
++        {
++          /* if no point is grabbed...  */
++          if (distance <= MIN_DISTANCE)
++            new_type = GDK_FLEUR;
++          else
++            new_type = GDK_TCROSS;
++        }
++      else
++        {
++          /* drag the grabbed point  */
++          new_type = GDK_TCROSS;
++
++          leftbound = -MIN_DISTANCE;
++          if (c->grab_point > 0)
++            leftbound = project (c->ctlpoint[c->grab_point - 1][0],
++                                 min_x, c->max_x, width);
++
++          rightbound = width + RADIUS * 2 + MIN_DISTANCE;
++          if (c->grab_point + 1 < c->num_ctlpoints)
++            rightbound = project (c->ctlpoint[c->grab_point + 1][0],
++                                  min_x, c->max_x, width);
++
++          if (tx <= leftbound || tx >= rightbound
++              || ty > height + RADIUS * 2 + MIN_DISTANCE
++              || ty < -MIN_DISTANCE)
++            c->ctlpoint[c->grab_point][0] = min_x - 1.0;
++          else
++            {
++              rx = unproject (x, min_x, c->max_x, width);
++              ry = unproject (height - y, c->min_y, c->max_y, height);
++              c->ctlpoint[c->grab_point][0] = rx;
++              c->ctlpoint[c->grab_point][1] = ry;
++            }
++          amitk_curve_interpolate (c, width, height);
++          amitk_curve_draw (c, width, height);
++        }
++
++      if (new_type != (GdkCursorType) c->cursor_type)
++        {
++          GdkCursor *cursor;
++
++          c->cursor_type = new_type;
++
++          cursor = gdk_cursor_new_for_display (gtk_widget_get_display (w),
++                                               c->cursor_type);
++          gdk_window_set_cursor (gtk_widget_get_window (w), cursor);
++          g_object_unref (cursor);
++        }
++      retval = TRUE;
++      break;
++
++    default:
++      break;
++    }
++
++  return retval;
++}
++
++void
++amitk_curve_set_curve_type (AmitkCurve *c, AmitkCurveType new_type)
++{
++  gint width, height;
++
++  if (new_type != c->curve_type)
++    {
++      width  = gtk_widget_get_allocated_width (GTK_WIDGET (c)) - RADIUS * 2;
++      height = gtk_widget_get_allocated_height (GTK_WIDGET (c)) - RADIUS * 2;
++
++      c->curve_type = new_type;
++      amitk_curve_interpolate (c, width, height);
++
++      g_signal_emit (c, curve_type_changed_signal, 0);
++      g_object_notify (G_OBJECT (c), "curve-type");
++      amitk_curve_draw (c, width, height);
++    }
++}
++
++static void
++amitk_curve_size_graph (AmitkCurve *curve)
++{
++  gint width, height;
++  gfloat aspect;
++  GdkRectangle geom;
++  GdkMonitor *monitor;
++  GtkWidget *w = GTK_WIDGET (curve);
++
++  width  = (curve->max_x - curve->min_x) + 1;
++  height = (curve->max_y - curve->min_y) + 1;
++  aspect = width / (gfloat) height;
++  monitor = gdk_display_get_primary_monitor (gdk_display_get_default ());
++  gdk_monitor_get_geometry (monitor, &geom);
++  if (width > geom.width / 4)
++    width  = geom.width / 4;
++  if (height > geom.height / 4)
++    height = geom.height / 4;
++
++  if (aspect < 1.0)
++    width  = height * aspect;
++  else
++    height = width / aspect;
++
++  gtk_widget_set_size_request (w, width + RADIUS * 2, height + RADIUS * 2);
++}
++
++static void
++amitk_curve_reset_vector (AmitkCurve *curve)
++{
++  GtkWidget *w = GTK_WIDGET (curve);
++
++  g_free (curve->ctlpoint);
++
++  curve->num_ctlpoints = 2;
++  curve->ctlpoint = g_malloc (2 * sizeof (curve->ctlpoint[0]));
++  curve->ctlpoint[0][0] = curve->min_x;
++  curve->ctlpoint[0][1] = curve->min_y;
++  curve->ctlpoint[1][0] = curve->max_x;
++  curve->ctlpoint[1][1] = curve->max_y;
++
++  if (curve->surface)
++    {
++      gint width, height;
++
++      width = gtk_widget_get_allocated_width (w) - RADIUS * 2;
++      height = gtk_widget_get_allocated_height (w) - RADIUS * 2;
++      amitk_curve_interpolate (curve, width, height);
++      amitk_curve_draw (curve, width, height);
++    }
++}
++
++void
++amitk_curve_reset (AmitkCurve *c)
++{
++  AmitkCurveType old_type;
++
++  old_type = c->curve_type;
++  c->curve_type = AMITK_CURVE_TYPE_SPLINE;
++  amitk_curve_reset_vector (c);
++
++  if (old_type != AMITK_CURVE_TYPE_SPLINE)
++    {
++       g_signal_emit (c, curve_type_changed_signal, 0);
++       g_object_notify (G_OBJECT (c), "curve-type");
++    }
++}
++
++void
++amitk_curve_set_range (AmitkCurve *curve,
++                       gfloat      min_x,
++                       gfloat      max_x,
++                       gfloat      min_y,
++                       gfloat      max_y)
++{
++  g_object_freeze_notify (G_OBJECT (curve));
++  if (curve->min_x != min_x) {
++     curve->min_x = min_x;
++     g_object_notify (G_OBJECT (curve), "min-x");
++  }
++  if (curve->max_x != max_x) {
++     curve->max_x = max_x;
++     g_object_notify (G_OBJECT (curve), "max-x");
++  }
++  if (curve->min_y != min_y) {
++     curve->min_y = min_y;
++     g_object_notify (G_OBJECT (curve), "min-y");
++  }
++  if (curve->max_y != max_y) {
++     curve->max_y = max_y;
++     g_object_notify (G_OBJECT (curve), "max-y");
++  }
++  g_object_thaw_notify (G_OBJECT (curve));
++
++  amitk_curve_size_graph (curve);
++  amitk_curve_reset_vector (curve);
++}
++
++void
++amitk_curve_get_vector (AmitkCurve *c, int veclen, gfloat vector[])
++{
++  gfloat rx, ry, dx, dy, min_x, delta_x, *mem, *xv, *yv, *y2v, prev;
++  gint dst, i, x, next, num_active_ctlpoints = 0, first_active = -1;
++
++  min_x = c->min_x;
++
++  /* count active points: */
++  prev = min_x - 1.0;
++  for (i = num_active_ctlpoints = 0; i < c->num_ctlpoints; ++i)
++    if (c->ctlpoint[i][0] > prev)
++      {
++        if (first_active < 0)
++          first_active = i;
++        prev = c->ctlpoint[i][0];
++        ++num_active_ctlpoints;
++      }
++
++  /* handle degenerate case: */
++  if (num_active_ctlpoints < 2)
++    {
++      if (num_active_ctlpoints > 0)
++        ry = c->ctlpoint[first_active][1];
++      else
++        ry = c->min_y;
++      if (ry < c->min_y) ry = c->min_y;
++      if (ry > c->max_y) ry = c->max_y;
++      for (x = 0; x < veclen; ++x)
++        vector[x] = ry;
++      return;
++    }
++
++  switch (c->curve_type)
++    {
++    case AMITK_CURVE_TYPE_SPLINE:
++      mem = g_malloc (3 * num_active_ctlpoints * sizeof (gfloat));
++      xv  = mem;
++      yv  = mem + num_active_ctlpoints;
++      y2v = mem + 2*num_active_ctlpoints;
++
++      prev = min_x - 1.0;
++      for (i = dst = 0; i < c->num_ctlpoints; ++i)
++        if (c->ctlpoint[i][0] > prev)
++          {
++            prev    = c->ctlpoint[i][0];
++            xv[dst] = c->ctlpoint[i][0];
++            yv[dst] = c->ctlpoint[i][1];
++            ++dst;
++          }
++
++      spline_solve (num_active_ctlpoints, xv, yv, y2v);
++
++      rx = min_x;
++      dx = (c->max_x - min_x) / (veclen - 1);
++      for (x = 0; x < veclen; ++x, rx += dx)
++        {
++          ry = spline_eval (num_active_ctlpoints, xv, yv, y2v, rx);
++          if (ry < c->min_y) ry = c->min_y;
++          if (ry > c->max_y) ry = c->max_y;
++          vector[x] = ry;
++        }
++
++      g_free (mem);
++      break;
++
++    case AMITK_CURVE_TYPE_LINEAR:
++      dx = (c->max_x - min_x) / (veclen - 1);
++      rx = min_x;
++      ry = c->min_y;
++      dy = 0.0;
++      i  = first_active;
++      for (x = 0; x < veclen; ++x, rx += dx)
++        {
++          if (rx >= c->ctlpoint[i][0])
++            {
++              if (rx > c->ctlpoint[i][0])
++                ry = c->min_y;
++              dy = 0.0;
++              next = i + 1;
++              while (next < c->num_ctlpoints
++                     && c->ctlpoint[next][0] <= c->ctlpoint[i][0])
++                ++next;
++              if (next < c->num_ctlpoints)
++                {
++                  delta_x = c->ctlpoint[next][0] - c->ctlpoint[i][0];
++                  dy = ((c->ctlpoint[next][1] - c->ctlpoint[i][1])
++                        / delta_x);
++                  dy *= dx;
++                  ry = c->ctlpoint[i][1];
++                  i = next;
++                }
++            }
++          vector[x] = ry;
++          ry += dy;
++        }
++      break;
++    }
++}
++
++GtkWidget *
++amitk_curve_new (void)
++{
++  return g_object_new (AMITK_TYPE_CURVE, NULL);
++}
++
++static void
++amitk_curve_finalize (GObject *object)
++{
++  AmitkCurve *curve;
++
++  g_return_if_fail (AMITK_IS_CURVE (object));
++
++  curve = AMITK_CURVE (object);
++  if (curve->surface)
++    cairo_surface_destroy (curve->surface);
++  g_free (curve->point);
++  g_free (curve->ctlpoint);
++
++  G_OBJECT_CLASS (parent_class)->finalize (object);
++}
+--- /dev/null
++++ amide/amide-current/src/amitk_curve.h
+@@ -0,0 +1,101 @@
++/* This is the GTK 2 GtkCurve widget, ported to GTK 3.
++   Incorporated in AMIDE by Yavor Doganov <yavor at gnu.org>, 2024.  */
++
++/* GTK - The GIMP Toolkit
++ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
++ *
++ * This library is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU Lesser General Public
++ * License as published by the Free Software Foundation; either
++ * version 2 of the License, or (at your option) any later version.
++ *
++ * This library is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++ * Lesser General Public License for more details.
++ *
++ * You should have received a copy of the GNU Lesser General Public
++ * License along with this library; if not, write to the
++ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
++ * Boston, MA 02111-1307, USA.
++ */
++
++/*
++ * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
++ * file for a list of people on the GTK+ Team.  See the ChangeLog
++ * files for a list of changes.  These files are distributed with
++ * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
++ */
++
++#ifndef __AMITK_CURVE_H__
++#define __AMITK_CURVE_H__
++
++#include <gtk/gtk.h>
++
++G_BEGIN_DECLS
++
++#define AMITK_TYPE_CURVE_TYPE           (amitk_curve_type_get_type ())
++
++#define AMITK_TYPE_CURVE                (amitk_curve_get_type ())
++#define AMITK_CURVE(obj)                (G_TYPE_CHECK_INSTANCE_CAST ((obj), AMITK_TYPE_CURVE, AmitkCurve))
++#define AMITK_CURVE_CLASS(klass)        (G_TYPE_CHECK_CLASS_CAST ((klass), AMITK_TYPE_CURVE, AmitkCurveClass))
++#define AMITK_IS_CURVE(obj)             (G_TYPE_CHECK_INSTANCE_TYPE ((obj), AMITK_TYPE_CURVE))
++#define AMITK_IS_CURVE_CLASS(klass)     (G_TYPE_CHECK_CLASS_TYPE ((klass), AMITK_TYPE_CURVE))
++#define AMITK_CURVE_GET_CLASS(obj)      (G_TYPE_INSTANCE_GET_CLASS ((obj), AMITK_TYPE_CURVE, AmitkCurveClass))
++
++typedef struct _AmitkCurve      AmitkCurve;
++typedef struct _AmitkCurveClass AmitkCurveClass;
++
++typedef enum
++{
++  AMITK_CURVE_TYPE_LINEAR,     /* linear interpolation */
++  AMITK_CURVE_TYPE_SPLINE,     /* spline interpolation */
++} AmitkCurveType;
++
++struct _AmitkCurve
++{
++  GtkDrawingArea graph;
++
++  gint cursor_type;
++  gfloat min_x;
++  gfloat max_x;
++  gfloat min_y;
++  gfloat max_y;
++  cairo_surface_t *surface;
++  AmitkCurveType curve_type;
++  gint height;                  /* (cached) graph height in pixels */
++  gint grab_point;              /* point currently grabbed */
++  gint last;
++
++  /* (cached) curve points: */
++  gint num_points;
++  GdkPoint *point;
++
++  /* control points: */
++  gint num_ctlpoints;           /* number of control points */
++  gfloat (*ctlpoint)[2];        /* array of control points */
++};
++
++struct _AmitkCurveClass
++{
++  GtkDrawingAreaClass parent_class;
++
++  void (* curve_type_changed) (AmitkCurve *curve);
++};
++
++GType           amitk_curve_type_get_type  (void) G_GNUC_CONST;
++GType           amitk_curve_get_type       (void) G_GNUC_CONST;
++GtkWidget *     amitk_curve_new            (void);
++void            amitk_curve_reset          (AmitkCurve *curve);
++void            amitk_curve_set_range      (AmitkCurve *curve,
++                                            gfloat min_x, gfloat max_x,
++                                            gfloat min_y, gfloat max_y);
++void            amitk_curve_get_vector     (AmitkCurve *curve,
++                                            int veclen, gfloat vector[]);
++void            amitk_curve_set_curve_type (AmitkCurve *curve,
++                                            AmitkCurveType type);
++
++G_END_DECLS
++
++#endif /* __AMITK_CURVE_H__ */
++
+--- /dev/null
++++ amide/amide-current/src/amitk_gamma.c
+@@ -0,0 +1,189 @@
++/* This is the GTK 2 GtkGammaCurve widget, ported to GTK 3.
++   Incorporated in AMIDE by Yavor Doganov <yavor at gnu.org>, 2024.  */
++
++/* GTK - The GIMP Toolkit
++ * Copyright (C) 1997 David Mosberger
++ *
++ * This library is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU Lesser General Public
++ * License as published by the Free Software Foundation; either
++ * version 2 of the License, or (at your option) any later version.
++ *
++ * This library is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++ * Lesser General Public License for more details.
++ *
++ * You should have received a copy of the GNU Lesser General Public
++ * License along with this library; if not, write to the
++ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
++ * Boston, MA 02111-1307, USA.
++ */
++
++/*
++ * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
++ * file for a list of people on the GTK+ Team.  See the ChangeLog
++ * files for a list of changes.  These files are distributed with
++ * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
++ */
++
++#include "amitk_curve.h"
++#include "amitk_gamma.h"
++#include "gamma_icons.c"
++
++/* forward declarations: */
++static void amitk_gamma_curve_destroy   (GtkWidget *object);
++static void curve_type_changed_callback (AmitkCurve *curve, gpointer data);
++static void button_realize_callback     (GtkWidget *w);
++static void button_toggled_callback     (GtkToggleButton *b, gpointer data);
++static void button_clicked_callback     (GtkButton *b, gpointer data);
++
++G_DEFINE_TYPE (AmitkGammaCurve, amitk_gamma_curve, GTK_TYPE_BOX)
++
++static void
++amitk_gamma_curve_class_init (AmitkGammaCurveClass *class)
++{
++  GtkWidgetClass *object_class;
++
++  object_class = (GtkWidgetClass *) class;
++  object_class->destroy = amitk_gamma_curve_destroy;
++}
++
++static void
++amitk_gamma_curve_init (AmitkGammaCurve *curve)
++{
++  GtkWidget *vbox;
++  gint i;
++  static gboolean icons_initialized = FALSE;
++
++  if (!icons_initialized)
++    {
++      gtk_icon_theme_add_resource_path (gtk_icon_theme_get_default (),
++                                        "/com/github/ferdymercury/amide/gamma");
++      icons_initialized = TRUE;
++    }
++
++  gtk_orientable_set_orientation (GTK_ORIENTABLE (curve),
++                                  GTK_ORIENTATION_VERTICAL);
++  curve->grid = gtk_grid_new ();
++  gtk_grid_set_column_spacing (GTK_GRID (curve->grid), 3);
++  gtk_container_add (GTK_CONTAINER (curve), curve->grid);
++
++  curve->curve = amitk_curve_new ();
++  g_signal_connect (curve->curve, "curve-type-changed",
++                    G_CALLBACK (curve_type_changed_callback), curve);
++  gtk_grid_attach (GTK_GRID (curve->grid), curve->curve, 0, 0, 1, 1);
++
++  vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3);
++  gtk_grid_attach (GTK_GRID (curve->grid), vbox, 1, 0, 1, 1);
++
++  /* toggle buttons: */
++  for (i = 0; i < 2; ++i)
++    {
++      curve->button[i] = gtk_toggle_button_new ();
++      g_object_set_data (G_OBJECT (curve->button[i]), "_AmitkGammaCurveIndex",
++                         GINT_TO_POINTER (i));
++      gtk_container_add (GTK_CONTAINER (vbox), curve->button[i]);
++      g_signal_connect (curve->button[i], "realize",
++                        G_CALLBACK (button_realize_callback), NULL);
++      g_signal_connect (curve->button[i], "toggled",
++                        G_CALLBACK (button_toggled_callback), curve);
++      gtk_widget_show (curve->button[i]);
++    }
++
++  /* push button: */
++  curve->button[2] = gtk_button_new ();
++  g_object_set_data (G_OBJECT (curve->button[2]), "_AmitkGammaCurveIndex",
++                     GINT_TO_POINTER (2));
++  gtk_container_add (GTK_CONTAINER (vbox), curve->button[2]);
++  g_signal_connect (curve->button[2], "realize",
++                    G_CALLBACK (button_realize_callback), NULL);
++  g_signal_connect (curve->button[2], "clicked",
++                    G_CALLBACK (button_clicked_callback), curve);
++  gtk_widget_show (curve->button[2]);
++
++  gtk_widget_show (vbox);
++  gtk_widget_show (curve->grid);
++  gtk_widget_show (curve->curve);
++}
++
++static void
++button_realize_callback (GtkWidget *w)
++{
++  GtkWidget *image;
++  gchar *name;
++  gint i;
++
++  i = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (w),
++                                           "_AmitkGammaCurveIndex"));
++  name = g_strdup_printf ("amide_gamma_icon%d", i);
++  image = gtk_image_new_from_icon_name (name, GTK_ICON_SIZE_BUTTON);
++  g_free (name);
++  gtk_container_add (GTK_CONTAINER (w), image);
++  gtk_widget_show (image);
++}
++
++static void
++button_toggled_callback (GtkToggleButton *b, gpointer data)
++{
++  AmitkGammaCurve *c = data;
++  AmitkCurveType type;
++  int active, i;
++
++  if (!gtk_toggle_button_get_active(b))
++    return;
++
++  active = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (b),
++                                               "_AmitkGammaCurveIndex"));
++
++  for (i = 0; i < 2; ++i)
++    if ((i != active)
++        && gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (c->button[i])))
++      break;
++
++  if (i < 2)
++    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (c->button[i]), FALSE);
++
++  if (active)
++    type = AMITK_CURVE_TYPE_LINEAR;
++  else
++    type = AMITK_CURVE_TYPE_SPLINE;
++
++  amitk_curve_set_curve_type (AMITK_CURVE (c->curve), type);
++}
++
++static void
++button_clicked_callback (GtkButton *b, gpointer data)
++{
++  AmitkGammaCurve *c = data;
++
++  /* reset */
++  amitk_curve_reset (AMITK_CURVE (c->curve));
++}
++
++static void
++curve_type_changed_callback (AmitkCurve *curve, gpointer data)
++{
++  AmitkGammaCurve *c = data;
++  int active;
++
++  if (curve->curve_type == AMITK_CURVE_TYPE_SPLINE)
++    active = 0;
++  else
++    active = 1;
++
++  if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (c->button[active])))
++    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (c->button[active]), TRUE);
++}
++
++GtkWidget *
++amitk_gamma_curve_new (void)
++{
++  return g_object_new (AMITK_TYPE_GAMMA_CURVE, NULL);
++}
++
++static void
++amitk_gamma_curve_destroy (GtkWidget *object)
++{
++  GTK_WIDGET_CLASS (amitk_gamma_curve_parent_class)->destroy (object);
++}
+--- /dev/null
++++ amide/amide-current/src/amitk_gamma.h
+@@ -0,0 +1,67 @@
++/* This is the GTK 2 GtkGammaCurve widget, ported to GTK 3.
++   Incorporated in AMIDE by Yavor Doganov <yavor at gnu.org>, 2024.  */
++
++/* GTK - The GIMP Toolkit
++ * Copyright (C) 1997 David Mosberger
++ *
++ * This library is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU Lesser General Public
++ * License as published by the Free Software Foundation; either
++ * version 2 of the License, or (at your option) any later version.
++ *
++ * This library is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++ * Lesser General Public License for more details.
++ *
++ * You should have received a copy of the GNU Lesser General Public
++ * License along with this library; if not, write to the
++ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
++ * Boston, MA 02111-1307, USA.
++ */
++
++/*
++ * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
++ * file for a list of people on the GTK+ Team.  See the ChangeLog
++ * files for a list of changes.  These files are distributed with
++ * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
++ */
++
++#ifndef __AMITK_GAMMA_CURVE_H__
++#define __AMITK_GAMMA_CURVE_H__
++
++#include <gtk/gtk.h>
++
++G_BEGIN_DECLS
++
++#define AMITK_TYPE_GAMMA_CURVE            (amitk_gamma_curve_get_type ())
++#define AMITK_GAMMA_CURVE(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), AMITK_TYPE_GAMMA_CURVE, AmitkGammaCurve))
++#define AMITK_GAMMA_CURVE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), AMITK_TYPE_GAMMA_CURVE, AmitkGammaCurveClass))
++#define AMITK_IS_GAMMA_CURVE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), AMITK_TYPE_GAMMA_CURVE))
++#define AMITK_IS_GAMMA_CURVE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), AMITK_TYPE_GAMMA_CURVE))
++#define AMITK_GAMMA_CURVE_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), AMITK_TYPE_GAMMA_CURVE, AmitkGammaCurveClass))
++
++typedef struct _AmitkGammaCurve      AmitkGammaCurve;
++typedef struct _AmitkGammaCurveClass AmitkGammaCurveClass;
++
++
++struct _AmitkGammaCurve
++{
++  GtkBox vbox;
++
++  GtkWidget *grid;
++  GtkWidget *curve;
++  GtkWidget *button[3]; /* spline, linear, reset */
++};
++
++struct _AmitkGammaCurveClass
++{
++  GtkBoxClass parent_class;
++};
++
++GType      amitk_gamma_curve_get_type (void) G_GNUC_CONST;
++GtkWidget* amitk_gamma_curve_new      (void);
++
++G_END_DECLS
++
++#endif /* __AMITK_GAMMA_CURVE_H__ */
+--- /dev/null
++++ amide/amide-current/src/gamma_icons.c
+@@ -0,0 +1,323 @@
++/* This file contains the icons of the AmitkGammaCurve widget; it was
++   generated semi-automatically by using the following GTK 2 program:
++
++,----
++| #include <gtk/gtk.h>
++|
++| int
++| main (int argc, char **argv)
++| {
++|   GtkWidget *win;
++|   GtkWidget *gamma;
++|   GtkWidget *image;
++|   GdkPixbuf *pixbuf;
++|
++|   gtk_init (&argc, &argv);
++|
++|   win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
++|   g_signal_connect (win, "delete-event", G_CALLBACK (gtk_main_quit), NULL);
++|   gamma = gtk_gamma_curve_new ();
++|   gtk_container_add (GTK_CONTAINER (win), gamma);
++|   gtk_widget_show_all (win);
++|
++|   image = gtk_bin_get_child (GTK_BIN (GTK_GAMMA_CURVE (gamma)->button[0]));
++|   pixbuf = gtk_image_get_pixbuf (GTK_IMAGE (image));
++|   gdk_pixbuf_save (pixbuf, "amide_gamma_icon0.png", "png", NULL);
++|
++|   image = gtk_bin_get_child (GTK_BIN (GTK_GAMMA_CURVE (gamma)->button[1]));
++|   pixbuf = gtk_image_get_pixbuf (GTK_IMAGE (image));
++|   gdk_pixbuf_save (pixbuf, "amide_gamma_icon1.png", "png", NULL);
++|
++|   image = gtk_bin_get_child (GTK_BIN (GTK_GAMMA_CURVE (gamma)->button[4]));
++|   pixbuf = gtk_image_get_pixbuf (GTK_IMAGE (image));
++|   gdk_pixbuf_save (pixbuf, "amide_gamma_icon2.png", "png", NULL);
++|
++|   gtk_main ();
++|
++|   return 0;
++| }
++`----
++
++  Then the icons were put in the following GResource XML file:
++
++,---- gamma_icons.xml
++| <?xml version="1.0" encoding="UTF-8"?>
++| <gresources>
++|   <gresource prefix="/com/github/ferdymercury/amide/gamma">
++|     <file>amide_gamma_icon0.png</file>
++|     <file>amide_gamma_icon1.png</file>
++|     <file>amide_gamma_icon2.png</file>
++|   </gresource>
++| </gresources>
++`----
++
++  This C file was obtained by running
++    glib-compile-resources --generate-source gamma_icons.xml
++*/
++
++#include <gio/gio.h>
++
++#if defined (__ELF__) && ( __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 6))
++# define SECTION __attribute__ ((section (".gresource.gamma_icons"), aligned (8)))
++#else
++# define SECTION
++#endif
++
++static const SECTION union { const guint8 data[949]; const double alignment; void * const ptr;}  gamma_icons_resource_data = {
++  "\107\126\141\162\151\141\156\164\000\000\000\000\000\000\000\000"
++  "\030\000\000\000\034\001\000\000\000\000\000\050\011\000\000\000"
++  "\000\000\000\000\000\000\000\000\001\000\000\000\001\000\000\000"
++  "\004\000\000\000\004\000\000\000\005\000\000\000\010\000\000\000"
++  "\011\000\000\000\302\257\211\013\004\000\000\000\034\001\000\000"
++  "\004\000\114\000\040\001\000\000\044\001\000\000\364\213\151\075"
++  "\007\000\000\000\044\001\000\000\025\000\166\000\100\001\000\000"
++  "\306\001\000\000\362\132\105\075\007\000\000\000\306\001\000\000"
++  "\025\000\166\000\340\001\000\000\252\002\000\000\163\163\127\075"
++  "\007\000\000\000\252\002\000\000\025\000\166\000\300\002\000\000"
++  "\157\003\000\000\324\265\002\000\377\377\377\377\157\003\000\000"
++  "\001\000\114\000\160\003\000\000\164\003\000\000\363\023\273\152"
++  "\010\000\000\000\164\003\000\000\006\000\114\000\174\003\000\000"
++  "\200\003\000\000\224\135\334\227\000\000\000\000\200\003\000\000"
++  "\007\000\114\000\210\003\000\000\214\003\000\000\205\101\141\346"
++  "\005\000\000\000\214\003\000\000\006\000\114\000\224\003\000\000"
++  "\240\003\000\000\244\212\170\021\006\000\000\000\240\003\000\000"
++  "\015\000\114\000\260\003\000\000\264\003\000\000\143\157\155\057"
++  "\006\000\000\000\141\155\151\144\145\137\147\141\155\155\141\137"
++  "\151\143\157\156\062\056\160\156\147\000\000\000\000\000\000\000"
++  "\166\000\000\000\000\000\000\000\211\120\116\107\015\012\032\012"
++  "\000\000\000\015\111\110\104\122\000\000\000\020\000\000\000\020"
++  "\010\006\000\000\000\037\363\377\141\000\000\000\004\163\102\111"
++  "\124\010\010\010\010\174\010\144\210\000\000\000\055\111\104\101"
++  "\124\070\215\143\144\040\037\374\147\140\140\140\140\042\127\167"
++  "\223\243\043\105\126\377\037\325\074\252\171\030\152\376\337\344"
++  "\350\110\276\315\020\313\311\267\035\000\000\350\036\357\200\371"
++  "\024\076\000\000\000\000\111\105\116\104\256\102\140\202\000\000"
++  "\050\165\165\141\171\051\141\155\151\144\145\137\147\141\155\155"
++  "\141\137\151\143\157\156\060\056\160\156\147\000\000\000\000\000"
++  "\272\000\000\000\000\000\000\000\211\120\116\107\015\012\032\012"
++  "\000\000\000\015\111\110\104\122\000\000\000\020\000\000\000\020"
++  "\010\006\000\000\000\037\363\377\141\000\000\000\004\163\102\111"
++  "\124\010\010\010\010\174\010\144\210\000\000\000\161\111\104\101"
++  "\124\070\215\255\121\133\016\300\040\014\102\157\326\223\065\361"
++  "\342\354\143\232\350\046\353\346\044\061\215\017\204\322\204\165"
++  "\020\000\362\052\273\230\375\320\076\345\271\205\274\334\202\204"
++  "\273\023\000\153\175\124\127\140\267\302\017\156\055\264\164\147"
++  "\051\023\140\002\122\044\117\145\065\264\177\175\320\357\025\171"
++  "\337\024\224\102\075\147\061\373\146\177\274\322\123\311\215\254"
++  "\322\165\367\241\116\025\102\173\001\244\275\067\070\000\162\046"
++  "\070\352\371\102\163\071\000\000\000\000\111\105\116\104\256\102"
++  "\140\202\000\000\050\165\165\141\171\051\141\155\151\144\145\137"
++  "\147\141\155\155\141\137\151\143\157\156\061\056\160\156\147\000"
++  "\237\000\000\000\000\000\000\000\211\120\116\107\015\012\032\012"
++  "\000\000\000\015\111\110\104\122\000\000\000\020\000\000\000\020"
++  "\010\006\000\000\000\037\363\377\141\000\000\000\004\163\102\111"
++  "\124\010\010\010\010\174\010\144\210\000\000\000\126\111\104\101"
++  "\124\070\215\275\222\061\016\000\040\010\003\253\377\341\377\213"
++  "\276\255\216\106\305\100\300\330\021\070\050\204\202\270\010\000"
++  "\305\131\111\055\156\302\004\170\203\115\266\211\270\100\315\005"
++  "\215\374\242\272\007\232\210\033\126\025\335\071\014\037\053\174"
++  "\235\376\316\101\346\160\151\007\117\032\260\317\347\011\211\110"
++  "\334\140\000\170\126\030\101\135\240\266\230\000\000\000\000\111"
++  "\105\116\104\256\102\140\202\000\000\050\165\165\141\171\051\057"
++  "\000\000\000\000\141\155\151\144\145\057\000\000\007\000\000\000"
++  "\147\151\164\150\165\142\057\000\010\000\000\000\147\141\155\155"
++  "\141\057\000\000\002\000\000\000\003\000\000\000\001\000\000\000"
++  "\146\145\162\144\171\155\145\162\143\165\162\171\057\000\000\000"
++  "\005\000\000\000" };
++
++static GStaticResource static_resource = { gamma_icons_resource_data.data, sizeof (gamma_icons_resource_data.data) - 1 /* nul terminator */, NULL, NULL, NULL };
++
++G_MODULE_EXPORT
++GResource *gamma_icons_get_resource (void);
++GResource *gamma_icons_get_resource (void)
++{
++  return g_static_resource_get_resource (&static_resource);
++}
++/* GLIB - Library of useful routines for C programming
++ * Copyright (C) 1995-1997  Peter Mattis, Spencer Kimball and Josh MacDonald
++ *
++ * SPDX-License-Identifier: LGPL-2.1-or-later
++ *
++ * This library is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU Lesser General Public
++ * License as published by the Free Software Foundation; either
++ * version 2.1 of the License, or (at your option) any later version.
++ *
++ * This library is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the GNU
++ * Lesser General Public License for more details.
++ *
++ * You should have received a copy of the GNU Lesser General Public
++ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
++ */
++
++/*
++ * Modified by the GLib Team and others 1997-2000.  See the AUTHORS
++ * file for a list of people on the GLib Team.  See the ChangeLog
++ * files for a list of changes.  These files are distributed with
++ * GLib at ftp://ftp.gtk.org/pub/gtk/.
++ */
++
++#ifndef __G_CONSTRUCTOR_H__
++#define __G_CONSTRUCTOR_H__
++
++/*
++  If G_HAS_CONSTRUCTORS is true then the compiler support *both* constructors and
++  destructors, in a usable way, including e.g. on library unload. If not you're on
++  your own.
++
++  Some compilers need #pragma to handle this, which does not work with macros,
++  so the way you need to use this is (for constructors):
++
++  #ifdef G_DEFINE_CONSTRUCTOR_NEEDS_PRAGMA
++  #pragma G_DEFINE_CONSTRUCTOR_PRAGMA_ARGS(my_constructor)
++  #endif
++  G_DEFINE_CONSTRUCTOR(my_constructor)
++  static void my_constructor(void) {
++   ...
++  }
++
++*/
++
++#ifndef __GTK_DOC_IGNORE__
++
++#if  __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
++
++#define G_HAS_CONSTRUCTORS 1
++
++#define G_DEFINE_CONSTRUCTOR(_func) static void __attribute__((constructor)) _func (void);
++#define G_DEFINE_DESTRUCTOR(_func) static void __attribute__((destructor)) _func (void);
++
++#elif defined (_MSC_VER) && (_MSC_VER >= 1500)
++/* Visual studio 2008 and later has _Pragma */
++
++/*
++ * Only try to include gslist.h if not already included via glib.h,
++ * so that items using gconstructor.h outside of GLib (such as
++ * GResources) continue to build properly.
++ */
++#ifndef __G_LIB_H__
++#include "gslist.h"
++#endif
++
++#include <stdlib.h>
++
++#define G_HAS_CONSTRUCTORS 1
++
++/* We do some weird things to avoid the constructors being optimized
++ * away on VS2015 if WholeProgramOptimization is enabled. First we
++ * make a reference to the array from the wrapper to make sure its
++ * references. Then we use a pragma to make sure the wrapper function
++ * symbol is always included at the link stage. Also, the symbols
++ * need to be extern (but not dllexport), even though they are not
++ * really used from another object file.
++ */
++
++/* We need to account for differences between the mangling of symbols
++ * for x86 and x64/ARM/ARM64 programs, as symbols on x86 are prefixed
++ * with an underscore but symbols on x64/ARM/ARM64 are not.
++ */
++#ifdef _M_IX86
++#define G_MSVC_SYMBOL_PREFIX "_"
++#else
++#define G_MSVC_SYMBOL_PREFIX ""
++#endif
++
++#define G_DEFINE_CONSTRUCTOR(_func) G_MSVC_CTOR (_func, G_MSVC_SYMBOL_PREFIX)
++#define G_DEFINE_DESTRUCTOR(_func) G_MSVC_DTOR (_func, G_MSVC_SYMBOL_PREFIX)
++
++#define G_MSVC_CTOR(_func,_sym_prefix) \
++  static void _func(void); \
++  extern int (* _array ## _func)(void);              \
++  int _func ## _wrapper(void);              \
++  int _func ## _wrapper(void) { _func(); g_slist_find (NULL,  _array ## _func); return 0; } \
++  __pragma(comment(linker,"/include:" _sym_prefix # _func "_wrapper")) \
++  __pragma(section(".CRT$XCU",read)) \
++  __declspec(allocate(".CRT$XCU")) int (* _array ## _func)(void) = _func ## _wrapper;
++
++#define G_MSVC_DTOR(_func,_sym_prefix) \
++  static void _func(void); \
++  extern int (* _array ## _func)(void);              \
++  int _func ## _constructor(void);              \
++  int _func ## _constructor(void) { atexit (_func); g_slist_find (NULL,  _array ## _func); return 0; } \
++   __pragma(comment(linker,"/include:" _sym_prefix # _func "_constructor")) \
++  __pragma(section(".CRT$XCU",read)) \
++  __declspec(allocate(".CRT$XCU")) int (* _array ## _func)(void) = _func ## _constructor;
++
++#elif defined (_MSC_VER)
++
++#define G_HAS_CONSTRUCTORS 1
++
++/* Pre Visual studio 2008 must use #pragma section */
++#define G_DEFINE_CONSTRUCTOR_NEEDS_PRAGMA 1
++#define G_DEFINE_DESTRUCTOR_NEEDS_PRAGMA 1
++
++#define G_DEFINE_CONSTRUCTOR_PRAGMA_ARGS(_func) \
++  section(".CRT$XCU",read)
++#define G_DEFINE_CONSTRUCTOR(_func) \
++  static void _func(void); \
++  static int _func ## _wrapper(void) { _func(); return 0; } \
++  __declspec(allocate(".CRT$XCU")) static int (*p)(void) = _func ## _wrapper;
++
++#define G_DEFINE_DESTRUCTOR_PRAGMA_ARGS(_func) \
++  section(".CRT$XCU",read)
++#define G_DEFINE_DESTRUCTOR(_func) \
++  static void _func(void); \
++  static int _func ## _constructor(void) { atexit (_func); return 0; } \
++  __declspec(allocate(".CRT$XCU")) static int (* _array ## _func)(void) = _func ## _constructor;
++
++#elif defined(__SUNPRO_C)
++
++/* This is not tested, but i believe it should work, based on:
++ * http://opensource.apple.com/source/OpenSSL098/OpenSSL098-35/src/fips/fips_premain.c
++ */
++
++#define G_HAS_CONSTRUCTORS 1
++
++#define G_DEFINE_CONSTRUCTOR_NEEDS_PRAGMA 1
++#define G_DEFINE_DESTRUCTOR_NEEDS_PRAGMA 1
++
++#define G_DEFINE_CONSTRUCTOR_PRAGMA_ARGS(_func) \
++  init(_func)
++#define G_DEFINE_CONSTRUCTOR(_func) \
++  static void _func(void);
++
++#define G_DEFINE_DESTRUCTOR_PRAGMA_ARGS(_func) \
++  fini(_func)
++#define G_DEFINE_DESTRUCTOR(_func) \
++  static void _func(void);
++
++#else
++
++/* constructors not supported for this compiler */
++
++#endif
++
++#endif /* __GTK_DOC_IGNORE__ */
++#endif /* __G_CONSTRUCTOR_H__ */
++
++#ifdef G_HAS_CONSTRUCTORS
++
++#ifdef G_DEFINE_CONSTRUCTOR_NEEDS_PRAGMA
++#pragma G_DEFINE_CONSTRUCTOR_PRAGMA_ARGS(gamma_iconsresource_constructor)
++#endif
++G_DEFINE_CONSTRUCTOR(gamma_iconsresource_constructor)
++#ifdef G_DEFINE_DESTRUCTOR_NEEDS_PRAGMA
++#pragma G_DEFINE_DESTRUCTOR_PRAGMA_ARGS(gamma_iconsresource_destructor)
++#endif
++G_DEFINE_DESTRUCTOR(gamma_iconsresource_destructor)
++
++#else
++#warning "Constructor not supported on this compiler, linking in resources will not work"
++#endif
++
++static void gamma_iconsresource_constructor (void)
++{
++  g_static_resource_init (&static_resource);
++}
++
++static void gamma_iconsresource_destructor (void)
++{
++  g_static_resource_fini (&static_resource);
++}
+--- amide.orig/amide-current/src/amitk_space_edit.h
++++ amide/amide-current/src/amitk_space_edit.h
+@@ -45,7 +45,7 @@
+ 
+ struct _AmitkSpaceEdit
+ {
+-  GtkVBox vbox;
++  GtkBox vbox;
+ 
+   GtkWidget * entry[AMITK_AXIS_NUM][AMITK_AXIS_NUM];
+ 
+@@ -55,7 +55,7 @@
+ 
+ struct _AmitkSpaceEditClass
+ {
+-  GtkVBoxClass parent_class;
++  GtkBoxClass parent_class;
+ 
+ };  
+ 
+--- amide.orig/amide-current/src/amitk_window_edit.h
++++ amide/amide-current/src/amitk_window_edit.h
+@@ -63,7 +63,7 @@
+ 
+ struct _AmitkWindowEditClass
+ {
+-  GtkVBoxClass parent_class;
++  GtkBoxClass parent_class;
+ 
+ };  
+ 
+--- amide.orig/amide-current/src/pixmaps.h
++++ amide/amide-current/src/pixmaps.h
+@@ -26,5 +26,3 @@
+ /* header files that are always needed with this file */
+ 
+ extern const gchar * windowing_icons[];
+-
+-void pixmaps_initialize_icons();
+--- amide.orig/amide-current/po/POTFILES.in
++++ amide/amide-current/po/POTFILES.in
+@@ -1,4 +1,7 @@
+ etc/amide.desktop.in
++src/menus.ui
++src/render.ui
++src/series.ui
+ src/alignment.c
+ src/amide.c
+ src/amitk_canvas.c
+--- /dev/null
++++ amide/amide-current/src/menus.ui
+@@ -0,0 +1,201 @@
++<?xml version="1.0" encoding="UTF-8"?>
++<interface>
++  <menu id="menubar">
++    <submenu>
++      <attribute name="label" translatable="yes">_File</attribute>
++      <section>
++        <item>
++          <attribute name="label" translatable="yes">_New Study</attribute>
++          <attribute name="action">win.new</attribute>
++          <attribute name="icon">document-new</attribute>
++        </item>
++        <item>
++          <attribute name="label" translatable="yes">_Open Study</attribute>
++          <attribute name="action">win.open</attribute>
++          <attribute name="icon">document-open</attribute>
++        </item>
++        <item>
++          <attribute name="label" translatable="yes">Save Study As</attribute>
++          <attribute name="action">win.save</attribute>
++          <attribute name="icon">document-save-as</attribute>
++        </item>
++      </section>
++      <section>
++        <item>
++          <attribute name="label" translatable="yes">Import File (guess)</attribute>
++          <attribute name="action">win.import</attribute>
++          <attribute name="target" type="(ii)">(0,0)</attribute>
++        </item>
++        <submenu id="import">
++          <attribute name="label" translatable="yes">Import File (_specify)</attribute>
++        </submenu>
++        <item>
++          <attribute name="label" translatable="yes">Import _Object from Study</attribute>
++          <attribute name="action">win.import-object</attribute>
++        </item>
++      </section>
++      <section>
++        <submenu>
++          <attribute name="label" translatable="yes">_Export View</attribute>
++          <section>
++            <item>
++              <attribute name="label" translatable="yes">_Transverse</attribute>
++              <attribute name="action">win.export-view</attribute>
++              <attribute name="target" type="i">0</attribute>
++            </item>
++            <item>
++              <attribute name="label" translatable="yes">_Coronal</attribute>
++              <attribute name="action">win.export-view</attribute>
++              <attribute name="target" type="i">1</attribute>
++            </item>
++            <item>
++              <attribute name="label" translatable="yes">_Sagittal</attribute>
++              <attribute name="action">win.export-view</attribute>
++              <attribute name="target" type="i">2</attribute>
++            </item>
++          </section>
++        </submenu>
++        <item>
++          <attribute name="label" translatable="yes">Export _Data Set</attribute>
++          <attribute name="action">win.export</attribute>
++        </item>
++      </section>
++      <section>
++        <item>
++          <attribute name="label" translatable="yes">_Recover Study</attribute>
++          <attribute name="action">win.recover</attribute>
++        </item>
++        <item>
++          <attribute name="label" translatable="yes">Open XIF Directory</attribute>
++          <attribute name="action">win.open-dir</attribute>
++        </item>
++        <item>
++          <attribute name="label" translatable="yes">Save As XIF Drectory</attribute>
++          <attribute name="action">win.save-dir</attribute>
++        </item>
++        <item>
++          <attribute name="label" translatable="yes">Import from XIF Directory</attribute>
++          <attribute name="action">win.import-dir</attribute>
++        </item>
++      </section>
++      <section>
++        <item>
++          <attribute name="label" translatable="yes">_Close</attribute>
++          <attribute name="action">win.close</attribute>
++          <attribute name="icon">window-close</attribute>
++        </item>
++        <item>
++          <attribute name="label" translatable="yes">_Quit</attribute>
++          <attribute name="action">win.quit</attribute>
++          <attribute name="icon">application-exit</attribute>
++        </item>
++      </section>
++    </submenu>
++    <submenu>
++      <attribute name="label" translatable="yes">_Edit</attribute>
++      <section>
++        <submenu id="roi">
++          <attribute name="label" translatable="yes">Add _ROI</attribute>
++        </submenu>
++        <item>
++          <attribute name="label" translatable="yes">Add _Fiducial Mark</attribute>
++          <attribute name="action">win.fiducial</attribute>
++        </item>
++      </section>
++      <section>
++        <item>
++          <attribute name="label" translatable="yes">_Preferences</attribute>
++          <attribute name="action">win.preferences</attribute>
++          <attribute name="icon">preferences-system</attribute>
++        </item>
++      </section>
++    </submenu>
++    <submenu>
++      <attribute name="label" translatable="yes">_View</attribute>
++      <section id="view">
++        <item>
++          <attribute name="label" translatable="yes">_Series</attribute>
++          <attribute name="action">win.series</attribute>
++        </item>
++        <item>
++          <attribute name="label" translatable="yes">_Volume Rendering</attribute>
++          <attribute name="action">win.rendering</attribute>
++        </item>
++      </section>
++    </submenu>
++    <submenu>
++      <attribute name="label" translatable="yes">_Tools</attribute>
++      <section id="tools">
++        <item>
++          <attribute name="label" translatable="yes">_Alignment Wizard</attribute>
++          <attribute name="action">win.alignment</attribute>
++        </item>
++        <item>
++          <attribute name="label" translatable="yes">_Crop Active Data Set</attribute>
++          <attribute name="action">win.crop</attribute>
++        </item>
++        <item>
++          <attribute name="label" translatable="yes">Distance Measurements</attribute>
++          <attribute name="action">win.distance</attribute>
++        </item>
++        <item>
++          <attribute name="label" translatable="yes">_Factor Analysis</attribute>
++          <attribute name="action">win.fads</attribute>
++        </item>
++        <item>
++          <attribute name="label" translatable="yes">_Filter Active Data Set</attribute>
++          <attribute name="action">win.filter</attribute>
++        </item>
++        <submenu>
++          <attribute name="label" translatable="yes">Generate _Fly Through</attribute>
++          <section>
++            <item>
++              <attribute name="label" translatable="yes">_Transverse</attribute>
++              <attribute name="action">win.fly-through</attribute>
++              <attribute name="target" type="i">0</attribute>
++            </item>
++            <item>
++              <attribute name="label" translatable="yes">_Coronal</attribute>
++              <attribute name="action">win.fly-through</attribute>
++              <attribute name="target" type="i">1</attribute>
++            </item>
++            <item>
++              <attribute name="label" translatable="yes">_Sagittal</attribute>
++              <attribute name="action">win.fly-through</attribute>
++              <attribute name="target" type="i">2</attribute>
++            </item>
++          </section>
++        </submenu>
++        <item>
++          <attribute name="label" translatable="yes">Generate Line _Profile</attribute>
++          <attribute name="action">win.profile</attribute>
++        </item>
++        <item>
++          <attribute name="label" translatable="yes">Perform _Math on Data Set(s)</attribute>
++          <attribute name="action">win.math</attribute>
++        </item>
++        <item>
++          <attribute name="label" translatable="yes">Calculate _ROI Statistics</attribute>
++          <attribute name="action">win.roi</attribute>
++        </item>
++      </section>
++    </submenu>
++    <submenu id="help">
++      <attribute name="label" translatable="yes">_Help</attribute>
++      <section>
++        <item>
++          <attribute name="label" translatable="yes">_Contents</attribute>
++          <attribute name="action">app.manual</attribute>
++          <attribute name="icon">help-browser</attribute>
++        </item>
++      </section>
++      <section>
++        <item>
++          <attribute name="label" translatable="yes">_About</attribute>
++          <attribute name="action">app.about</attribute>
++          <attribute name="icon">help-about</attribute>
++        </item>
++      </section>
++    </submenu>
++  </menu>
++</interface>
+--- amide.orig/amide-current/src/ui_study_cb.h
++++ amide/amide-current/src/ui_study_cb.h
+@@ -25,17 +25,17 @@
+ 
+ 
+ /* external functions */
+-void ui_study_cb_open_xif_file(GtkAction * action, gpointer ui_study);
+-void ui_study_cb_open_xif_dir(GtkAction * action, gpointer ui_study);
+-void ui_study_cb_import_object_from_xif_file(GtkAction * action, gpointer data);
+-void ui_study_cb_import_object_from_xif_dir(GtkAction * action, gpointer data);
+-void ui_study_cb_recover_xif_file(GtkAction * action, gpointer data);
+-void ui_study_cb_new_study(GtkAction * action, gpointer ui_study);
+-void ui_study_cb_save_as_xif_file(GtkAction * action, gpointer data);
+-void ui_study_cb_save_as_xif_dir(GtkAction * action, gpointer data);
+-void ui_study_cb_import(GtkAction * action, gpointer data);
+-void ui_study_cb_export_view(GtkAction * action, gpointer data);
+-void ui_study_cb_export_data_set(GtkAction * action, gpointer data);
++void ui_study_cb_open_xif_file(GSimpleAction * action, GVariant * param, gpointer ui_study);
++void ui_study_cb_open_xif_dir(GSimpleAction * action, GVariant * param, gpointer ui_study);
++void ui_study_cb_import_object_from_xif_file(GSimpleAction * action, GVariant * param, gpointer data);
++void ui_study_cb_import_object_from_xif_dir(GSimpleAction * action, GVariant * param, gpointer data);
++void ui_study_cb_recover_xif_file(GSimpleAction * action, GVariant * param, gpointer data);
++void ui_study_cb_new_study(GSimpleAction * action, GVariant * param, gpointer ui_study);
++void ui_study_cb_save_as_xif_file(GSimpleAction * action, GVariant * param, gpointer data);
++void ui_study_cb_save_as_xif_dir(GSimpleAction * action, GVariant * param, gpointer data);
++void ui_study_cb_import(GSimpleAction * action, GVariant * param, gpointer data);
++void ui_study_cb_export_view(GSimpleAction * action, GVariant * param, gpointer data);
++void ui_study_cb_export_data_set(GSimpleAction * action, GVariant * param, gpointer data);
+ gboolean ui_study_cb_update_help_info(GtkWidget * widget, GdkEventCrossing * event, gpointer data);
+ void ui_study_cb_canvas_help_event(GtkWidget * canvas,  AmitkHelpInfo help_type,
+ 				   AmitkPoint *location, amide_data_t value, gpointer ui_study);
+@@ -60,38 +60,38 @@
+ void ui_study_cb_thickness(GtkSpinButton * spin_button, gpointer ui_study);
+ void ui_study_cb_gate(GtkWidget * button, gpointer data);
+ void ui_study_cb_time(GtkWidget * button, gpointer data);
+-void ui_study_cb_series(GtkAction * action, gpointer ui_study);
++void ui_study_cb_series(GSimpleAction * action, GVariant * param, gpointer ui_study);
+ #if (AMIDE_FFMPEG_SUPPORT || AMIDE_LIBFAME_SUPPORT)
+-void ui_study_cb_fly_through(GtkAction * action, gpointer ui_study);
++void ui_study_cb_fly_through(GSimpleAction * action, GVariant * param, gpointer ui_study);
+ #endif
+ #ifdef AMIDE_LIBVOLPACK_SUPPORT
+-void ui_study_cb_render(GtkAction * action, gpointer data);
++void ui_study_cb_render(GSimpleAction * action, GVariant * param, gpointer data);
+ #endif
+-void ui_study_cb_roi_statistics(GtkAction * action, gpointer data);
+-void ui_study_cb_alignment_selected(GtkAction * action, gpointer data);
+-void ui_study_cb_crop_selected(GtkAction * action, gpointer data);
+-void ui_study_cb_distance_selected(GtkAction * action, gpointer data);
+-void ui_study_cb_fads_selected(GtkAction * action, gpointer data);
+-void ui_study_cb_filter_selected(GtkAction * action, gpointer data);
+-void ui_study_cb_profile_selected(GtkAction * action, gpointer data);
+-void ui_study_cb_data_set_math_selected(GtkAction * action, gpointer data);
+-void ui_study_cb_canvas_target(GtkToggleAction * action, gpointer data);
+-void ui_study_cb_thresholding(GtkAction * action, gpointer data);
+-void ui_study_cb_add_roi(GtkWidget * widget, gpointer data);
+-void ui_study_cb_add_fiducial_mark(GtkAction * action, gpointer data);
+-void ui_study_cb_preferences(GtkAction * action, gpointer data);
+-void ui_study_cb_interpolation(GtkRadioAction * action, GtkRadioAction * current, gpointer data);
++void ui_study_cb_roi_statistics(GSimpleAction * action, GVariant * param, gpointer data);
++void ui_study_cb_alignment_selected(GSimpleAction * action, GVariant * param, gpointer data);
++void ui_study_cb_crop_selected(GSimpleAction * action, GVariant * param, gpointer data);
++void ui_study_cb_distance_selected(GSimpleAction * action, GVariant * param, gpointer data);
++void ui_study_cb_fads_selected(GSimpleAction * action, GVariant * param, gpointer data);
++void ui_study_cb_filter_selected(GSimpleAction * action, GVariant * param, gpointer data);
++void ui_study_cb_profile_selected(GSimpleAction * action, GVariant * param, gpointer data);
++void ui_study_cb_data_set_math_selected(GSimpleAction * action, GVariant * param, gpointer data);
++void ui_study_cb_canvas_target(GSimpleAction * action, GVariant * state, gpointer data);
++void ui_study_cb_thresholding(GSimpleAction * action, GVariant * param, gpointer data);
++void ui_study_cb_add_roi(GSimpleAction * widget, GVariant * param, gpointer data);
++void ui_study_cb_add_fiducial_mark(GSimpleAction * action, GVariant * param, gpointer data);
++void ui_study_cb_preferences(GSimpleAction * action, GVariant * param, gpointer data);
++void ui_study_cb_interpolation(GSimpleAction * action, GVariant * state, gpointer data);
+ void ui_study_cb_rendering(GtkWidget * widget, gpointer data);
+ void ui_study_cb_study_changed(AmitkStudy * study, gpointer ui_study);
+ void ui_study_cb_thickness_changed(AmitkStudy * study, gpointer data);
+ void ui_study_cb_canvas_layout_changed(AmitkStudy * study, gpointer ui_study);
+ void ui_study_cb_voxel_dim_or_zoom_changed(AmitkStudy * study, gpointer ui_study);
+ void ui_study_cb_fov_changed(AmitkStudy * study, gpointer ui_study);
+-void ui_study_cb_fuse_type(GtkRadioAction * action, GtkRadioAction * current, gpointer data);
+-void ui_study_cb_canvas_visible(GtkToggleAction * action, gpointer ui_study);
+-void ui_study_cb_view_mode(GtkRadioAction * action, GtkRadioAction * current, gpointer data);
+-void ui_study_cb_quit(GtkAction* action, gpointer data);
+-void ui_study_cb_close(GtkAction* action, gpointer data);
++void ui_study_cb_fuse_type(GSimpleAction * action, GVariant * state, gpointer data);
++void ui_study_cb_canvas_visible(GSimpleAction * action, GVariant * state, gpointer ui_study);
++void ui_study_cb_view_mode(GSimpleAction * action, GVariant * state, gpointer data);
++void ui_study_cb_quit(GSimpleAction* action, GVariant * param, gpointer data);
++void ui_study_cb_close(GSimpleAction* action, GVariant * parram, gpointer data);
+ gboolean ui_study_cb_delete_event(GtkWidget* widget, GdkEvent * event, gpointer data);
+ 
+ 
+--- amide.orig/amide-current/src/amitk_study.c
++++ amide/amide-current/src/amitk_study.c
+@@ -36,6 +36,7 @@
+ #include "amitk_marshal.h"
+ #include "amitk_type_builtins.h"
+ #include "legacy.h"
++#include "amide.h"
+ 
+ 
+ enum {
+@@ -259,12 +260,7 @@
+ 
+   /* preferences for the canvas */
+   study->canvas_roi_width = AMITK_PREFERENCES_DEFAULT_CANVAS_ROI_WIDTH;
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+   study->canvas_roi_transparency = AMITK_PREFERENCES_DEFAULT_CANVAS_ROI_TRANSPARENCY;
+-#else
+-  study->canvas_line_style = AMITK_PREFERENCES_DEFAULT_CANVAS_LINE_STYLE;
+-  study->canvas_fill_roi = AMITK_PREFERENCES_DEFAULT_CANVAS_FILL_ROI;
+-#endif
+   study->canvas_layout = AMITK_PREFERENCES_DEFAULT_CANVAS_LAYOUT;
+   study->canvas_maintain_size = AMITK_PREFERENCES_DEFAULT_CANVAS_LAYOUT;
+   study->canvas_target_empty_area = AMITK_PREFERENCES_DEFAULT_CANVAS_TARGET_EMPTY_AREA; 
+@@ -343,12 +339,7 @@
+ 
+   /* preferences */
+   dest_study->canvas_roi_width = AMITK_STUDY_CANVAS_ROI_WIDTH(src_object);
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+   dest_study->canvas_roi_transparency = AMITK_STUDY_CANVAS_ROI_TRANSPARENCY(src_object);
+-#else
+-  dest_study->canvas_line_style = AMITK_STUDY_CANVAS_LINE_STYLE(src_object);
+-  dest_study->canvas_fill_roi = AMITK_STUDY_CANVAS_FILL_ROI(src_object);
+-#endif
+   dest_study->canvas_layout = AMITK_STUDY_CANVAS_LAYOUT(src_object);
+   dest_study->canvas_maintain_size = AMITK_STUDY_CANVAS_MAINTAIN_SIZE(src_object);
+   dest_study->canvas_target_empty_area = AMITK_STUDY_CANVAS_TARGET_EMPTY_AREA(src_object);
+@@ -394,12 +385,7 @@
+ 
+   /* preferences */
+   xml_save_int(nodes, "canvas_roi_width", AMITK_STUDY_CANVAS_ROI_WIDTH(study));
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+   xml_save_real(nodes, "canvas_roi_transparency", AMITK_STUDY_CANVAS_ROI_TRANSPARENCY(study));
+-#else
+-  xml_save_int(nodes, "canvas_line_style", AMITK_STUDY_CANVAS_LINE_STYLE(study));
+-  xml_save_int(nodes, "canvas_fill_roi", AMITK_STUDY_CANVAS_FILL_ROI(study));
+-#endif
+   xml_save_string(nodes, "canvas_layout", amitk_layout_get_name(AMITK_STUDY_CANVAS_LAYOUT(study)));
+   xml_save_boolean(nodes, "canvas_maintain_size", AMITK_STUDY_CANVAS_MAINTAIN_SIZE(study));
+   xml_save_int(nodes, "canvas_target_empty_area", AMITK_STUDY_CANVAS_TARGET_EMPTY_AREA(study));
+@@ -444,23 +430,9 @@
+ 				   xml_get_int_with_default(nodes, "canvas_roi_width", 
+ 							    AMITK_STUDY_CANVAS_ROI_WIDTH(study)));  
+ 
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+   amitk_study_set_canvas_roi_transparency(study,
+ 					  xml_get_real_with_default(nodes, "canvas_roi_transparency",
+ 								    AMITK_STUDY_CANVAS_ROI_TRANSPARENCY(study)));
+-#else
+-  amitk_study_set_canvas_line_style(study, 
+-				    xml_get_int_with_default(nodes, "canvas_line_style",
+-							     AMITK_STUDY_CANVAS_LINE_STYLE(study)));  
+-  if (xml_node_exists(nodes, "canvas_fill_isocontour")) /* legacy */
+-    amitk_study_set_canvas_fill_roi(study, 
+-				    xml_get_int_with_default(nodes, "canvas_fill_isocontour",
+-							     AMITK_STUDY_CANVAS_FILL_ROI(study)));  
+-  else
+-    amitk_study_set_canvas_fill_roi(study, 
+-				    xml_get_int_with_default(nodes, "canvas_fill_roi",
+-							     AMITK_STUDY_CANVAS_FILL_ROI(study)));  
+-#endif
+ 
+   amitk_study_set_canvas_maintain_size(study, 
+ 				       xml_get_boolean_with_default(nodes, "canvas_maintain_size",
+@@ -618,12 +590,7 @@
+ 
+   if (preferences != NULL) {
+     study->canvas_roi_width = AMITK_PREFERENCES_CANVAS_ROI_WIDTH(preferences);
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+     study->canvas_roi_transparency = AMITK_PREFERENCES_CANVAS_ROI_TRANSPARENCY(preferences);
+-#else
+-    study->canvas_line_style = AMITK_PREFERENCES_CANVAS_LINE_STYLE(preferences);
+-    study->canvas_fill_roi = AMITK_PREFERENCES_CANVAS_FILL_ROI(preferences);
+-#endif
+     study->canvas_layout = AMITK_PREFERENCES_CANVAS_LAYOUT(preferences);
+     study->canvas_maintain_size = AMITK_PREFERENCES_CANVAS_MAINTAIN_SIZE(preferences);
+     study->canvas_target_empty_area = AMITK_PREFERENCES_CANVAS_TARGET_EMPTY_AREA(preferences);
+@@ -785,12 +752,12 @@
+ 
+ /* note, at least one canvas has to remain visible at all times, function won't 
+    set visible to FALSE for a canvas if this condition will not be met */
+-void amitk_study_set_canvas_visible(AmitkStudy * study, const AmitkView view, const gboolean visible) {
++gboolean amitk_study_set_canvas_visible(AmitkStudy * study, const AmitkView view, const gboolean visible) {
+ 
+   AmitkView i_view;
+   gboolean one_visible;
+ 
+-  g_return_if_fail(AMITK_IS_STUDY(study));
++  g_return_val_if_fail(AMITK_IS_STUDY(study), FALSE);
+ 
+   /* make sure one canvas will remain visible */
+   one_visible = FALSE;
+@@ -800,14 +767,14 @@
+     else
+       one_visible = one_visible || AMITK_STUDY_CANVAS_VISIBLE(study, i_view);
+   }
+-  if (!one_visible) return; 
++  if (!one_visible) return FALSE;
+ 
+   if (AMITK_STUDY_CANVAS_VISIBLE(study, view) != visible) {
+     study->canvas_visible[view] = visible;
+     g_signal_emit(G_OBJECT(study), study_signals[CANVAS_VISIBLE_CHANGED], 0);
+   }
+ 
+-  return;
++  return TRUE;
+ }
+ 
+ void amitk_study_set_zoom(AmitkStudy * study, const amide_real_t new_zoom) {
+@@ -864,7 +831,6 @@
+   return;
+ }
+ 
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+ void amitk_study_set_canvas_roi_transparency(AmitkStudy * study, const gdouble transparency) {
+ 
+   g_return_if_fail(AMITK_IS_STUDY(study));
+@@ -879,33 +845,6 @@
+   return;
+ }
+ 
+-
+-#else
+-void amitk_study_set_canvas_line_style(AmitkStudy * study, const GdkLineStyle line_style){
+-
+-  g_return_if_fail(AMITK_IS_STUDY(study));
+-
+-  if (AMITK_STUDY_CANVAS_LINE_STYLE(study) != line_style) {
+-    study->canvas_line_style = line_style;
+-    g_signal_emit(G_OBJECT(study), study_signals[CANVAS_ROI_PREFERENCE_CHANGED], 0);
+-  }
+-
+-  return;
+-}
+-
+-void amitk_study_set_canvas_fill_roi(AmitkStudy * study, const gboolean fill_roi){
+-
+-  g_return_if_fail(AMITK_IS_STUDY(study));
+-
+-  if (AMITK_STUDY_CANVAS_FILL_ROI(study) != fill_roi) {
+-    study->canvas_fill_roi = fill_roi;
+-    g_signal_emit(G_OBJECT(study), study_signals[CANVAS_ROI_PREFERENCE_CHANGED], 0);
+-  }
+-
+-  return;
+-}
+-#endif
+-
+ void amitk_study_set_canvas_layout(AmitkStudy * study, const AmitkLayout layout) {
+ 
+   g_return_if_fail(AMITK_IS_STUDY(study));
+--- amide.orig/amide-current/src/amitk_study.h
++++ amide/amide-current/src/amitk_study.h
+@@ -59,12 +59,7 @@
+ #define AMITK_STUDY_CANVAS_TARGET(stu)            (AMITK_STUDY(stu)->canvas_target)
+ 
+ #define AMITK_STUDY_CANVAS_ROI_WIDTH(stu)         (AMITK_STUDY(stu)->canvas_roi_width)
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+ #define AMITK_STUDY_CANVAS_ROI_TRANSPARENCY(stu)  (AMITK_STUDY(stu)->canvas_roi_transparency)
+-#else
+-#define AMITK_STUDY_CANVAS_LINE_STYLE(stu)        (AMITK_STUDY(stu)->canvas_line_style)
+-#define AMITK_STUDY_CANVAS_FILL_ROI(stu)          (AMITK_STUDY(stu)->canvas_fill_roi)
+-#endif
+ #define AMITK_STUDY_CANVAS_LAYOUT(stu)            (AMITK_STUDY(stu)->canvas_layout)
+ #define AMITK_STUDY_CANVAS_MAINTAIN_SIZE(stu)     (AMITK_STUDY(stu)->canvas_maintain_size)
+ #define AMITK_STUDY_CANVAS_TARGET_EMPTY_AREA(stu) (AMITK_STUDY(stu)->canvas_target_empty_area)
+@@ -104,12 +99,7 @@
+ 
+   /* canvas preferences */
+   gint canvas_roi_width;
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+   gdouble canvas_roi_transparency;
+-#else
+-  GdkLineStyle canvas_line_style;
+-  gboolean canvas_fill_roi;
+-#endif
+   AmitkLayout canvas_layout;
+   gboolean canvas_maintain_size;
+   gint canvas_target_empty_area; /* in pixels */
+@@ -170,7 +160,7 @@
+ 						     const AmitkFuseType new_fuse_type);
+ void            amitk_study_set_view_mode           (AmitkStudy * study,
+ 						     const AmitkViewMode new_view_mode);
+-void            amitk_study_set_canvas_visible      (AmitkStudy * study,
++gboolean        amitk_study_set_canvas_visible      (AmitkStudy * study,
+ 						     const AmitkView view,
+ 						     const gboolean visible);
+ void            amitk_study_set_zoom                (AmitkStudy * study,
+@@ -181,15 +171,8 @@
+ 						     const gboolean always_on);
+ void            amitk_study_set_canvas_roi_width    (AmitkStudy * study,
+ 						     gint roi_width);
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+ void            amitk_study_set_canvas_roi_transparency(AmitkStudy * study,
+ 							const gdouble transparency);
+-#else
+-void            amitk_study_set_canvas_line_style   (AmitkStudy * study,
+-						     const GdkLineStyle line_style);
+-void            amitk_study_set_canvas_fill_roi     (AmitkStudy * study,
+-						     const gboolean fill_roi);
+-#endif
+ void            amitk_study_set_canvas_layout       (AmitkStudy * study,
+ 						     const AmitkLayout layout);
+ void            amitk_study_set_canvas_maintain_size(AmitkStudy * study,
+--- amide.orig/amide-current/src/amide.h
++++ amide/amide-current/src/amide.h
+@@ -45,6 +45,25 @@
+   AMIDE_EYE_NUM
+ } AmideEye;
+ 
++/* Ugly workaround for old GLib bug that is being exposed:
++   https://gitlab.gnome.org/GNOME/glib/-/issues/299.  The program
++   often aborts with the custom log handler with:
++   (process:1197716): GdkPixbuf-DEBUG (recursed):
++   gdk_pixbuf_from_pixdata() called on:  */
++#undef g_warning
++#undef g_message
++#undef g_debug
++#define g_warning(...) amide_log(G_LOG_DOMAIN, G_LOG_LEVEL_WARNING, \
++                                 __VA_ARGS__)
++#define g_message(...) amide_log(G_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE, \
++                                 __VA_ARGS__)
++#define g_debug(...)   amide_log(G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, \
++                                 __VA_ARGS__)
++
++void amide_log(const gchar *log_domain,
++               GLogLevelFlags log_level,
++               const gchar *format,
++               ...);
+ 
+ /* external variables */
+ extern gchar * object_menu_names[];
+--- amide.orig/amide-current/src/alignment_procrustes.c
++++ amide/amide-current/src/alignment_procrustes.c
+@@ -31,6 +31,7 @@
+ #include <gsl/gsl_linalg.h>
+ #include "alignment_procrustes.h"
+ #include "amitk_fiducial_mark.h"
++#include "amide.h"
+ 
+ /* convient functions that gsl doesn't supply */
+ static gsl_matrix * matrix_mult(gsl_matrix * matrix1, gsl_matrix * matrix2) {
+--- amide.orig/amide-current/src/amide_gconf.c
++++ amide/amide-current/src/amide_gconf.c
+@@ -27,6 +27,7 @@
+ 
+ 
+ #include "amide_gconf.h"
++#include "amide.h"
+ 
+ 
+ 
+--- amide.orig/amide-current/src/amitk_data_set.c
++++ amide/amide-current/src/amitk_data_set.c
+@@ -29,6 +29,7 @@
+ #include "amitk_marshal.h"
+ #include "amitk_type_builtins.h"
+ #include "amitk_line_profile.h"
++#include "amide.h"
+ 
+ /* variable type function declarations */
+ #include "amitk_data_set_UBYTE_0D_SCALING.h"
+--- amide.orig/amide-current/src/amitk_data_set_variable_type.c
++++ amide/amide-current/src/amitk_data_set_variable_type.c
+@@ -26,6 +26,7 @@
+ #include "amide_config.h"
+ #include "amitk_data_set_`'m4_Variable_Type`'_`'m4_Scale_Dim`'.h"
+ #include "amitk_data_set_FLOAT_0D_SCALING.h"
++#include "amide.h"
+ 
+ #ifdef AMIDE_DEBUG
+ #include <stdlib.h>
+--- amide.orig/amide-current/src/amitk_filter.c
++++ amide/amide-current/src/amitk_filter.c
+@@ -27,6 +27,7 @@
+ #include <math.h>
+ #include "amitk_filter.h"
+ #include "amitk_type_builtins.h"
++#include "amide.h"
+ #ifdef AMIDE_LIBGSL_SUPPORT
+ #include <gsl/gsl_complex_math.h>
+ #endif
+--- amide.orig/amide-current/src/amitk_point.c
++++ amide/amide-current/src/amitk_point.c
+@@ -28,6 +28,7 @@
+ #include "amitk_point.h"
+ #include "amitk_marshal.h"
+ #include "amitk_type_builtins.h"
++#include "amide.h"
+ 
+ 
+ const AmitkAxes base_axes =
+--- amide.orig/amide-current/src/amitk_raw_data.c
++++ amide/amide-current/src/amitk_raw_data.c
+@@ -31,6 +31,7 @@
+ #include "amitk_raw_data.h"
+ #include "amitk_marshal.h"
+ #include "amitk_type_builtins.h"
++#include "amide.h"
+ 
+ #define DATA_CONTENT(data, dim, voxel) ((data)[(voxel).x + (dim).x*(voxel).y])
+ 
+--- amide.orig/amide-current/src/amitk_roi_variable_type.c
++++ amide/amide-current/src/amitk_roi_variable_type.c
+@@ -30,6 +30,7 @@
+ #include <sys/time.h>
+ #include <glib.h>
+ #include "amitk_roi_`'m4_Variable_Type`'.h"
++#include "amide.h"
+ 
+ 
+ #define ROI_TYPE_`'m4_Variable_Type`'
+@@ -279,9 +280,6 @@
+ AmitkDataSet * amitk_roi_`'m4_Variable_Type`'_get_intersection_slice(const AmitkRoi * roi,
+ 								     const AmitkVolume * canvas_slice,
+ 								     const amide_real_t pixel_dim
+-#ifndef AMIDE_LIBGNOMECANVAS_AA
+-								     ,const gboolean fill_map_roi
+-#endif
+ 								     ) {
+ 
+ 
+@@ -370,13 +368,8 @@
+ 	  AMITK_RAW_DATA_UBYTE_SET_CONTENT(intersection->raw_data, i_voxel) = 1;
+ #else /* ISOCONTOUR_3D or FREEHAND_3D */
+ 
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+         if (value > 0)
+ 	  AMITK_RAW_DATA_UBYTE_SET_CONTENT(intersection->raw_data, i_voxel) = value;
+-#else
+-	if ((value == 1) || ((value > 0) && fill_map_roi))
+-	  AMITK_RAW_DATA_UBYTE_SET_CONTENT(intersection->raw_data, i_voxel) = 1;
+-#endif
+ #endif
+       }
+ #if FAST_INTERSECTION_SLICE
+@@ -394,9 +387,6 @@
+   }
+ 
+ #if defined(ROI_TYPE_ISOCONTOUR_2D) || defined(ROI_TYPE_FREEHAND_2D)
+-#ifndef AMIDE_LIBGNOMECANVAS_AA
+-  if (!fill_map_roi) 
+-#endif
+     {
+       /* mark the edges as such on the 2D isocontour or freehand slices */
+       i_voxel.z = i_voxel.g = i_voxel.t = 0;
+--- amide.orig/amide-current/src/amitk_space.c
++++ amide/amide-current/src/amitk_space.c
+@@ -27,6 +27,7 @@
+ #include "amitk_space.h"
+ #include "amitk_marshal.h"
+ #include "amitk_type_builtins.h"
++#include "amide.h"
+ 
+ 
+ enum {
+--- amide.orig/amide-current/src/analysis.c
++++ amide/amide-current/src/analysis.c
+@@ -33,6 +33,7 @@
+ #ifdef AMIDE_DEBUG
+ #include <sys/timeb.h>
+ #endif
++#include "amide.h"
+ 
+ 
+ 
+--- amide.orig/amide-current/src/libmdc_interface.c
++++ amide/amide-current/src/libmdc_interface.c
+@@ -30,6 +30,7 @@
+ #include "amitk_data_set.h"
+ #include "amitk_data_set_DOUBLE_0D_SCALING.h"
+ #include "libmdc_interface.h"
++#include "amide.h"
+ #include <medcon.h>
+ #include <string.h>
+ #include <locale.h>
+--- amide.orig/amide-current/src/mpeg_encode.c
++++ amide/amide-current/src/mpeg_encode.c
+@@ -33,6 +33,7 @@
+ #include <math.h>
+ #include "amide_intl.h"
+ #include "mpeg_encode.h"
++#include "amide.h"
+ 
+ /* note, this is identifical to fame_yuv_t */
+ typedef struct __yuv_t_ {
+--- amide.orig/amide-current/src/render.c
++++ amide/amide-current/src/render.c
+@@ -32,6 +32,7 @@
+ #include "render.h"
+ #include "amitk_roi.h"
+ #include "amitk_data_set_DOUBLE_0D_SCALING.h"
++#include "amide.h"
+ 
+ #include <sys/time.h>
+ #include <time.h>
+--- amide.orig/amide-current/src/vistaio_interface.c
++++ amide/amide-current/src/vistaio_interface.c
+@@ -31,6 +31,7 @@
+ #include "amitk_data_set.h"
+ #include "amitk_data_set_DOUBLE_0D_SCALING.h"
+ #include "vistaio_interface.h"
++#include "amide.h"
+ #include <vistaio.h>
+ #include <string.h>
+ #include <locale.h>
+--- amide.orig/amide-current/src/xml.c
++++ amide/amide-current/src/xml.c
+@@ -30,6 +30,7 @@
+ #include <string.h>
+ #include <locale.h>
+ #include "amitk_common.h"
++#include "amide.h"
+ 
+ #define BOOLEAN_STRING_MAX_LENGTH 10 /* when we stop checking */
+ static char * true_string = "true";
+--- /dev/null
++++ amide/amide-current/src/render.ui
+@@ -0,0 +1,34 @@
++<?xml version="1.0" encoding="UTF-8"?>
++<interface>
++  <menu id="menubar">
++    <submenu>
++      <attribute name="label" translatable="yes">_File</attribute>
++      <section id="file">
++        <item>
++          <attribute name="label" translatable="yes">_Export Rendering</attribute>
++          <attribute name="action">render.export</attribute>
++        </item>
++        <item>
++          <attribute name="label" translatable="yes">_Create Movie</attribute>
++          <attribute name="action">render.movie</attribute>
++        </item>
++      </section>
++      <section>
++        <item>
++          <attribute name="label" translatable="yes">_Close</attribute>
++          <attribute name="action">render.close</attribute>
++          <attribute name="icon">window-close</attribute>
++        </item>
++      </section>
++    </submenu>
++    <submenu>
++      <attribute name="label" translatable="yes">_Edit</attribute>
++      <section>
++        <item>
++          <attribute name="label" translatable="yes">_Rendering Parameters</attribute>
++          <attribute name="action">render.parameters</attribute>
++        </item>
++      </section>
++    </submenu>
++  </menu>
++</interface>
+--- /dev/null
++++ amide/amide-current/src/series.ui
+@@ -0,0 +1,21 @@
++<?xml version="1.0" encoding="UTF-8"?>
++<interface>
++  <menu id="menubar">
++    <submenu>
++      <attribute name="label" translatable="yes">_File</attribute>
++      <section>
++        <item>
++          <attribute name="label" translatable="yes">_Export Series</attribute>
++          <attribute name="action">series.export</attribute>
++        </item>
++      </section>
++      <section>
++        <item>
++          <attribute name="label" translatable="yes">_Close</attribute>
++          <attribute name="action">series.close</attribute>
++          <attribute name="icon">window-close</attribute>
++        </item>
++      </section>
++    </submenu>
++  </menu>
++</interface>
+--- amide.orig/amide-current/src/amitk_preferences.c
++++ amide/amide-current/src/amitk_preferences.c
+@@ -132,18 +132,9 @@
+   preferences->canvas_roi_width = 
+     amide_gconf_get_int_with_default(GCONF_AMIDE_ROI,"width", AMITK_PREFERENCES_DEFAULT_CANVAS_ROI_WIDTH);
+ 
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+   preferences->canvas_roi_transparency = 
+     amide_gconf_get_float_with_default(GCONF_AMIDE_ROI,"transparency", AMITK_PREFERENCES_DEFAULT_CANVAS_ROI_TRANSPARENCY);
+ 
+-#else
+-  preferences->canvas_line_style = 
+-    amide_gconf_get_int_with_default(GCONF_AMIDE_ROI,"LineStyle",AMITK_PREFERENCES_DEFAULT_CANVAS_LINE_STYLE);
+-
+-  preferences->canvas_fill_roi = 
+-    amide_gconf_get_bool_with_default(GCONF_AMIDE_ROI,"FillIsocontour", AMITK_PREFERENCES_DEFAULT_CANVAS_FILL_ROI);
+-#endif
+-
+   preferences->canvas_layout = 
+     amide_gconf_get_int_with_default(GCONF_AMIDE_CANVAS,"layout", AMITK_PREFERENCES_DEFAULT_CANVAS_LAYOUT);
+ 
+@@ -237,7 +228,6 @@
+   return;
+ }
+ 
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+ void amitk_preferences_set_canvas_roi_transparency(AmitkPreferences * preferences, 
+ 						   gdouble roi_transparency) {
+ 
+@@ -255,34 +245,6 @@
+   return;
+ }
+ 
+-#else
+-void amitk_preferences_set_canvas_line_style(AmitkPreferences * preferences, GdkLineStyle line_style) {
+-
+-  g_return_if_fail(AMITK_IS_PREFERENCES(preferences));
+-
+-  if (AMITK_PREFERENCES_CANVAS_LINE_STYLE(preferences) != line_style) {
+-    preferences->canvas_line_style = line_style;
+-    amide_gconf_set_int(GCONF_AMIDE_ROI,"LineStyle",line_style);
+-    g_signal_emit(G_OBJECT(preferences), preferences_signals[STUDY_PREFERENCES_CHANGED], 0);
+-  }
+-
+-  return;
+-}
+-
+-void amitk_preferences_set_canvas_fill_roi(AmitkPreferences * preferences, gboolean fill_roi) {
+-
+-  g_return_if_fail(AMITK_IS_PREFERENCES(preferences));
+-
+-  if (AMITK_PREFERENCES_CANVAS_FILL_ROI(preferences) != fill_roi) {
+-    preferences->canvas_fill_roi = fill_roi;
+-    amide_gconf_set_bool(GCONF_AMIDE_ROI,"FillIsocontour",fill_roi);
+-    g_signal_emit(G_OBJECT(preferences), preferences_signals[STUDY_PREFERENCES_CHANGED], 0);
+-  }
+-
+-  return;
+-}
+-#endif
+-
+ void amitk_preferences_set_canvas_layout(AmitkPreferences * preferences, 
+ 					 AmitkLayout layout) {
+ 
+--- amide.orig/amide-current/src/amitk_roi.c
++++ amide/amide-current/src/amitk_roi.c
+@@ -568,9 +568,6 @@
+ AmitkDataSet * amitk_roi_get_intersection_slice(const AmitkRoi * roi, 
+ 						const AmitkVolume * canvas_volume,
+ 						const amide_real_t pixel_dim
+-#ifndef AMIDE_LIBGNOMECANVAS_AA
+-						,const gboolean fill_map_roi
+-#endif
+ 						) {
+   
+   AmitkDataSet * intersection = NULL;
+@@ -583,33 +580,21 @@
+   case AMITK_ROI_TYPE_ISOCONTOUR_2D:
+     intersection = 
+       amitk_roi_ISOCONTOUR_2D_get_intersection_slice(roi, canvas_volume, pixel_dim 
+-#ifndef AMIDE_LIBGNOMECANVAS_AA
+-						     , fill_map_roi
+-#endif
+ 						     );
+     break;
+   case AMITK_ROI_TYPE_ISOCONTOUR_3D:
+     intersection = 
+       amitk_roi_ISOCONTOUR_3D_get_intersection_slice(roi, canvas_volume, pixel_dim 
+-#ifndef AMIDE_LIBGNOMECANVAS_AA
+-						     , fill_map_roi
+-#endif
+ 						     );
+     break;
+   case AMITK_ROI_TYPE_FREEHAND_2D:
+     intersection =
+       amitk_roi_FREEHAND_2D_get_intersection_slice(roi, canvas_volume, pixel_dim 
+-#ifndef AMIDE_LIBGNOMECANVAS_AA
+-						   , fill_map_roi
+-#endif
+ 						   );
+     break;
+   case AMITK_ROI_TYPE_FREEHAND_3D:
+     intersection =
+       amitk_roi_FREEHAND_3D_get_intersection_slice(roi, canvas_volume, pixel_dim 
+-#ifndef AMIDE_LIBGNOMECANVAS_AA
+-						   , fill_map_roi
+-#endif
+ 						   );
+     break;
+   default: 
+--- amide.orig/amide-current/src/amitk_roi.h
++++ amide/amide-current/src/amitk_roi.h
+@@ -123,9 +123,6 @@
+ AmitkDataSet *  amitk_roi_get_intersection_slice  (const AmitkRoi * roi, 
+ 						   const AmitkVolume * canvas_slice,
+ 						   const amide_real_t pixel_dim
+-#ifndef AMIDE_LIBGNOMECANVAS_AA
+-						   , const gboolean fill_map_roi
+-#endif
+ 						   );
+ void            amitk_roi_set_specify_color       (AmitkRoi * roi,
+ 						   gboolean specify_color);
+--- amide.orig/amide-current/src/amitk_roi_variable_type.h
++++ amide/amide-current/src/amitk_roi_variable_type.h
+@@ -45,9 +45,6 @@
+ AmitkDataSet * amitk_roi_`'m4_Variable_Type`'_get_intersection_slice(const AmitkRoi * roi,
+ 								     const AmitkVolume * canvas_slice,
+ 								     const amide_real_t pixel_dim
+-#ifndef AMIDE_LIBGNOMECANVAS_AA
+-								     ,const gboolean fill_roi
+-#endif
+ 								     );
+ void amitk_roi_`'m4_Variable_Type`'_set_isocontour(AmitkRoi * roi, 
+ 						   AmitkDataSet * ds, 
+--- amide.orig/amide-current/src/image.c
++++ amide/amide-current/src/image.c
+@@ -155,11 +155,7 @@
+ GdkPixbuf * image_slice_intersection(const AmitkRoi * roi,
+ 				     const AmitkVolume * canvas_slice,
+ 				     const amide_real_t pixel_size,
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+ 				     const gdouble transparency,
+-#else
+-				     const gboolean fill_roi,
+-#endif
+ 				     rgba_t color,
+ 				     AmitkPoint * return_offset,
+ 				     AmitkPoint * return_corner) {
+@@ -169,17 +165,12 @@
+   AmitkVoxel i;
+   guchar * rgba_data;
+   AmitkVoxel dim;
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+   guchar transparency_byte;
+ 
+   transparency_byte = transparency * 0xFF;
+-#endif
+ 
+   
+   intersection = amitk_roi_get_intersection_slice(roi, canvas_slice, pixel_size 
+-#ifndef AMIDE_LIBGNOMECANVAS_AA
+-						  , fill_roi
+-#endif
+ 						  );
+   if (intersection == NULL) return NULL;
+ 
+@@ -202,18 +193,12 @@
+ 	rgba_data[(dim.y-i.y-1)*dim.x*4 + i.x*4+0] = color.r;
+ 	rgba_data[(dim.y-i.y-1)*dim.x*4 + i.x*4+1] = color.g;
+ 	rgba_data[(dim.y-i.y-1)*dim.x*4 + i.x*4+2] = color.b;
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+ 	rgba_data[(dim.y-i.y-1)*dim.x*4 + i.x*4+3] = color.a;
+-#else
+-	rgba_data[(dim.y-i.y-1)*dim.x*4 + i.x*4+3] = 0xFF;
+-#endif
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+       }	else if (AMITK_RAW_DATA_UBYTE_CONTENT(intersection->raw_data, i) == 2) {
+ 	rgba_data[(dim.y-i.y-1)*dim.x*4 + i.x*4+0] = color.r;
+ 	rgba_data[(dim.y-i.y-1)*dim.x*4 + i.x*4+1] = color.g;
+ 	rgba_data[(dim.y-i.y-1)*dim.x*4 + i.x*4+2] = color.b;
+ 	rgba_data[(dim.y-i.y-1)*dim.x*4 + i.x*4+3] = transparency_byte;
+-#endif
+       }	else {
+ 	rgba_data[(dim.y-i.y-1)*dim.x*4 + i.x*4+0] = 0x00;
+ 	rgba_data[(dim.y-i.y-1)*dim.x*4 + i.x*4+1] = 0x00;
+--- amide.orig/amide-current/src/image.h
++++ amide/amide-current/src/image.h
+@@ -40,11 +40,7 @@
+ GdkPixbuf * image_slice_intersection(const AmitkRoi * roi,
+ 				     const AmitkVolume * canvas_slice,
+ 				     const amide_real_t pixel_size,
+-#ifdef AMIDE_LIBGNOMECANVAS_AA
+ 				     const gdouble transparency,
+-#else
+-				     const gboolean fill_roi,
+-#endif
+ 				     rgba_t color,
+ 				     AmitkPoint * return_offset,
+ 				     AmitkPoint * return_corner);
+--- /dev/null
++++ amide/amide-current/pixmaps/icons.xml.in
+@@ -0,0 +1,50 @@
++<?xml version="1.0" encoding="UTF-8"?>
++<gresources>
++  <gresource prefix="/com/github/ferdymercury/amide/icons">
++    <file alias="amide_icon_logo.png">@srcdir@/amide_logo.png</file>
++    <file alias="amide_icon_align_pt.png">@srcdir@/align_pt.png</file>
++    <file alias="amide_icon_fuse_type_blend.png">@srcdir@/fuse_type_blend.png</file>
++    <file alias="amide_icon_fuse_type_overlay.png">@srcdir@/fuse_type_overlay.png</file>
++    <file alias="amide_icon_interpolation_nearest_neighbor.png">@srcdir@/interpolation_nearest_neighbor.png</file>
++    <file alias="amide_icon_interpolation_trilinear.png">@srcdir@/interpolation_trilinear.png</file>
++    <file alias="amide_icon_layout_linear.png">@srcdir@/layout_linear.png</file>
++    <file alias="amide_icon_layout_orthogonal.png">@srcdir@/layout_orthogonal.png</file>
++    <file alias="amide_icon_panels_mixed.png">@srcdir@/panels_mixed.png</file>
++    <file alias="amide_icon_panels_linear_x.png">@srcdir@/panels_linear_x.png</file>
++    <file alias="amide_icon_panels_linear_y.png">@srcdir@/panels_linear_y.png</file>
++    <file alias="amide_icon_roi_box.png">@srcdir@/roi_box.png</file>
++    <file alias="amide_icon_roi_cylinder.png">@srcdir@/roi_cylinder.png</file>
++    <file alias="amide_icon_roi_ellipsoid.png">@srcdir@/roi_ellipsoid.png</file>
++    <file alias="amide_icon_roi_isocontour_2d.png">@srcdir@/roi_isocontour_2d.png</file>
++    <file alias="amide_icon_roi_isocontour_3d.png">@srcdir@/roi_isocontour_3d.png</file>
++    <file alias="amide_icon_roi_freehand_2d.png">@srcdir@/roi_freehand_2d.png</file>
++    <file alias="amide_icon_roi_freehand_3d.png">@srcdir@/roi_freehand_3d.png</file>
++    <file alias="amide_icon_study.png">@srcdir@/study.png</file>
++    <file alias="amide_icon_canvas_target.png">@srcdir@/target.png</file>
++    <file alias="amide_icon_transfer_function.png">@srcdir@/transfer_function.png</file>
++    <file alias="amide_icon_threshold_style_min_max.png">@srcdir@/threshold_style_min_max.png</file>
++    <file alias="amide_icon_threshold_style_center_width.png">@srcdir@/threshold_style_center_width.png</file>
++    <file alias="amide_icon_thresholding.png">@srcdir@/thresholding.png</file>
++    <file alias="amide_icon_thresholding_per_slice.png">@srcdir@/thresholding_per_slice.png</file>
++    <file alias="amide_icon_thresholding_per_frame.png">@srcdir@/thresholding_per_frame.png</file>
++    <file alias="amide_icon_thresholding_interpolate_frames.png">@srcdir@/thresholding_interpolate_frames.png</file>
++    <file alias="amide_icon_thresholding_global.png">@srcdir@/thresholding_global.png</file>
++    <file alias="amide_icon_two_compartment.png">@srcdir@/two_compartment.png</file>
++    <file alias="amide_icon_view_transverse.png">@srcdir@/view_transverse.png</file>
++    <file alias="amide_icon_view_coronal.png">@srcdir@/view_coronal.png</file>
++    <file alias="amide_icon_view_sagittal.png">@srcdir@/view_sagittal.png</file>
++    <file alias="amide_icon_view_mode_single.png">@srcdir@/view_single.png</file>
++    <file alias="amide_icon_view_mode_linked_2way.png">@srcdir@/view_linked.png</file>
++    <file alias="amide_icon_view_mode_linked_3way.png">@srcdir@/view_linked3.png</file>
++    <file alias="amide_icon_window_abdomen.png">@srcdir@/window_abdomen.png</file>
++    <file alias="amide_icon_window_brain.png">@srcdir@/window_brain.png</file>
++    <file alias="amide_icon_window_extremities.png">@srcdir@/window_extremities.png</file>
++    <file alias="amide_icon_window_window_liver.png">@srcdir@/window_liver.png</file>
++    <file alias="amide_icon_window_lung.png">@srcdir@/window_lung.png</file>
++    <file alias="amide_icon_window_pelvis_soft_tissue.png">@srcdir@/window_pelvis_soft_tissue.png</file>
++    <file alias="amide_icon_window_skull_base.png">@srcdir@/window_skull_base.png</file>
++    <file alias="amide_icon_window_spine_a.png">@srcdir@/window_spine_a.png</file>
++    <file alias="amide_icon_window_spine_b.png">@srcdir@/window_spine_b.png</file>
++    <file alias="amide_icon_window_soft_tissue.png">@srcdir@/window_thorax_soft_tissue.png</file>
++  </gresource>
++</gresources>
diff --git a/debian/patches/series b/debian/patches/series
index 6dd1437..c176e58 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -7,3 +7,4 @@ debian-djdecode.patch
 ffmpeg-5.patch
 typos.patch
 gsettings.patch
+gtk3+goocanvas.patch
-- 
2.43.0

-------------- next part --------------
>From a33ddec00cf4f1724162f3d8b0dcab9b7c132cd7 Mon Sep 17 00:00:00 2001
From: Yavor Doganov <yavor at gnu.org>
Date: Thu, 22 Feb 2024 15:57:22 +0200
Subject: [PATCH 3/5] Remove GnomeVFS support

---
 debian/changelog                  |   4 +-
 debian/patches/no-gnome-vfs.patch | 348 ++++++++++++++++++++++++++++++
 debian/patches/series             |   1 +
 debian/rules                      |   1 -
 4 files changed, 352 insertions(+), 2 deletions(-)
 create mode 100644 debian/patches/no-gnome-vfs.patch

diff --git a/debian/changelog b/debian/changelog
index ee29993..711ea58 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,7 +4,9 @@ amide (1.0.6-4) UNRELEASED; urgency=medium
   * debian/patches/gsettings.patch: New; port to GSettings.
   * debian/patches/gtk3+goocanvas.patch: New; port to GTK 3 and GooCanvas
     2.0 (Closes: #967252).
-  * debian/rules (override_dh_auto_configure): Remove --disable-gconf.
+  * debian/patches/no-gnome-vfs.patch: New; remove GnomeVFS support.
+  * debian/rules (override_dh_auto_configure): Remove --disable-gconf and
+    --disable-gnome-vfs.
   * debian/control (Build-Depends): Replace libgtk2.0-dev and
     libgnomecanvas2-dev with libgtk-3-dev and libgoocanvas-2.0-dev.
   * debian/NEWS: New file; inform users that configuration is lost.
diff --git a/debian/patches/no-gnome-vfs.patch b/debian/patches/no-gnome-vfs.patch
new file mode 100644
index 0000000..70166a5
--- /dev/null
+++ b/debian/patches/no-gnome-vfs.patch
@@ -0,0 +1,348 @@
+Description: Remove GnomeVFS support (also fix a memory leak).
+Author: Yavor Doganov <yavor at gnu.org>
+Forwarded: no
+Last-Update: 2024-02-22
+---
+
+--- amide.orig/amide-current/configure.ac
++++ amide/amide-current/configure.ac
+@@ -376,25 +376,6 @@
+ 
+ GLIB_GSETTINGS
+ 
+-## add in gnome-vfs if not on win32 or gtk-osx
+-## gnome-vfs is only used by amide_gnome.c and only on unix
+-if (test $native_win32 = no) && (test $enable_native_gtk_osx = no); then
+-   AC_ARG_ENABLE(gnome-vfs, 
+-	[  --enable-gnome-vfs  Compile with gnome-vfs support [default=yes]], 
+-	enable_gnome_vfs="$enableval", 
+-	enable_gnome_vfs=yes)
+-    if test "x$enable_gnome_vfs" = "xyes"; then 
+-       PKG_CHECK_MODULES(AMIDE_GTK_EXTRA_GVFS,[
+-		gnome-vfs-2.0   >= 2.16.0
+-       ], [AC_DEFINE(AMIDE_USE_GNOME_VFS, 1, Use gnome-vfs for spawning help process)
+-          AMIDE_GTK_LIBS="$AMIDE_GTK_LIBS $AMIDE_GTK_EXTRA_GVFS_LIBS"
+-          AMIDE_GTK_CFLAGS="$AMIDE_GTK_CFLAGS $AMIDE_GTK_EXTRA_GVFS_CFLAGS"
+-       ])
+-    else 
+-        echo "Don't use gnome-vfs"
+-    fi
+-fi
+- 
+ AC_SUBST(AMIDE_GTK_LIBS)
+ AC_SUBST(AMIDE_GTK_CFLAGS)
+ 
+--- amide.orig/amide-current/src/amide_gnome.c
++++ amide/amide-current/src/amide_gnome.c
+@@ -36,303 +36,6 @@
+ #include "amitk_common.h"
+ #include "amide_gnome.h"
+ 
+-#if !defined(G_OS_WIN32) && !defined(AMIDE_NATIVE_GTK_OSX) && defined(AMIDE_USE_GNOME_VFS)
+-#include <libgnomevfs/gnome-vfs-utils.h>
+-#include <libgnomevfs/gnome-vfs-uri.h>
+-//#else
+-//#include <windows.h>
+-#endif
+-
+-typedef enum {
+-  AMIDE_GNOME_URL_ERROR_PARSE,
+-  AMIDE_GNOME_URL_ERROR_LAUNCH,
+-  AMIDE_GNOME_URL_ERROR_URL,
+-  AMIDE_GNOME_URL_ERROR_NO_DEFAULT,
+-  AMIDE_GNOME_URL_ERROR_NOT_SUPPORTED,
+-  AMIDE_GNOME_URL_ERROR_VFS,
+-  AMIDE_GNOME_URL_ERROR_CANCELLED
+-} AmideGnomeURLError;
+-
+-#define AMIDE_GNOME_URL_ERROR (amide_gnome_url_error_quark ())
+-
+-GQuark amide_gnome_url_error_quark (void) {
+-  static GQuark error_quark = 0;
+-
+-  if (error_quark == 0)
+-    error_quark = g_quark_from_static_string ("amide-gnome-url-error-quark");
+-
+-  return error_quark;
+-}
+-
+-
+-static gboolean amide_gnome_url_show_with_env (const char  *url,  char       **envp, GError     **error) {
+-#if !defined(G_OS_WIN32) && !defined(AMIDE_NATIVE_GTK_OSX) && defined(AMIDE_USE_GNOME_VFS)
+-	GnomeVFSResult result;
+-	GnomeVFSURI *vfs_uri;
+-
+-	g_return_val_if_fail (url != NULL, FALSE);
+-
+-	result = gnome_vfs_url_show_with_env (url, envp);
+-
+-	switch (result) {
+-	case GNOME_VFS_OK:
+-		return TRUE;
+-
+-	case GNOME_VFS_ERROR_INTERNAL:
+-		g_set_error (error,
+-		             AMIDE_GNOME_URL_ERROR,
+-			     AMIDE_GNOME_URL_ERROR_VFS,
+-			     _("Unknown internal error while displaying this location."));
+-		break;
+-
+-	case GNOME_VFS_ERROR_BAD_PARAMETERS:
+-		g_set_error (error,
+-			     AMIDE_GNOME_URL_ERROR,
+-			     AMIDE_GNOME_URL_ERROR_URL,
+-			     _("The specified location is invalid."));
+-		break;
+-
+-	case GNOME_VFS_ERROR_PARSE:
+-		g_set_error (error,
+-			     AMIDE_GNOME_URL_ERROR,
+-			     AMIDE_GNOME_URL_ERROR_PARSE,
+-			     _("There was an error parsing the default action command associated "
+-			       "with this location."));
+-		break;
+-
+-	case GNOME_VFS_ERROR_LAUNCH:
+-		g_set_error (error,
+-			     AMIDE_GNOME_URL_ERROR,
+-			     AMIDE_GNOME_URL_ERROR_LAUNCH,
+-			     _("There was an error launching the default action command associated "
+-			       "with this location."));
+-		break;
+-
+-	case GNOME_VFS_ERROR_NO_DEFAULT:
+-		g_set_error (error,
+-			     AMIDE_GNOME_URL_ERROR,
+-			     AMIDE_GNOME_URL_ERROR_NO_DEFAULT,
+-			     _("There is no default action associated with this location."));
+-		break;
+-
+-	case GNOME_VFS_ERROR_NOT_SUPPORTED:
+-		g_set_error (error,
+-			     AMIDE_GNOME_URL_ERROR,
+-			     AMIDE_GNOME_URL_ERROR_NOT_SUPPORTED,
+-			     _("The default action does not support this protocol."));
+-		break;
+-
+-	case GNOME_VFS_ERROR_CANCELLED:
+-		g_set_error (error,
+-		             AMIDE_GNOME_URL_ERROR,
+-			     AMIDE_GNOME_URL_ERROR_CANCELLED,
+-			     _("The request was cancelled."));
+-		break;
+-
+-	case GNOME_VFS_ERROR_HOST_NOT_FOUND:
+-		{
+-			vfs_uri = gnome_vfs_uri_new (url);
+-			if (gnome_vfs_uri_get_host_name (vfs_uri) != NULL) {
+-				g_set_error (error,
+-					     AMIDE_GNOME_URL_ERROR,
+-					     AMIDE_GNOME_URL_ERROR_VFS,
+-					     _("The host \"%s\" could not be found."),
+-					     gnome_vfs_uri_get_host_name (vfs_uri));
+-			} else {
+-				g_set_error (error,
+-					     AMIDE_GNOME_URL_ERROR,
+-					     AMIDE_GNOME_URL_ERROR_VFS,
+-					     _("The host could not be found."));
+-			}
+-			gnome_vfs_uri_unref (vfs_uri);
+-		}
+-		break;
+-
+-	case GNOME_VFS_ERROR_INVALID_URI:
+-	case GNOME_VFS_ERROR_NOT_FOUND:
+-		g_set_error (error,
+-		             AMIDE_GNOME_URL_ERROR,
+-			     AMIDE_GNOME_URL_ERROR_VFS,
+-			     _("The location or file could not be found."));
+-		break;
+-
+-	case GNOME_VFS_ERROR_LOGIN_FAILED:
+-		g_set_error (error,
+-			     AMIDE_GNOME_URL_ERROR,
+-			     AMIDE_GNOME_URL_ERROR_VFS,
+-			     _("The login has failed."));
+-		break;
+-	default:
+-		g_set_error (error,
+-			     AMIDE_GNOME_URL_ERROR,
+-			     AMIDE_GNOME_URL_ERROR_VFS,
+-			     "%s", gnome_vfs_result_to_string (result));
+-	}
+-
+-	return FALSE;
+-#else
+-	char   *argv[] = { NULL, NULL, NULL };
+-
+-	/* TODO : handle translations when we generate them */
+-	argv[0] = (char *)"hh";
+-	argv[1] = url;
+-	g_spawn_async (NULL, argv, NULL, G_SPAWN_SEARCH_PATH,
+-		NULL, NULL, NULL, error);
+-
+-	return TRUE;
+-#endif
+-}
+-
+-static gboolean amide_gnome_help_display_uri_with_env (const char  *help_uri, char **envp, GError     **error) {
+-	GError *real_error;
+-	gboolean retval;
+-
+-	real_error = NULL;
+-	retval = amide_gnome_url_show_with_env (help_uri, envp, &real_error);
+-
+-	if (real_error != NULL) g_propagate_error (error, real_error);
+-
+-	return retval;
+-}
+-
+-
+-
+-static char * locate_help_file (const char *path, const char *doc_name) {
+-	int i, j;
+-	char *exts[] = {  "", ".xml", ".docbook", ".sgml", ".html", NULL };
+-	const char * const * lang_list = g_get_language_names ();
+-
+-	for (j = 0;lang_list[j] != NULL; j++) {
+-		const char *lang = lang_list[j];
+-
+-		/* This has to be a valid language AND a language with
+-		 * no encoding postfix.  The language will come up without
+-		 * encoding next */
+-		if (lang == NULL ||
+-		    strchr (lang, '.') != NULL)
+-			continue;
+-
+-		for (i = 0; exts[i] != NULL; i++) {
+-			char *name;
+-			char *full;
+-
+-			name = g_strconcat (doc_name, exts[i], NULL);
+-			full = g_build_filename (path, lang, name, NULL);
+-			g_free (name);
+-			
+-			if (g_file_test (full, G_FILE_TEST_EXISTS))
+-			  return full;
+-
+-			g_free (full);
+-		}
+-	}
+-
+-	return NULL;
+-}
+-
+-/* returns an array of strings (strings can be potentially null) - array and strings need to be free'd */
+-static gchar ** amide_gnome_program_locate_help_file (const gchar *file_name, gboolean only_if_exists) {
+-
+-  gchar *buf;
+-  gchar ** retvals;
+-  gchar ** dirs;
+-  const gchar * const * global_dirs;
+-  gint i;
+-  gint j;
+-  gint count=0;
+-  gint slots;
+-
+-  g_return_val_if_fail (file_name != NULL, NULL);
+-
+-  global_dirs = g_get_system_data_dirs();
+-  while (global_dirs[count] != NULL) count++; /* count */
+-
+-  /* allocate the array of strings -  extra spot for AMIDE_DATADIR, 
+-     plus an extra spot if on win32,
+-     plus one at end for NULL termination */
+-#if defined (G_PLATFORM_WIN32)
+-  slots = count+3;
+-#else
+-  slots = count+2;
+-#endif
+-
+-  dirs = g_try_new0(gchar *,slots); 
+-  retvals = g_try_new0(gchar *,slots);
+-  g_return_val_if_fail((dirs != NULL) && (retvals != NULL), NULL);
+-
+-  j=0;
+-  /* copy over the directories */
+-  dirs[j] = g_strdup(AMIDE_DATADIR); /* first entry */
+-  j++;
+-
+-  /* FIXME, below function is now deprecated 
+-#if defined (G_PLATFORM_WIN32)
+-  dirs[j] = g_win32_get_package_installation_subdirectory(NULL, NULL,"share");
+-  j++;
+-#endif
+-  */
+-
+-  i=0;
+-  while (global_dirs[i] != NULL) { /* rest of the entries */
+-    dirs[j] = g_strdup(global_dirs[i]);
+-    i++;
+-    j++;
+-  }
+-
+-
+-  /* Potentially add an absolute path */
+-  if (g_path_is_absolute (file_name)) 
+-    if (!only_if_exists || g_file_test (file_name, G_FILE_TEST_EXISTS)) {
+-      retvals[0] = g_strdup(file_name);
+-      return retvals; /* we're already done */
+-    }
+-
+-  /* use the prefix */
+-  if (AMIDE_DATADIR == NULL) {
+-    g_warning (G_STRLOC ": Directory properties not set correctly.  "
+-	       "Cannot locate application specific files.");
+-    return retvals;
+-  }
+-
+-  i=0;
+-  j=0;
+-  while (dirs[i] != NULL) {
+-    buf = g_strdup_printf ("%s%s%s%s%s", dirs[i], G_DIR_SEPARATOR_S, "help", G_DIR_SEPARATOR_S,file_name);
+-    
+-    if (!only_if_exists || g_file_test (buf, G_FILE_TEST_EXISTS)) {
+-      retvals[j] = buf;
+-      j++;
+-    } else
+-      g_free(buf);
+-    i++;
+-  }
+-
+-  i=0;
+-  while (dirs[i] != NULL) {
+-    g_free(dirs[i]);
+-    i++;
+-  }
+-  g_free(dirs);
+-
+-  return retvals;
+-}
+-
+-
+-typedef enum {
+-  AMIDE_GNOME_HELP_ERROR_INTERNAL,
+-  AMIDE_GNOME_HELP_ERROR_NOT_FOUND
+-} AmideGnomeHelpError;
+-
+-#define AMIDE_GNOME_HELP_ERROR (amide_gnome_help_error_quark ())
+-GQuark amide_gnome_help_error_quark (void) {
+-  static GQuark error_quark = 0;
+-  
+-  if (error_quark == 0)
+-    error_quark = g_quark_from_static_string ("amide-gnome-help-error-quark");
+-  
+-  return error_quark;
+-}
+-
+ 
+ gboolean amide_gnome_help_display (const char *file_name, const char *link_id, GError **error) {
+ 
+@@ -342,6 +45,7 @@
+   if (link_id)  {
+     uri = g_strconcat ("yelp help:amide/", link_id, NULL);
+     success = g_spawn_command_line_async (uri, error);
++    g_free (uri);
+   } else {
+     success = g_spawn_command_line_async ("yelp help:amide", error);
+   }
diff --git a/debian/patches/series b/debian/patches/series
index c176e58..ccd8ece 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -8,3 +8,4 @@ ffmpeg-5.patch
 typos.patch
 gsettings.patch
 gtk3+goocanvas.patch
+no-gnome-vfs.patch
diff --git a/debian/rules b/debian/rules
index fc4b597..a8e7736 100755
--- a/debian/rules
+++ b/debian/rules
@@ -17,7 +17,6 @@ override_dh_auto_configure:
 		--mandir=\$${prefix}/share/man \
 		--infodir=\$${prefix}/share/info \
 		--localstatedir=/var/lib/amide \
-                --disable-gnome-vfs \
 		LDFLAGS="-Wl,-z,defs $(LDFLAGS)"
 
 # To create the docs this option would be needed but it causes build problems
-- 
2.43.0

-------------- next part --------------
>From d7bde2f21ec7dc33d8e2fd776d5bd47a6704547c Mon Sep 17 00:00:00 2001
From: Yavor Doganov <yavor at gnu.org>
Date: Thu, 22 Feb 2024 16:37:43 +0200
Subject: [PATCH 4/5] (Build-Depends): Add libopenjp2-7-dev and libvistaio-dev

---
 debian/changelog | 4 +++-
 debian/control   | 2 ++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index 711ea58..de7f96b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,7 +8,9 @@ amide (1.0.6-4) UNRELEASED; urgency=medium
   * debian/rules (override_dh_auto_configure): Remove --disable-gconf and
     --disable-gnome-vfs.
   * debian/control (Build-Depends): Replace libgtk2.0-dev and
-    libgnomecanvas2-dev with libgtk-3-dev and libgoocanvas-2.0-dev.
+    libgnomecanvas2-dev with libgtk-3-dev and libgoocanvas-2.0-dev.  Add
+    libopenjp2-7-dev and libvistaio-dev, thus adding support for JPEG 2000
+    and Vista images.
   * debian/NEWS: New file; inform users that configuration is lost.
 
  -- Yavor Doganov <yavor at gnu.org>  Thu, 22 Feb 2024 09:00:50 +0200
diff --git a/debian/control b/debian/control
index 2c009a5..a7d83ce 100644
--- a/debian/control
+++ b/debian/control
@@ -14,7 +14,9 @@ Build-Depends: libtool,
                libgoocanvas-2.0-dev,
                libgsl-dev,
                libmdc-dev,
+               libopenjp2-7-dev,
                libdcmtk-dev,
+               libvistaio-dev,
                libvolpack1-dev,
                libavcodec-dev,
                libavformat-dev,
-- 
2.43.0

-------------- next part --------------
>From 070c6cdd316cdc7d6dd79dd06c58578e84419bb7 Mon Sep 17 00:00:00 2001
From: Yavor Doganov <yavor at gnu.org>
Date: Thu, 22 Feb 2024 17:53:22 +0200
Subject: [PATCH 5/5] Fix some compiler warnings

---
 debian/changelog                       |   1 +
 debian/patches/compiler-warnings.patch | 198 +++++++++++++++++++++++++
 debian/patches/series                  |   1 +
 3 files changed, 200 insertions(+)
 create mode 100644 debian/patches/compiler-warnings.patch

diff --git a/debian/changelog b/debian/changelog
index de7f96b..e2a1390 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,7 @@ amide (1.0.6-4) UNRELEASED; urgency=medium
   * debian/patches/gtk3+goocanvas.patch: New; port to GTK 3 and GooCanvas
     2.0 (Closes: #967252).
   * debian/patches/no-gnome-vfs.patch: New; remove GnomeVFS support.
+  * debian/patches/compiler-warnings.patch: New; fix some warnings.
   * debian/rules (override_dh_auto_configure): Remove --disable-gconf and
     --disable-gnome-vfs.
   * debian/control (Build-Depends): Replace libgtk2.0-dev and
diff --git a/debian/patches/compiler-warnings.patch b/debian/patches/compiler-warnings.patch
new file mode 100644
index 0000000..cc75aa2
--- /dev/null
+++ b/debian/patches/compiler-warnings.patch
@@ -0,0 +1,198 @@
+Description: Fix some compiler warnings.
+Author: Yavor Doganov <yavor at gnu.org>
+Forwarded: no
+Last-Update: 2022-02-22
+---
+
+--- amide.orig/amide-current/src/amitk_point.c
++++ amide/amide-current/src/amitk_point.c
+@@ -49,7 +49,7 @@
+ }
+ 
+ AmitkPoint * amitk_point_copy(const AmitkPoint * point) {
+-  return (AmitkPoint *)g_memdup(point, sizeof(AmitkPoint));
++  return (AmitkPoint *)g_memdup2(point, sizeof(AmitkPoint));
+ }
+ 
+ void amitk_point_free (AmitkPoint * point) {
+@@ -145,7 +145,7 @@
+ }
+ 
+ AmitkVoxel * amitk_voxel_copy(const AmitkVoxel * voxel) {
+-  return (AmitkVoxel *)g_memdup(voxel, sizeof(AmitkVoxel));
++  return (AmitkVoxel *)g_memdup2(voxel, sizeof(AmitkVoxel));
+ }
+ 
+ void amitk_voxel_free (AmitkVoxel * voxel) {
+@@ -223,7 +223,7 @@
+ }
+ 
+ AmitkPixel * amitk_pixel_copy(const AmitkPixel * pixel) {
+-  return (AmitkPixel *)g_memdup(pixel, sizeof(AmitkPixel));
++  return (AmitkPixel *)g_memdup2(pixel, sizeof(AmitkPixel));
+ }
+ 
+ void amitk_pixel_free (AmitkPixel * pixel) {
+@@ -242,7 +242,7 @@
+ }
+ 
+ AmitkCanvasPoint * amitk_canvas_point_copy(const AmitkCanvasPoint * point) {
+-  return (AmitkCanvasPoint *)g_memdup(point, sizeof(AmitkCanvasPoint));
++  return (AmitkCanvasPoint *)g_memdup2(point, sizeof(AmitkCanvasPoint));
+ }
+ 
+ void amitk_canvas_point_free (AmitkCanvasPoint * point) {
+@@ -265,7 +265,7 @@
+ }
+ 
+ AmitkAxes * amitk_axes_copy(const AmitkAxes * axes) {
+-  return (AmitkAxes *)g_memdup(axes, sizeof(AmitkAxes));
++  return (AmitkAxes *)g_memdup2(axes, sizeof(AmitkAxes));
+ }
+ 
+ void amitk_axes_free (AmitkAxes * axes) {
+@@ -503,7 +503,7 @@
+ }
+ 
+ AmitkCorners * amitk_corners_copy(const AmitkCorners * corners) {
+-  return (AmitkCorners *)g_memdup(corners, sizeof(AmitkCorners));
++  return (AmitkCorners *)g_memdup2(corners, sizeof(AmitkCorners));
+ }
+ 
+ void amitk_corners_free (AmitkCorners * corners) {
+--- amide.orig/amide-current/src/fads.c
++++ amide/amide-current/src/fads.c
+@@ -484,6 +484,7 @@
+   return;
+ }
+ 
++#if AMIDE_DEBUG
+ static gdouble calc_magnitude(AmitkDataSet * ds, gdouble * weight) {
+ 
+   gdouble magnitude;
+@@ -506,6 +507,7 @@
+ 
+   return sqrt(magnitude);
+ }
++#endif
+ 
+ 
+ /* returned array needs to be free'd */
+@@ -909,7 +911,6 @@
+   gdouble alpha, factor;
+   amide_time_t frame_midpoint, frame_duration;
+   gdouble init_value;
+-  gdouble magnitude;
+   AmitkDataSet * new_ds;
+   AmitkVoxel i_voxel;
+   gdouble current_beta=0.0;
+@@ -917,6 +918,7 @@
+   GTimer * timer=NULL;
+   gboolean new_outer;
+ #if AMIDE_DEBUG
++  gdouble magnitude;
+   div_t x;
+ #endif
+ 
+@@ -977,7 +979,9 @@
+     g_warning(_("failed weight malloc"));
+     goto ending;
+   }
++#if AMIDE_DEBUG
+   magnitude = calc_magnitude(p.data_set, p.weight);
++#endif
+ 
+   if (p.sum_factors_equal_one) {
+     p.ec_a = g_try_new(gdouble, p.num_voxels);
+@@ -1942,12 +1946,13 @@
+   amide_time_t time_start;
+   AmitkDataSet * new_ds;
+   AmitkVoxel i_voxel;
+-  gdouble magnitude, k12, k21;
++  gdouble k12, k21;
+   gdouble init_value, alpha;
+   AmitkViewMode i_view_mode;
+   GTimer * timer=NULL;
+   gboolean new_outer;
+ #if AMIDE_DEBUG
++  gdouble magnitude;
+   div_t x;
+ #endif
+ 
+@@ -2100,7 +2105,9 @@
+   /* calculate the weights and magnitude */
+   p.weight = calc_weights(p.data_set);
+   g_return_if_fail(p.weight != NULL); /* make sure we've malloc'd it */
++#if AMIDE_DEBUG
+   magnitude = calc_magnitude(p.data_set, p.weight);
++#endif
+ 
+   
+   /* set up gsl */
+--- amide.orig/amide-current/src/libmdc_interface.c
++++ amide/amide-current/src/libmdc_interface.c
+@@ -933,12 +933,12 @@
+ 
+   /* set what we can */
+   if (AMITK_DATA_SET_SUBJECT_NAME(ds) != NULL) 
+-    strncpy(fi.patient_name,AMITK_DATA_SET_SUBJECT_NAME(ds), MDC_MAXSTR);
++    strncpy(fi.patient_name,AMITK_DATA_SET_SUBJECT_NAME(ds), MDC_MAXSTR - 1);
+   if (AMITK_DATA_SET_SUBJECT_ID(ds) != NULL) 
+-    strncpy(fi.patient_id,AMITK_DATA_SET_SUBJECT_ID(ds), MDC_MAXSTR);
++    strncpy(fi.patient_id,AMITK_DATA_SET_SUBJECT_ID(ds), MDC_MAXSTR - 1);
+   if (AMITK_DATA_SET_SUBJECT_DOB(ds) != NULL) 
+-    strncpy(fi.patient_dob,AMITK_DATA_SET_SUBJECT_DOB(ds), MDC_MAXSTR);
+-  strncpy(fi.patient_sex, amitk_subject_sex_get_name(AMITK_DATA_SET_SUBJECT_SEX(ds)), MDC_MAXSTR);
++    strncpy(fi.patient_dob,AMITK_DATA_SET_SUBJECT_DOB(ds), MDC_MAXSTR - 1);
++  strncpy(fi.patient_sex, amitk_subject_sex_get_name(AMITK_DATA_SET_SUBJECT_SEX(ds)), MDC_MAXSTR - 1);
+ 
+   fi.injected_dose = AMITK_DATA_SET_INJECTED_DOSE(ds);
+   fi.patient_weight= AMITK_DATA_SET_SUBJECT_WEIGHT(ds);
+--- amide.orig/amide-current/src/mpeg_encode.c
++++ amide/amide-current/src/mpeg_encode.c
+@@ -151,7 +151,7 @@
+ 
+ 
+ typedef struct {
+-  AVCodec *codec;
++  const AVCodec *codec;
+   AVCodecContext *context;
+   AVFrame *picture;
+   yuv_t * yuv; 
+--- amide.orig/amide-current/src/vistaio_interface.c
++++ amide/amide-current/src/vistaio_interface.c
+@@ -37,7 +37,7 @@
+ #include <locale.h>
+ 
+ 
+-gboolean vistaio_test_vista(gchar *filename)
++gboolean vistaio_test_vista(const gchar *filename)
+ {
+   return VistaIOIsVistaFile(filename); 
+ }
+--- amide.orig/amide-current/src/vistaio_interface.h
++++ amide/amide-current/src/vistaio_interface.h
+@@ -33,7 +33,7 @@
+ /* includes always needed with this file */
+ #include "amitk_data_set.h"
+ 
+-gboolean vistaio_test_vista(gchar *filename); 
++gboolean vistaio_test_vista(const gchar *filename);
+ 
+ 
+ /* external functions */
+--- amide.orig/amide-current/configure.ac
++++ amide/amide-current/configure.ac
+@@ -366,9 +366,9 @@
+ ##############################
+ 
+ PKG_CHECK_MODULES(AMIDE_GTK,[
+-	glib-2.0	>= 2.44.0
+-	gio-2.0         >= 2.44.0
+-	gobject-2.0	>= 2.44.0
++	glib-2.0	>= 2.68.0
++	gio-2.0         >= 2.68.0
++	gobject-2.0	>= 2.68.0
+ 	gtk+-3.0	>= 3.21.5
+ 	libxml-2.0	>= 2.4.12
+ 	goocanvas-2.0   >= 2.0.2
diff --git a/debian/patches/series b/debian/patches/series
index ccd8ece..6bbd9f6 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -9,3 +9,4 @@ typos.patch
 gsettings.patch
 gtk3+goocanvas.patch
 no-gnome-vfs.patch
+compiler-warnings.patch
-- 
2.43.0



More information about the Debian-med-packaging mailing list