def close_dock_control ( dock_control ):
    # Retrieve the traits UI object set when we created the DockControl:
    ui = dock_control.data

    # Ask the traits UI handler if it is OK to close the window:
    if not ui.handler.close( ui.info, True ):
        # If not, tell the DockWindow not to close it:
        return False

    # Otherwise, clean up and close the traits UI:
    ui.dispose()

    # And tell the DockWindow to remove the DockControl:
    return True

#-------------------------------------------------------------------------------
#  'Handler' class:
#-------------------------------------------------------------------------------
Closes a DockControl (if allowed by the associated Traits UI Handler).
dataset/ETHPy150Open enthought/traitsui/traitsui/handler.py/close_dock_control