Skip to content

Commit

Permalink
This branch of research is in response the issue regarding scrollbars:
Browse files Browse the repository at this point in the history
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?
  • Loading branch information
hbregalad committed Apr 9, 2022
2 parents 1b00586 + c3bbee7 commit cce5db7
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tkintermd/frame.py
Expand Up @@ -6,6 +6,7 @@
from tkinter import messagebox as mbox
from tkinter.constants import *
from tkinterweb import HtmlFrame, Notebook
from tkinterweb.utilities import ScrolledTextBox

from markdown import Markdown
from pygments import lex
Expand Down Expand Up @@ -141,17 +142,16 @@ def __init__(self, master, **kwargs):

# Creating the widgets
self.editor_pw = tk.PanedWindow(self.master, orient="horizontal")
self.editor_frame = tk.Frame(self.editor_pw)
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)
self.text_area.pack(side="left", fill="both", expand=1)
self.scrollbar = tk.Scrollbar(self.editor_frame, command=self.on_scrollbar)
self.scrollbar.pack(side="left", fill="y")
self.editor_frame = ScrolledTextBox(self.editor_pw)
self.text_area = self.editor_frame.tbox
self.preview_tabs = Notebook(self.editor_pw)
#make the previews
self.preview_area = HtmlFrame(self.preview_tabs)
self.preview_html = tk.Text(self.preview_tabs)

self.preview_html_frame = ScrolledTextBox(self.preview_tabs)
self.preview_html = self.preview_html_frame.tbox
self.preview_tabs.add(self.preview_area, text="Preview Format")
self.preview_tabs.add(self.preview_html, text="Preview HTML code")
self.preview_tabs.add(self.preview_html_frame, text="Preview HTML code")
#add the areas to the paned window
self.editor_pw.add(self.editor_frame)
self.editor_pw.add(self.preview_tabs)
Expand Down

0 comments on commit cce5db7

Please sign in to comment.