MCPcopy Create free account
hub / github.com/Da1sypetals/SnapViewer / _replace_scrollbar

Function _replace_scrollbar

gui.py:153–165  ·  view source on GitHub ↗

Replace the tk.Scrollbar inside a ScrolledText with a ttk.Scrollbar. macOS native rendering ignores color options on tk.Scrollbar, so we swap it out for a ttk.Scrollbar which respects the clam theme styles.

(st: scrolledtext.ScrolledText, style: str)

Source from the content-addressed store, hash-verified

151
152
153def _replace_scrollbar(st: scrolledtext.ScrolledText, style: str) -> None:
154 """Replace the tk.Scrollbar inside a ScrolledText with a ttk.Scrollbar.
155
156 macOS native rendering ignores color options on tk.Scrollbar, so we
157 swap it out for a ttk.Scrollbar which respects the clam theme styles.
158 """
159 old = st.vbar
160 new = ttk.Scrollbar(st.frame, orient=tk.VERTICAL, style=style, command=st.yview)
161 new.pack(side=tk.RIGHT, fill=tk.Y)
162 old.pack_forget()
163 old.destroy()
164 st.vbar = new
165 st.configure(yscrollcommand=new.set)
166
167
168class MessagePanel(ttk.Frame):

Callers 2

setup_uiMethod · 0.85
setup_uiMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected