diff options
-rw-r--r-- | src/imagedisplay.c | 1 | ||||
-rw-r--r-- | src/imagedisplay.h | 1 | ||||
-rw-r--r-- | src/reproject.c | 12 |
3 files changed, 12 insertions, 2 deletions
diff --git a/src/imagedisplay.c b/src/imagedisplay.c index 1b55c96..2698ac1 100644 --- a/src/imagedisplay.c +++ b/src/imagedisplay.c @@ -23,7 +23,6 @@ #include "imagedisplay.h" #include "utils.h" -#include "control.h" /* Free pixbuf data when reference count drops to zero */ static void imagedisplay_free_data(guchar *image_eightbit, ImageDisplay *imagedisplay) { diff --git a/src/imagedisplay.h b/src/imagedisplay.h index 981cf06..f50d0c0 100644 --- a/src/imagedisplay.h +++ b/src/imagedisplay.h @@ -19,7 +19,6 @@ #include <stdint.h> #include <gtk/gtk.h> -#include "control.h" #include "image.h" typedef enum { diff --git a/src/reproject.c b/src/reproject.c index 79657a1..2c84326 100644 --- a/src/reproject.c +++ b/src/reproject.c @@ -201,11 +201,21 @@ static gint reproject_clicked(GtkWidget *widget, GdkEventButton *event, ControlC } +static gint reproject_closed(GtkWidget *widget, ControlContext *ctx) { + ctx->reproject_id = NULL; + return 0; +} + void reproject_open(ControlContext *ctx) { size_t j; ImageFeatureList *flist; + if ( ctx->reproject_id ) { + displaywindow_error("Reprojection window is already open.", ctx->dw); + return; + } + if ( !ctx->cell ) { printf("RP: No current cell\n"); displaywindow_error("No reciprocal unit cell has been specified.", ctx->dw); @@ -224,6 +234,8 @@ void reproject_open(ControlContext *ctx) { ctx->reproject_id = imagedisplay_open_with_message(ctx->images->images[ctx->reproject_cur_image], "Current Image", "Click to change image", IMAGEDISPLAY_SHOW_CENTRE | IMAGEDISPLAY_SHOW_TILT_AXIS, G_CALLBACK(reproject_clicked), ctx); + g_signal_connect(GTK_OBJECT(ctx->reproject_id->drawingarea), "destroy", G_CALLBACK(reproject_closed), ctx); + flist = reproject_get_reflections(&ctx->images->images[ctx->reproject_cur_image], ctx->cell_lattice, ctx); for ( j=0; j<flist->n_features; j++ ) { imagedisplay_mark_circle(ctx->reproject_id, flist->features[j].x, flist->features[j].y); |