def set_note_data(self, note, reset_undo=True, content_unchanged=False):

        if not content_unchanged:
            self.text_note.delete(1.0, tk.END)  # clear all

        if note is not None:
            if not content_unchanged:
                self.text_note.insert(tk.END, note['content'])

            # default to an empty array for tags
            tags = note.get('tags', [])

        else:
            # note is None - for tags machinery further down, we have empty list
            tags = []

        for tag_button in self.note_existing_tags_frame.children.values():
            tag_button.destroy()

        for tag in tags:
            tag_button = tk.Button(
                    self.note_existing_tags_frame, width=0, text=tag + " x",
                    command=lambda tag=tag:
                    self.handler_delete_tag_from_selected_note(tag))
            tag_button.pack(side=tk.LEFT)
        
            #self.tags_entry_var.set(','.join(tags))
            self.pinned_checkbutton_var.set(utils.note_pinned(note))

        if reset_undo:
            # usually when a new note is selected, we want to reset the
            # undo buffer, so that a user can't undo right into the previously
            # selected note.
            self.text_note.edit_reset()
Replace text in editor with content.
dataset/ETHPy150Open cpbotha/nvpy/nvpy/view.py/View.set_note_data