summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornavanchauhan <navanchauhan@gmail.com>2023-08-17 18:06:47 -0600
committernavanchauhan <navanchauhan@gmail.com>2023-08-17 18:06:47 -0600
commitdb7d67231414d3db3285a978113f55ed08fb33dd (patch)
tree649ffde7e9a65fcd32b062e8c4068ddb906fa537
parent248784705da23845874f28d0cdcfa62455b90de7 (diff)
automatic line wrap on longer names
-rw-r--r--main.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/main.py b/main.py
index 7610d0f..c84ab23 100644
--- a/main.py
+++ b/main.py
@@ -1,5 +1,6 @@
import pandas as pd
import tkinter as tk
+import textwrap
from tkinter import ttk
from tkinter.filedialog import askopenfilename, asksaveasfilename
from datetime import datetime
@@ -453,7 +454,7 @@ class CompanySelector:
max_companies_in_row = 10
config = read_config(path.join(user_data_dir(appname, appauthor), "config.json"))
-
+ print(config)
img_width = config['img_width']
pyramid_width = config['pyramid_width']
img_height = config['img_height']
@@ -633,7 +634,13 @@ class CompanySelector:
if type(text5) == list:
text5.append(f"Prepared for {self.prepared_for_string.get()}")
else:
- text5 = [text5, f"Prepared for {self.prepared_for_string.get()}"]
+ temp_prepared_for_text = f"Prepared for {self.prepared_for_string.get()}"
+ if len(temp_prepared_for_text) > 30:
+ text5 = [text5, "Prepared for: "]
+ for line in textwrap.wrap(self.prepared_for_string.get(), 30, break_long_words=False):
+ text5.append(line)
+ else:
+ text5 = [text5, f"Prepared for {self.prepared_for_string.get()}"]
if self.advisor_string.get() != "":
advisor = self.advisor_string.get()
if text5 != "":