Real Time Clock (RTC)

Thanks Riva, I see this makes sense. I have put the code in and have the clock displayed over the menu still. From your snippet I read it as.

"If your at the top of the menu (the menuroot = true) display the clock."

else the menuroot = false, so hide the clock.

I have the menu running in my loop so I think what happens is the clock is displaying as it should but also the menu is displaying under the clock because it is in the loop
and the menuroot prints "main menu". seems I need to be a level above this?

If I move through the menu the clock is still displayed. I have a feel for what is happening but think I have not implimented your code correctly. Here is an cutdown of what I have.

I will play around with the code to see what I can get. Here's a cutdown of what I have at the moment.

#include <MenuBackend.h> //MenuBackend library - copyright by Alexander Brevig
// A global flag. true = root (top) menu and display clock. false = don't display clock
int menuRoot = true;

void setup()
{
  menu.getRoot().addRight(menuSetClock).addRight(menuSetDate).addRight(menuCommunications).addRight(menuExit); //set main menu items
  menuSetClock.add(menuItemHr).addRight(menuItemMin); // add first sub menu then addright additional sub menues for that menu
  menuExit.add(menuExit);
  menu.toRoot();
}
void loop()
{ 
  if (menuRoot == true){
    lcd.setCursor(0, 0);
    lcd.print(rtc.formatTime());
    lcd.setCursor(0, 1);
    lcd.print(rtc.formatDate());
  }
  readButtons(); //I splitted button reading and navigation in two procedures because 
  readEncoder();
  navigateMenus(); //in some situations I want to use the button for other purpose (eg. to change some settings)
     
}
void menuChanged(MenuChangeEvent changed){

  MenuItem newMenuItem=changed.to; //get the destination menu

  lcd.setCursor(0,0); //set the start position for lcd printing to the second row

  if(newMenuItem.getName()==menu.getRoot()) && menuRoot = true;
  { //this code will change to have time and date displayed  
    lcd.print("Main Menu       ");
    }
  //MENU SET CLOCK
  else if(newMenuItem.getName()=="menuSetClock"){
    lcd.clear();
    lcd.print("Set Clock");
  }
  else if(newMenuItem.getName()=="menuItemHr"){
    lcd.clear();
    lcd.setCursor(0,1);
    lcd.print("Hr");
  }
  else if(newMenuItem.getName()=="menuItemMin"){
    lcd.clear();
    lcd.setCursor(0,1);
    lcd.print("Min");
  }
}