Skip to content
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

How to scroll two sheets at the same time #191

Closed
HenriqueEira opened this issue Jul 3, 2023 · 2 comments
Closed

How to scroll two sheets at the same time #191

HenriqueEira opened this issue Jul 3, 2023 · 2 comments

Comments

@HenriqueEira
Copy link

How to make both sheets scrooll at the same time when the mouse is over one of the sheets?

`tableFrame = customtkinter.CTkFrame(root, width=0.99root.winfo_width(), height=0.85root.winfo_height())
tableFrame.place(anchor="nw", relx=0.01, rely=0.01)
tableFrame.update()

sheet_r = Sheet(tableFrame,
show_top_left = False,
set_all_heights_and_widths = False,show_row_index= False,
#max_rh=1,
width=int(tableFrame.winfo_width()/1.4),
height=int(tableFrame.winfo_height()),
theme=helper.APPEARANCE_SHEET)

sheet_r.enable_bindings()
sheet_r.disable_bindings("delete", "edit_cell", "cut", "paste", "rc_insert_row", "rc_delete_row",
"rc_delete_column","edit_header", "rc_insert_column")
sheet_r.bind("", doubleClick, add = None)

sheet_l = Sheet(tableFrame,show_x_scrollbar=False,
show_y_scrollbar=False,
show_top_left = False,
set_all_heights_and_widths = False,
#max_rh=1,
width=int(tableFrame.winfo_width()/3.63),
height=int(tableFrame.winfo_height()),
theme=helper.APPEARANCE_SHEET)

sheet_l.enable_bindings()`

@ragardner
Copy link
Owner

Hello,

There's no immediately easy way to do this at the moment but I will try to add this functionality and release a new version with it in the coming days

@ragardner
Copy link
Owner

@HenriqueEira I have now added the scroll syncing functionality in version 6.2.2. Documentation here:

https://github.com/ragardner/tksheet/wiki/Version-6#sync-scroll-positions-between-widgets

Please note however that it is not perfect when there are large differences between sheet sizes, it may be possible to improve this or perhaps it is fine the way it is

Let me know how what you think

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants