diff --git a/plugins/debug.c b/plugins/debug.c index 3f45eb01..78ca6040 100644 --- a/plugins/debug.c +++ b/plugins/debug.c @@ -1000,11 +1000,17 @@ static void draw_reg_map(int valid_register) const gchar *label_str; char buf[12]; GtkRequisition r; + GtkWidget *parent; block_bit_option_signals(); /* Reset all bits to the "reseverd" status and clear all options */ for (i = (reg_bit_width - 1); i >= 0; i--){ - gtk_container_add(GTK_CONTAINER(hboxes[i]),lbl_bits[i]); + parent = gtk_widget_get_parent(GTK_WIDGET(lbl_bits[i])); + gtk_widget_hide(GTK_WIDGET(lbl_bits[i])); + g_object_ref(GTK_WIDGET(lbl_bits[i])); + gtk_container_remove(GTK_CONTAINER(parent), GTK_WIDGET(lbl_bits[i])); + gtk_container_add(GTK_CONTAINER(hboxes[i]), GTK_WIDGET(lbl_bits[i])); + gtk_widget_show(GTK_WIDGET(lbl_bits[i])); gtk_label_set_text((GtkLabel *)bit_descrip_list[i], "Reserved"); gtk_label_set_width_chars((GtkLabel *)bit_descrip_list[i], 13); gtk_combo_box_text_remove_all(GTK_COMBO_BOX_TEXT(bit_comboboxes[i])); @@ -1046,8 +1052,13 @@ static void draw_reg_map(int valid_register) for (i = 0; i < p_reg->bgroup_cnt; i++){ p_bit = &p_reg->bgroup_list[i]; for (j = (p_bit->width - 1); j >= 0 ; j--){ - gtk_container_add(GTK_CONTAINER(hboxes[p_bit->offset]), lbl_bits[p_bit->offset + j]); - gtk_box_reorder_child((GtkBox *)hboxes[p_bit->offset], lbl_bits[p_bit->offset + j], -1); + parent = gtk_widget_get_parent(GTK_WIDGET(lbl_bits[p_bit->offset + j])); + gtk_widget_hide(GTK_WIDGET(lbl_bits[p_bit->offset + j])); + g_object_ref(GTK_WIDGET(lbl_bits[p_bit->offset + j])); + gtk_container_remove(GTK_CONTAINER(parent), GTK_WIDGET(lbl_bits[p_bit->offset + j])); + gtk_container_add(GTK_CONTAINER(hboxes[p_bit->offset]), GTK_WIDGET(lbl_bits[p_bit->offset + j])); + gtk_box_reorder_child(GTK_BOX(hboxes[p_bit->offset]), GTK_WIDGET(lbl_bits[p_bit->offset + j]), -1); + gtk_widget_show(GTK_WIDGET(lbl_bits[p_bit->offset + j])); if (j > 0) gtk_widget_hide(elem_frames[p_bit->offset + j]); }