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

deselecting the table #260

Open
janez111 opened this issue Dec 17, 2024 · 4 comments
Open

deselecting the table #260

janez111 opened this issue Dec 17, 2024 · 4 comments

Comments

@janez111
Copy link

Dear ragardner,

I have (again) a question about your tksheet. Hopefully, I will be clear enough.

When I double-click on a cell in the table, a cursor starts blinking inside it. Pressing Escape removes the cursor, but the cell remains selected (with bolded borders). I am interested in how to completely deselect the table.

I tried using tksheet.focus_out(), but it didn’t work as I hoped. I also tried the deselect function, but it wasn’t successful either.

Do you have any suggestions on how I can fully deselect the table?

Thank you for your time and help!

Best regards, Janez

@ragardner
Copy link
Owner

ragardner commented Dec 17, 2024

Hello,

My apologies, hmm, perhaps something is going wrong, but I think in any case this is not explained well enough in the documentation

Did you try:

sheet.deselect() # no arguments

Kind regards

@ragardner
Copy link
Owner

If you have tried it without arguments already and it doesn't work something must be going wrong and I'll try to figure out what exactly

I will also improve the documentation regardless as I think it's not good enough for this function

@janez111
Copy link
Author

janez111 commented Dec 18, 2024 via email

@ragardner
Copy link
Owner

Ah sorry, my mistake,

Try this instead:

# close any open text editor without setting cell data
# does nothing if one isn't open
sheet.close_text_editor(set_data=False)

# clears all cell selections
sheet.deselect()

You can then use whichever focus functions you need to after the above, if needed

Kind regards

ragardner added a commit that referenced this issue Dec 18, 2024
When calling deselect() it seems logical that an open text editor would also be closed if deselect interferes with the selection box the cell is open in

Addresses #260
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