Comments (6)
Hello,
Sorry about that and thank you very much for pointing out the cause and offering a solution
It should be fixed in version 4.6.4 and the function has a few new arguments and the box should hug the cell size by using a frame internally, the new function looks like this:
create_dropdown(r = 0,
c = 0,
values = [],
set_value = None,
state = "readonly",
see = True,
destroy_on_select = True,
current = False,
openbox = True,
set_cell_on_select = True,
redraw = True,
recreate_selection_boxes = True)
openbox
is for whether or not you want the box to be opened upon creation, redraw and recreate are for if destroy_on_select
is True
Let me know if there are further problems with the function
As for the checkbox suggestion, thankyou it's a great idea, do you mean like a single checkbox or multiple ones in a scrollable window inside the cell?
from tksheet.
Thanks for your quick answer, I made a new tests still at the end of the demo:
self.sheet.create_dropdown(3, 3, values=["AAA","BBB","CCC","DDD"], set_value="CCC", see=False, openbox=False, destroy_on_select=False)
self.sheet.create_dropdown(4, 3, values=["AAA","BBB","CCC","DDD"], set_value="BBB", see=False, openbox=False, destroy_on_select=False)
self.sheet.create_dropdown(5, 3, values=["AAA","BBB","CCC","DDD"], set_value="DDD", see=False, openbox=False, destroy_on_select=False)
print (self.sheet.get_cell_data(3, 3))
print (self.sheet.get_cell_data(4, 3))
print (self.sheet.get_cell_data(5, 3))
Correction: I need to remove line 3867 in _tksheet_main_table (create_dropdown)
self.destroy_dropdown()
else all previous combox are not display only the last one (but may be this correction is too strong) sorry I do not yet read all code.
I saw as well that cell values are not really set with the print you can see old value are displayed (should be initial combo setup CCC BBB DDD in the example)
For my need a single checkbutton is enough and probably more simple to create ;-)
from tksheet.
Ah yeah, I see what you mean, unfortunately it's always been designed as a singular input thing and it will take a few days to overhaul the code to create and manage multiple dropdown boxes that persist as I have very little free time at the moment, but I will do the work, it will just take a few days or a week to complete
from tksheet.
I understand, no problem,
Thank you for your time
from tksheet.
@skedus Hello,
With version 4.6.6 I have added the basic functionality to create multiple persistent boxes which will update the underlying table upon creation and selection, I have removed the argument openbox
as it was causing weird lag and focus issues, so you can try your code as below again:
self.sheet.create_dropdown(3, 3, values=["AAA","BBB","CCC","DDD"], set_value="CCC", see=False, destroy_on_select=False)
self.sheet.create_dropdown(4, 3, values=["AAA","BBB","CCC","DDD"], set_value="BBB", see=False, destroy_on_select=False)
self.sheet.create_dropdown(5, 3, values=["AAA","BBB","CCC","DDD"], set_value="DDD", see=False, destroy_on_select=False)
print (self.sheet.get_cell_data(3, 3))
print (self.sheet.get_cell_data(4, 3))
print (self.sheet.get_cell_data(5, 3))
Please note that actions such as cell resizing, undo, drag and drop etc will not really work while you have these persistent boxes up, I will slowly add more code to maintain their positions and size etc, but I don't have a schedule for it
from tksheet.
Thank you for this update, It is working. But you are right many other things to do, to keep all functionalities (sorry for that)
I still do not know if it is the good approach, may by each cell should have a link to a specific class such, let say, Editor and various sub class EntryEditor (default one), ComboEditor ... which could be call only when edit cell and set the value ?? so non persistent as you did.
Then it could be possible to affect an Editor to cell, row, or column (even a custom one CustomEditor(Editor)) I do not know just thinking.
Anyway thanks again for your high level of response.
from tksheet.
Related Issues (20)
- Looking to customize scrollbar and scrollbar frame bg HOT 2
- Don't work keyboard UP arrow when navigating through the table of tksheet HOT 1
- Multiple issues with Toggle Select Mode
- Partial Horizontal Scrolling HOT 2
- Rows sorting? HOT 2
- Cell Selection Persistence HOT 2
- Keypad enter button ignored HOT 2
- Quotes multiplies when i copy text from cell with ctrl+c or popup menu. HOT 2
- Editing out of bounds when changing sheets HOT 2
- Is there a way to set copy and paste bindings on cyrillic layout? HOT 7
- 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
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.