aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2019-07-16 11:42:51 +0200
committerThomas White <taw@physics.org>2019-07-16 11:42:51 +0200
commit1fb9ee9b38a970982ae9bed949dff155f6bbbbee (patch)
treea4b946698fe60f93625525a0aae442108314352a /src
parente0d4ae86adcc09b5058966b5d6051c65019d95fe (diff)
hdfsee: Show HDF5 menu tree event for multi-event files
Diffstat (limited to 'src')
-rw-r--r--src/dw-hdfsee.c29
1 files changed, 10 insertions, 19 deletions
diff --git a/src/dw-hdfsee.c b/src/dw-hdfsee.c
index a4ba6e8a..0ff40918 100644
--- a/src/dw-hdfsee.c
+++ b/src/dw-hdfsee.c
@@ -53,6 +53,7 @@
#include "filters.h"
#include "events.h"
+static int displaywindow_update_menus(DisplayWindow *dw, const char *selectme);
static void displaywindow_error(DisplayWindow *dw, const char *message)
{
@@ -317,6 +318,7 @@ static void show_simple_ring(cairo_t *cr, DisplayWindow *dw,
cairo_stroke(cr);
}
+
static struct rigid_group *find_corresponding_rigid_group(DisplayWindow *dw,
struct panel *p) {
@@ -951,6 +953,7 @@ static gint displaywindow_newevent(DisplayWindow *dw, int new_event)
dw->curr_event = new_event;
do_filters(dw);
+ displaywindow_update_menus(dw, NULL);
displaywindow_update(dw);
bn = safe_basename(dw->image->filename);
@@ -2535,15 +2538,13 @@ static GtkWidget *displaywindow_addhdfgroup(struct hdfile *hdfile,
} else {
char *tmp;
+ struct event *ev = NULL;
- item = gtk_menu_item_new_with_label(names[i]);
-
- if ( hdfile_is_scalar(hdfile, names[i], 0) ) {
- tmp = hdfile_get_string_value(hdfile, names[i],
- NULL);
- } else {
- tmp = NULL;
+ if ( dw->multi_event ) {
+ ev = dw->ev_list->events[dw->curr_event];
}
+ item = gtk_menu_item_new_with_label(names[i]);
+ tmp = hdfile_get_string_value(hdfile, names[i], ev);
if ( tmp != NULL ) {
GtkWidget *ss;
@@ -2945,7 +2946,6 @@ DisplayWindow *displaywindow_open(char *filename, char *geom_filename,
DisplayWindow *dw;
GtkWidget *vbox;
int check;
- GtkWidget *w;
char title[1024];
dw = calloc(1, sizeof(DisplayWindow));
@@ -3143,14 +3143,7 @@ DisplayWindow *displaywindow_open(char *filename, char *geom_filename,
gtk_window_set_resizable(GTK_WINDOW(dw->window), TRUE);
gtk_widget_show_all(dw->window);
- w = gtk_ui_manager_get_widget(dw->ui,
- "/ui/displaywindow/view/images");
-
- if ( !dw->simple ) {
- gtk_widget_set_sensitive(GTK_WIDGET(w), FALSE);
- }
-
- if ( dw->simple || dw->multi_event == 0) {
+ if ( !dw->multi_event ) {
set_events_menu_sensitivity(dw, FALSE);
}
@@ -3174,9 +3167,7 @@ DisplayWindow *displaywindow_open(char *filename, char *geom_filename,
g_signal_connect(G_OBJECT(dw->drawingarea), "key-press-event",
G_CALLBACK(displaywindow_keypress), dw);
- if ( dw->simple ) {
- displaywindow_update_menus(dw, element);
- }
+ displaywindow_update_menus(dw, element);
dw->not_ready_yet = 0;