-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Looking to customize scrollbar and scrollbar frame bg #213
Comments
Thanks for your question and sorry for the late reply, I think I have found a way to do this, the test code I have been using sits inside style = ttk.Style()
for orientation in ("Vertical", "Horizontal"):
style.element_create(f"Tksheet.{orientation}.TScrollbar.trough", "from", "default")
style.element_create(f"Tksheet.{orientation}.TScrollbar.thumb", "from", "default")
style.element_create(f"Tksheet.{orientation}.TScrollbar.grip", "from", "default")
# in case you want to remove the arrow buttons uncomment below:
# style.layout(
# f"Tksheet.{orientation}.TScrollbar",
# [
# (
# f"Tksheet.{orientation}.TScrollbar.trough",
# {
# "children": [
# (
# f"Tksheet.{orientation}.TScrollbar.thumb",
# {
# "unit": "1",
# "children": [(f"Tksheet.{orientation}.TScrollbar.grip", {"sticky": ""})],
# "sticky": "nswe",
# },
# )
# ],
# "sticky": "ns" if orientation == "Vertical" else "ew",
# },
# )
# ],
# )
style.configure(
f"Tksheet.{orientation}.TScrollbar",
gripcount=0,
borderwidth=2,
background="#b0b0b0",
troughcolor="red",
bordercolor="#252526",
lightcolor="#252526",
darkcolor="#252526",
) Those colours are just to test it out I will hopefully be adding the Sheet initialization and Edit: I forgot to mention you also have to set the style parameter for the scrollbars if using the above code self.yscroll = ttk.Scrollbar(
self,
command=self.MT.set_yviews,
orient="vertical",
style="Tksheet.Vertical.TScrollbar",
)
self.xscroll = ttk.Scrollbar(
self,
command=self.MT.set_xviews,
orient="horizontal",
style="Tksheet.Horizontal.TScrollbar",
) Edit 2: You also have to use the Edit 3: This seems to clash with the dropdown boxes scrollbars and cause an error |
@infiniteTesch I have now added the ability to change scroll bar appearance in version documentation here: Thanks again for your suggestion! |
As the topic suggest im looking for a way to accomplish this. Can't seem to find customizable variables inside the tksheet class.
Anyone knows?
Best regards
InfiniteTesch
The text was updated successfully, but these errors were encountered: