def copy(self): word = self.cast.pages.get_first_word() try: from mytools_Mri.ui import transferable transferable.set_text_to_clipboard(self.cast.ctx, word) except: pass
def do_command(self, n): if n == 0x2 or n == 0x8: # get value and call method self.cast.info_action() elif n == 0x4: mode = self.cast.property_mode self.cast.property_mode = False # to set the value try: self.cast.info_action() except: pass self.cast.property_mode = mode elif n == 32: # idl self.cast.open_idl_reference() elif n == 256 or 513 <= n <= 517 or n == 520: # copy if n == 256: word = self.cast.pages.get_first_word() elif 513 <= n <= 517: word = self.cast.pages.get_cell(column_index=(n - 513)) elif n == 520: word = ' '.join(self.cast.pages.get_row()) else: return try: transferable.set_text_to_clipboard(self.cast.ctx, word) except Exception as e: print(e)