def show_command_bar(textview, sender, args): """Show the command bar""" from editxt import app editor = app.find_editor_with_document_view(textview.doc_view) if editor is None: ak.NSBeep() else: editor.command.activate()
def readSelectionFromPasteboard_type_(self, pasteboard, type_): editor = app.find_editor_with_document_view(self.doc_view) if editor is not None: items = editor.iter_dropped_paths(pasteboard) parent = editor.find_project_with_document_view(self.doc_view) index = len(editor.projects) if parent is None else -1 result = editor.accept_dropped_items(items, parent, index, None) if result: return True return super(TextView, self).readSelectionFromPasteboard_type_(pasteboard, type_)
def readSelectionFromPasteboard_type_(self, pasteboard, type_): editor = app.find_editor_with_document_view(self.doc_view) if editor is not None: items = editor.iter_dropped_paths(pasteboard) parent = editor.find_project_with_document_view(self.doc_view) index = len(editor.projects) if parent is None else -1 result = editor.accept_dropped_items(items, parent, index, None) if result: return True return super(TextView, self).readSelectionFromPasteboard_type_( pasteboard, type_)