|
6 | 6 | from tkinter import messagebox as mbox
|
7 | 7 | from tkinter.constants import *
|
8 | 8 | from tkinterweb import HtmlFrame, Notebook
|
| 9 | +from tkinterweb.utilities import ScrolledTextBox |
9 | 10 |
|
10 | 11 | from markdown import Markdown
|
11 | 12 | from pygments import lex
|
@@ -141,17 +142,16 @@ def __init__(self, master, **kwargs):
|
141 | 142 |
|
142 | 143 | # Creating the widgets
|
143 | 144 | self.editor_pw = tk.PanedWindow(self.master, orient="horizontal")
|
144 |
| - self.editor_frame = tk.Frame(self.editor_pw) |
145 |
| - self.text_area = tk.Text(self.editor_frame, state="normal", wrap="none", pady=2, padx=3, undo=True, width=100, height=25, yscrollcommand=self.on_mousewheel) |
146 |
| - self.text_area.pack(side="left", fill="both", expand=1) |
147 |
| - self.scrollbar = tk.Scrollbar(self.editor_frame, command=self.on_scrollbar) |
148 |
| - self.scrollbar.pack(side="left", fill="y") |
| 145 | + self.editor_frame = ScrolledTextBox(self.editor_pw) |
| 146 | + self.text_area = self.editor_frame.tbox |
149 | 147 | self.preview_tabs = Notebook(self.editor_pw)
|
150 | 148 | #make the previews
|
151 | 149 | self.preview_area = HtmlFrame(self.preview_tabs)
|
152 |
| - self.preview_html = tk.Text(self.preview_tabs) |
| 150 | + |
| 151 | + self.preview_html_frame = ScrolledTextBox(self.preview_tabs) |
| 152 | + self.preview_html = self.preview_html_frame.tbox |
153 | 153 | self.preview_tabs.add(self.preview_area, text="Preview Format")
|
154 |
| - self.preview_tabs.add(self.preview_html, text="Preview HTML code") |
| 154 | + self.preview_tabs.add(self.preview_html_frame, text="Preview HTML code") |
155 | 155 | #add the areas to the paned window
|
156 | 156 | self.editor_pw.add(self.editor_frame)
|
157 | 157 | self.editor_pw.add(self.preview_tabs)
|
|
0 commit comments