From 13494b9d539e0c2837c8ef069fb930d79ba18665 Mon Sep 17 00:00:00 2001
From: c vw <dl1ycf@darc.de>
Date: Thu, 25 Nov 2021 09:26:58 +0100
Subject: [PATCH] BSTK menu: button labels change if bandstack changes.

---
 bandstack_menu.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/bandstack_menu.c b/bandstack_menu.c
index 19152df..262eb78 100644
--- a/bandstack_menu.c
+++ b/bandstack_menu.c
@@ -60,6 +60,17 @@ static gboolean delete_event(GtkWidget *widget, GdkEvent *event, gpointer user_d
 
 static gboolean bandstack_select_cb (GtkWidget *widget, gpointer        data) {
   int b=GPOINTER_TO_UINT(data);
+
+  if (active_receiver->id == 0) {
+    //
+    // vfo_bandstack_changed() calls vfo_save_bandstack(), so the frequency/mode
+    // of the previous "current" bandstack will be overwritten with the
+    // current frequency/mode, which should be reflected by the button text.
+    //
+    char label[32];
+    snprintf(label,32,"%lld %s",vfo[0].frequency,mode_string[vfo[0].mode]);
+    gtk_button_set_label(GTK_BUTTON(last_bandstack), label);
+  }
   set_button_text_color(last_bandstack,"black");
   last_bandstack=widget;
   set_button_text_color(last_bandstack,"orange");
-- 
2.45.2