log_debug("UpdateDisplay()");
regwin_refresh();
pgmwin_refresh();
- memwin_refresh(INT_MEM_ID);
- memwin_refresh(EXT_MEM_ID);
+
+ if (cfg->view_int_memory)
+ memwin_refresh(INT_MEM_ID);
+
+ if (cfg->view_ext_memory)
+ memwin_refresh(EXT_MEM_ID);
}
/* Step out of running state */
scrollwin = pgmwin_init();
gtk_paned_pack2(GTK_PANED(hpaned), scrollwin, TRUE, FALSE);
- vpaned = gtk_vpaned_new();
- gtk_paned_set_position(GTK_PANED(vpaned), cfg->vpane_pos);
- g_signal_connect(G_OBJECT(vpaned), "notify::position",
- G_CALLBACK(vpaned_notify_event), vpaned);
-
- /* Internal memory dump frame. */
- scrollwin = memwin_init("Internal memory (IRAM)", INT_MEM_ID);
- gtk_paned_pack1(GTK_PANED(vpaned), scrollwin, FALSE, FALSE);
-
- /* External memory dump frame. */
- scrollwin = memwin_init("External memory (XRAM)", EXT_MEM_ID);
- gtk_paned_pack2(GTK_PANED(vpaned), scrollwin, TRUE, FALSE);
-
/*
* main_paned will contain two groups:
* group1: registers and disassembly windows.
g_signal_connect(G_OBJECT(main_paned), "notify::position",
G_CALLBACK(main_paned_notify_event), main_paned);
gtk_paned_pack1(GTK_PANED(main_paned), hpaned, FALSE, FALSE);
- gtk_paned_pack2(GTK_PANED(main_paned), vpaned, TRUE, FALSE);
+
+ /* Create vpaned (memory windows) only if necessary. */
+ if (cfg->view_int_memory || cfg->view_ext_memory) {
+ vpaned = gtk_vpaned_new();
+ gtk_paned_set_position(GTK_PANED(vpaned), cfg->vpane_pos);
+ g_signal_connect(G_OBJECT(vpaned), "notify::position",
+ G_CALLBACK(vpaned_notify_event), vpaned);
+
+ /* Internal memory dump frame. */
+ if (cfg->view_int_memory) {
+ scrollwin = memwin_init("Internal memory (IRAM)",
+ INT_MEM_ID);
+ gtk_paned_pack1(GTK_PANED(vpaned), scrollwin,
+ FALSE, FALSE);
+ }
+
+ /* External memory dump frame. */
+ if (cfg->view_ext_memory) {
+ scrollwin = memwin_init("External memory (XRAM)",
+ EXT_MEM_ID);
+ gtk_paned_pack2(GTK_PANED(vpaned), scrollwin,
+ TRUE, FALSE);
+ }
+
+ gtk_paned_pack2(GTK_PANED(main_paned), vpaned, TRUE, FALSE);
+ }
/*
* vbox contains the menu bar and body_vbox (for all remaining
void toggle_int_memory(GtkWidget *widget, gpointer data)
{
if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget))) {
- log_info(" View internal memory (TODO)");
+ log_info(" View internal memory");
cfg->view_int_memory = 1;
} else {
cfg->view_int_memory = 0;
void toggle_ext_memory(GtkWidget *widget, gpointer data)
{
if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget))) {
- log_info(" View external memory (TODO)");
+ log_info(" View external memory");
cfg->view_ext_memory = 1;
} else {
cfg->view_ext_memory = 0;
item = gtk_check_menu_item_new_with_label("Internal Memory");
gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
- gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item), TRUE);
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item),
+ cfg->view_int_memory);
g_signal_connect(G_OBJECT(item), "activate",
G_CALLBACK(toggle_int_memory), NULL);
item = gtk_check_menu_item_new_with_label("External Memory");
gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
- gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item), TRUE);
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item),
+ cfg->view_ext_memory);
g_signal_connect(G_OBJECT(item), "activate",
G_CALLBACK(toggle_ext_memory), NULL);