def unmap(widget):
    """Unmap a mapped WIDGET."""
    result = False
    if widget and widget.winfo_exists() and widget.winfo_ismapped():
        result = True
        geom_mgr = widget.winfo_manager()
        if geom_mgr == "grid":
            widget.grid_forget()
        elif geom_mgr == "pack":
            widget.pack_forget()
        elif geom_mgr == "place":
            widget.place_forget()
        else:
            result = False
    return result