Comments (4)
Hello,
Thanks for the extra detail,
I reckon the issue is partly related to this
Where a tk button doesn't receive focus upon clicking on it and so "<FocusOut>"
is not triggered
What I've done in tksheet version 7.0.6
is added two functions:
- close_text_editor
- get_text_editor_value (you shouldn't need to use this one but it's there if you need it)
This is so that in your compute()
function you can add at the start of the function the line:
sheet_in_AN.close_text_editor()
This should set the cells value as if the user has hit Return
I am not sure why it was previously working okay with the older version though, perhaps I had bound more events to trigger the closing of the editor
Let me know if this is any help, if not I will try a different strategy
from tksheet.
Hello, thanks for your report and sorry to hear that the behaviour has changed.
It's difficult for me know what's going on at the moment, would it be possible to get just the lines that involve the sheet, specifically:
- Any bindings you have made with the sheet, like
extra_bindings()
or other things that might involve the cell text editor - The tk button called function lines that involve the sheet
You can strip out anything sensitive and the code does not have to run/work
from tksheet.
Hello,
Thanks for the quick response.
Here are the chunks of the code. I know it is pretty rudimentary, but bear with me :P
The code for the button:
button = Button(frame, text="Compute", command=lambda: compute())
button.grid(row=6, column=0, columnspan=3)
The sheet is initialized like this:
sheet_in_AN = Sheet(frame, align="center", empty_horizontal=0, empty_vertical=0, show_top_left=False,
cell_auto_resize_enabled = False, show_row_index=False, show_header=False, width=661, height=208,
show_x_scrollbar=False)
sheet_in_AN.grid(row=2, column=3, columnspan=5,rowspan=7)
sheet_in_AN.set_sheet_data([["" for cj in range(4)] for ri in range(20)])
sheet_in_AN.set_column_widths(column_widths=[88,198,174,174])
sheet_in_AN.enable_bindings(("single_select", "drag_select","arrowkeys",
"right_click_popup_menu","copy","cut",
"paste","delete","undo","edit_cell"))
Inside the function compute(), the lines that go fetch the values input by the user:
col3 = sheet_in_AN["C"].data
col4 = sheet_in_AN["D"].data
The values in columns A and B are automatically filled by other function. The user only inputs data in columns C and D.
What usually happens is that the users fill all the blank cells in columns C and D, but after writing the last value in column D, they don't press "enter" or click anywhere else on the sheet. Instead, they normally click directly on the button and the last cell filled in D column never ceases to edit, therefore the value they input is never stored.
So, col3 list's length is 1 value higher than the col4 and the rest of the compute() function, that needs that last value, fails to run on that try and the computations aren't done.
What is funny is that the first click on the button takes the focus out of the sheet widget, but it doesn't store the value, so the function doesn't run. But if I click a second time, the value is stored (probably after the first run of the function) and it works...
from tksheet.
Hello again,
I must say it worked like a charm!
Thank you so much for the impeccable assistance you have provided me and for the amazing work with developing this tool.
Keep up the awesome job, it is really uncanny how useful tksheet in our community!
from tksheet.
Related Issues (20)
- Issues with auto_resize_row_index HOT 1
- Column header data not made when creating new columns HOT 2
- KeyError when binding a function (which selects a row) to "cell_select" HOT 8
- Resizing columns automatically to fit the frame if they would be smaller in total than the available space HOT 6
- Can we add a feature where Checkbox fill the entire cell ?
- Deleting popup_menu. HOT 3
- Moving columns/rows to the end is currently broken on 7.2.6
- How to make the Checkbox remain checked after searching in Entry HOT 1
- Copy&Paste HOT 2
- Sheet object takes focus when setting sheet data? How to inhibit? HOT 6
- Dropdown multi-select checkbox filter HOT 1
- function "checkbox" in "other_classes.py" currently creates a dropdown instead of a checkbox HOT 1
- REQUEST : Add a sort function
- IndexError: list index out of range
- Deleting Row(s): TypeError: cannot pickle '_tkinter.tkapp' object HOT 3
- Issue on Selected rows when Displaying Rows HOT 5
- ScrollBar BackGround HOT 3
- Change 'Return' key behavior after end_edit_cell
- Problem with right click popup menu inside the cell HOT 3
- 'end_edit_cell' with 'Return' key as 'Tab' key HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tksheet.