Skip to content

Commit cce5db7

Browse files
committed
This branch of research is in response the issue regarding scrollbars:
This seems to be one way to go to get the scroll bars all looking and acting the same way. If you want to bring even more things into the same style, Have you considered using tk.ttk.Button() instead of tk.Button() for the toolbar?
2 parents 1b00586 + c3bbee7 commit cce5db7

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tkintermd/frame.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from tkinter import messagebox as mbox
77
from tkinter.constants import *
88
from tkinterweb import HtmlFrame, Notebook
9+
from tkinterweb.utilities import ScrolledTextBox
910

1011
from markdown import Markdown
1112
from pygments import lex
@@ -141,17 +142,16 @@ def __init__(self, master, **kwargs):
141142

142143
# Creating the widgets
143144
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
149147
self.preview_tabs = Notebook(self.editor_pw)
150148
#make the previews
151149
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
153153
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")
155155
#add the areas to the paned window
156156
self.editor_pw.add(self.editor_frame)
157157
self.editor_pw.add(self.preview_tabs)

0 commit comments

Comments
 (0)