aboutsummaryrefslogtreecommitdiff
path: root/src/crystfel_gui.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2020-03-04 13:30:02 +0100
committerThomas White <taw@physics.org>2020-07-29 18:42:24 +0200
commit527bb5461741ab717af8788677a00e4f8cc863bd (patch)
treef351ce31ede282d1bd2993ddb598436bd7e78f2e /src/crystfel_gui.c
parent3dac1d777fb65f1c07ba6cfa78f4b13437cc50e4 (diff)
Show frame info at top of image view
Diffstat (limited to 'src/crystfel_gui.c')
-rw-r--r--src/crystfel_gui.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/crystfel_gui.c b/src/crystfel_gui.c
index 5d3e828a..92d2ad0f 100644
--- a/src/crystfel_gui.c
+++ b/src/crystfel_gui.c
@@ -66,6 +66,7 @@ struct crystfelproject {
GtkWidget *imageview;
GtkWidget *icons; /* Drawing area for task icons */
GtkWidget *report; /* Text view at the bottom for messages */
+ GtkWidget *image_info;
int cur_frame;
@@ -101,8 +102,13 @@ static void add_ui_sig(GtkUIManager *ui, GtkWidget *widget,
static void update_imageview(struct crystfelproject *proj)
{
+ char tmp[1024];
if ( proj->n_frames == 0 ) return;
- STATUS("Have %i frames\n", proj->n_frames);
+
+ snprintf(tmp, 1023, "%s (frame %i of %i)",
+ proj->filenames[proj->cur_frame],
+ proj->cur_frame, proj->n_frames);
+ gtk_label_set_text(GTK_LABEL(proj->image_info), tmp);
crystfel_image_view_set_image(CRYSTFEL_IMAGE_VIEW(proj->imageview),
proj->filenames[proj->cur_frame],
proj->events[proj->cur_frame]);
@@ -618,6 +624,12 @@ int main(int argc, char *argv[])
gtk_box_pack_start(GTK_BOX(toolbar), button, FALSE, FALSE, 0.0);
g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(last_frame_sig), &proj);
+ proj.image_info = gtk_label_new("Ready to load images");
+ gtk_label_set_selectable(GTK_LABEL(proj.image_info), TRUE);
+ gtk_label_set_ellipsize(GTK_LABEL(proj.image_info),
+ PANGO_ELLIPSIZE_START);
+ gtk_box_pack_end(GTK_BOX(toolbar), proj.image_info, TRUE, TRUE, 0.0);
+
main_vbox = gtk_vbox_new(FALSE, 0.0);
gtk_box_pack_start(GTK_BOX(main_vbox), toolbar, FALSE, FALSE, 0.0);