'This is used for Menu Item replacement
Every option added to the tree register its name in a dict
If the name was already registered before it can be replaced or not
Returns::
bool: Item has been added to the tree or not'

def register_option(self, opt, parent, replace=False, evaluate=True):

    exists = False
    for i in parent:
        if (i.gname == opt.gname):
            exists = i
    if ((exists is not False) and (replace is True)):
        parent.remove_child(exists)
        opt.attrFrom(exists)
        parent.append_child(opt)
        return True
    elif (exists is False):
        parent.append_child(opt)
        return True
    return False
