Giter Site home page Giter Site logo

Binding for cell edit begin about tksheet HOT 5 CLOSED

ragardner avatar ragardner commented on June 5, 2024
Binding for cell edit begin

from tksheet.

Comments (5)

ragardner avatar ragardner commented on June 5, 2024

@cpellet Hi, sorry for the lateness of my response,

I have implemented this binding in version 4.5.7, it activates immediately upon a user opening the cell edit window, the variable it sends to your binded function is a tuple of (<row index>, <column index>, <key pressed>)

You can use the binding like so:

self.sheet_demo.extra_bindings([("begin_edit_cell", <put your function name here>)])

You can deactivate the binding like so:

self.sheet_demo.extra_bindings([("begin_edit_cell", None)])

Thank you for your feedback and if you have any more questions let me know

from tksheet.

cpellet avatar cpellet commented on June 5, 2024

Perfect! Thanks a lot for your work!

from tksheet.

cpellet avatar cpellet commented on June 5, 2024

Hello again,

I have spotted a small bug with this new binding: if the cell's content is updated and the table is refreshed right at the start of the editing, the changes aren't taken into account. For instance:
def edit_cell_begin(self, response):
self.sheet.set_cell_data(response[0], response[1], "edit mode")
self.sheet.refresh(False, False)
doesn't update the text box to "edit mode".

Would there be an easy fix for this?

Thank you in advance for your time

from tksheet.

ragardner avatar ragardner commented on June 5, 2024

@cpellet

Yes I absolutely put it in the wrong spot, not thinking about the consequences of getting the value before it, if convenient could you check if it is totally fixed for you in 4.5.8? I actually changed it again slightly after your pull request because I wondered about the impact of the cell being empty and so it putting in the event.char value anyway

Here are the release notes:

Version 4.5.8

  • Add function set_text_editor_value()
  • Moved internal begin_cell_edit code slightly
  • Make Alt-Return on text editor only increase text window height if too small

from tksheet.

cpellet avatar cpellet commented on June 5, 2024

@ragardner
Yes, this is perfect, works as expected. It might be worth explaining the difference between set_text_editor_value() and set_cell_data() in the documentation now, as this is quite ambiguous.

from tksheet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.