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

Ellipsize strings that are too long #56

Open
h1ckstead opened this issue May 26, 2023 · 0 comments
Open

Ellipsize strings that are too long #56

h1ckstead opened this issue May 26, 2023 · 0 comments
Assignees
Labels
Improvement Things could be better
Milestone

Comments

@h1ckstead
Copy link
Owner

h1ckstead commented May 26, 2023

Text in some Labels can be too long and needs to be eclipsed and full text displayed in a tooltip:

  • In the Session History block on Practice Page "correction_label" (now it is cut at 50 chars [:50])
  • In the Vocabulary section on Vocabulary Page (now long words push the [Next] button and "Times to spell" label to the right)

Example without tooltip:
`import tkinter as tk

def truncate_text(text, max_length):
if len(text) > max_length:
truncated_text = text[:max_length-3] + "..."
else:
truncated_text = text
return truncated_text

root = tk.Tk()

root.columnconfigure(0, minsize=200)
root.columnconfigure(1, minsize=200)
root.rowconfigure(0, minsize=50)

label_text = "This is a long label that should be truncated if it exceeds the available space"
max_label_length = 25
truncated_label_text = truncate_text(label_text, max_label_length)

label = tk.Label(root, text=truncated_label_text, wraplength=180, anchor="w")
label.grid(row=0, column=0, sticky="w")

root.mainloop()`

@h1ckstead h1ckstead self-assigned this May 26, 2023
@h1ckstead h1ckstead added the Improvement Things could be better label May 26, 2023
@h1ckstead h1ckstead added this to the 1.1 milestone May 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Improvement Things could be better
Projects
None yet
Development

No branches or pull requests

1 participant