GithubHelp home page GithubHelp logo

Comments (6)

ragardner avatar ragardner commented on June 12, 2024 1

Ah, I think this is the behavior I programmed for,

Would you prefer the next dropdown box to open when pressing tab out of an existing one? I am not sure, it's not the behavior in excel and google sheets as far as I can tell, although it might be more convenient to have it this way...

You could open it by using Tab -> Return I think

from tksheet.

ragardner avatar ragardner commented on June 12, 2024

Hi,

The Second issue i came across was the double_clicking on a cell which has an overflowing number of characters. When i double click, the column gets resized. I have tried to disable the following bindings 'double_click_column_resize' and 'column_width_resize' but nothing changes. I still have the same issue.

You can disable cell auto resizing when editing cells completely with the argument enable_edit_cell_auto_resize = False in the Sheet() initialization

my_sheet = Sheet(parent, enable_edit_cell_auto_resize = False)

or with set_options(enable_edit_cell_auto_resize = False)

The specific part of the code that deals with resizing the cell upon opening is:

text = "" if text is None else text
if self.cell_auto_resize_enabled:
    self.set_cell_size_to_text(r, c, only_set_if_too_small=True, redraw=True, run_binding=True)

It's in the open_text_editor() function


I also would like to have an autofill feature for the drop down list. This way when I write 'OF' on an ['ON','OFF'] drop down list and then press < Tab > the 'OFF' gets selected.

I won't be working on this functionality for some time, I am not sure of the best way to implement it sorry but there would have to be communication between the dropdown window and the text editor, these two are in the open_dropdown() function


When i press < Tab > or < Enter > on an editable sheet, I can't edit the cell without an additional click to reselect the ongoing cell. I have tried to go through the tab_key(self, event=None) function of the MainTable class, replacing self.see by self.select_cell but it doesn't work.

Sorry, I'm not sure what you mean, is focus not being applied to the text editor when you press Enter on a cell?

from tksheet.

Mrasipila avatar Mrasipila commented on June 12, 2024

Thank you for your response. Focus is being applied but I can't write text on the cell without reclicking on the focused cell.

from tksheet.

ragardner avatar ragardner commented on June 12, 2024

I cannot think why this is happening sorry, is there any way you could provide a minimal example and which version of tksheet you're using?

from tksheet.

Mrasipila avatar Mrasipila commented on June 12, 2024

I have the issue with this piece of code, my version is 6.1.2.

from tksheet import Sheet
import tkinter as tk


class demo(tk.Tk):
    def __init__(self):
        tk.Tk.__init__(self)
        self.grid_columnconfigure(0, weight = 1)
        self.grid_rowconfigure(0, weight = 1)
        self.frame = tk.Frame(self)
        self.frame.grid_columnconfigure(0, weight = 1)
        self.frame.grid_rowconfigure(0, weight = 1)
        self.sheet = Sheet(self.frame,
                           data = [[f"Row {r}, Column {c}\nnewline1\nnewline2" for c in range(50)] for r in range(500)])
        self.sheet.enable_bindings()
        self.show_selections = tk.Label(self)
        self.frame.grid(row = 0, column = 0, sticky = "nswe")
        self.sheet.grid(row = 0, column = 0, sticky = "nswe")
        self.show_selections.grid(row = 1, column = 0, sticky = "nswe")
        self.sheet.dropdown_column(c=1, values=["ON", "OFF"])


app = demo()
app.mainloop()

I upgraded to the latest version which is "6.1.9" and the problem has been solved. I work with PyCharm hence the fact that i didn't have installed the latest version to start with.
Thank you !

from tksheet.

Mrasipila avatar Mrasipila commented on June 12, 2024
from tksheet import Sheet
import tkinter as tk


class demo(tk.Tk):
    def __init__(self):
        tk.Tk.__init__(self)
        self.grid_columnconfigure(0, weight = 1)
        self.grid_rowconfigure(0, weight = 1)
        self.frame = tk.Frame(self)
        self.frame.grid_columnconfigure(0, weight = 1)
        self.frame.grid_rowconfigure(0, weight = 1)
        self.sheet = Sheet(self.frame,
                           data = [[f"Row {r}, Column {c}\nnewline1\nnewline2" for c in range(50)] for r in range(500)])
        self.sheet.enable_bindings()
        self.show_selections = tk.Label(self)
        self.frame.grid(row = 0, column = 0, sticky = "nswe")
        self.sheet.grid(row = 0, column = 0, sticky = "nswe")
        self.show_selections.grid(row = 1, column = 0, sticky = "nswe")
        self.sheet.dropdown_column(c=1, values=["ON", "OFF"])
        self.sheet.dropdown_column(c=2, values=["ON", "OFF"])
        self.sheet.dropdown_column(c=3, values=["ON", "OFF"])


app = demo()
app.mainloop()

but with this example the problem seems to persist with the drop down columns. The dropdown list doesn't drop after pressing TAB and arriving on it.

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.