diff --git a/src/gtk_ui.c b/src/gtk_ui.c index 07f58b1..4bbe0be 100644 --- a/src/gtk_ui.c +++ b/src/gtk_ui.c @@ -465,10 +465,12 @@ void ui_window_new(struct view_s* v, int N, const long dims[N], const struct vie char pname[10]; snprintf(pname, 10, "pos%02d", j); + v->ui->gtk_posall[j] = GTK_ADJUSTMENT(gtk_builder_get_object(builder, pname)); gtk_adjustment_set_upper(v->ui->gtk_posall[j], dims[j] - 1); snprintf(pname, 10, "check%02d", j); + v->ui->gtk_checkall[j] = GTK_CHECK_BUTTON(gtk_builder_get_object(builder, pname)); } @@ -533,6 +535,7 @@ void ui_set_params(struct view_s* v, struct view_ui_params_s params, struct view gtk_adjustment_get_page_increment(v->ui->gtk_winhigh), gtk_adjustment_get_page_size(v->ui->gtk_winhigh)); gtk_adjustment_configure(v->ui->gtk_winlow, img_params.winlow, 0, params.windowing_max, params.windowing_inc, gtk_adjustment_get_page_increment(v->ui->gtk_winlow), gtk_adjustment_get_page_size(v->ui->gtk_winlow)); + gtk_spin_button_set_digits(v->ui->gtk_button_winhigh, params.windowing_digits); gtk_spin_button_set_digits(v->ui->gtk_button_winlow, params.windowing_digits); diff --git a/src/main.c b/src/main.c index af111b2..feafa3c 100644 --- a/src/main.c +++ b/src/main.c @@ -4,20 +4,21 @@ * a BSD-style license which can be found in the LICENSE file. */ -#include "num/multind.h" #include #include +#include "num/multind.h" + +#include "misc/misc.h" +#include "misc/mmio.h" +#include "misc/opts.h" + #if defined __has_include #if __has_include ("misc/stream.h") #define HAS_BART_STREAM #endif #endif -#include "misc/misc.h" -#include "misc/mmio.h" -#include "misc/opts.h" - #if 0 #include "misc/io.h" #else @@ -35,6 +36,7 @@ static const char help_str[] = "View images."; int main(int argc, char* argv[argc]) { +// unused was remove in newer versionf of bart, use it detect new version #ifdef UNUSED long count; #else diff --git a/src/view.c b/src/view.c index 0f0b512..c91afa0 100644 --- a/src/view.c +++ b/src/view.c @@ -68,7 +68,7 @@ struct view_control_s { int lastx; int lasty; - //misc + // misc bool status_bar; double max; @@ -646,7 +646,7 @@ static void view_set_windowing(struct view_s* v) v->ui_params.windowing_max = max; v->ui_params.windowing_inc = exp(log(10) * round(log(max) / log(10.))) * 0.001; - v->ui_params.windowing_digits = MAX(3, 3 - (int)round(log(max) / log(10.))); + v->ui_params.windowing_digits = MAX(3, 3 - (int)round(log(max) / log(10.))); } void view_toggle_absolute_windowing(struct view_s* v, bool state)