<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def callback(self, cats):
 """When a catalog is selected, enable widgets that depend on that condition and do done_callback"""

        enable = bool(cats)
        if not enable:
            # close search if it is visible
            self.search.visible = False
        enable_widget(self.search_widget, enable)
        enable_widget(self.remove_widget, enable)

        if self.done_callback:
            self.done_callback(cats)