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

Document the proper use of click handlers. #1

Open
Poikilos opened this issue Dec 13, 2024 · 0 comments
Open

Document the proper use of click handlers. #1

Poikilos opened this issue Dec 13, 2024 · 0 comments

Comments

@Poikilos
Copy link
Collaborator

Some use extra_bindings.

Example:

        self.sheet = Sheet(
            self,
            show_row_index=False,
        )
        self.sheet.headers(self.sheet_headers)

        # Key bindings only seem to work in root, not the sheet:
        self.root.bind("<F3>", lambda event: self.find_next())

        # Allow selection and editing
        self.sheet.enable_bindings((
            "single_select",     # Allow single cell selection
            # "row_select",        # Allow row selection
            # "column_select",     # Allow column selection
            "arrowkeys",         # Allow navigation using arrow keys
            # "edit_cell",         # Enable cell editing
            "double_click",      # Enable double-click functionality
            # "rc_select",         # Allow right-click selection
            # "rc_insert_column",  # Enable right-click column insert
            # "rc_delete_column",  # Enable right-click column delete
            # "rc_insert_row",     # Enable right-click row insert
            # "rc_delete_row",     # Enable right-click row delete
            "copy",              # Enable copy to clipboard
            "cut",               # Enable cut to clipboard
            # "paste"              # Enable paste from clipboard
        ))
        self.sheet.extra_bindings("cell_select", self.on_cell_click)
        self.sheet.bind("<Double-1>", self.on_cell_double_click)
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

1 participant