Skip to content

Commit

Permalink
Fix UI for small screens by adding scrollbar
Browse files Browse the repository at this point in the history
  • Loading branch information
iansan5653 committed Nov 9, 2023
1 parent 38e5bde commit e4f523d
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions src/user_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
import scoring
import str_utils

# Import tkinter.scrolledtext module
import tkinter.scrolledtext

YPADDING = 4
XPADDING = 7
APP_NAME = "OpenMCR"
Expand Down Expand Up @@ -470,20 +473,25 @@ def __init__(self):

app.protocol("WM_DELETE_WINDOW", self.__on_close)

# Replace tk.Frame with tkinter.scrolledtext.ScrolledText for the main window container
# Set the height option of the container to a reasonable value, e.g. 30
container = tkinter.scrolledtext.ScrolledText(app, height=30, state=tk.DISABLED)
container.pack(fill=tk.BOTH, expand=1)

self.__input_folder_picker = InputFolderPickerWidget(
app, self.__on_update)
self.__answer_key_picker = AnswerKeyPickerWidget(app, self.__on_update)
container, self.__on_update)
self.__answer_key_picker = AnswerKeyPickerWidget(container, self.__on_update)
self.__arrangement_map_picker = ArrangementMapPickerWidget(
app, self.__on_update)
container, self.__on_update)
self.__output_folder_picker = OutputFolderPickerWidget(
app, self.__on_update)
container, self.__on_update)

self.__status_text = tk.StringVar()
status = tk.Label(app, textvariable=self.__status_text)
status = tk.Label(container, textvariable=self.__status_text)
status.pack(fill=tk.X, expand=1, pady=(YPADDING * 2, 0))
self.__on_update()

buttons_frame = tk.Frame(app)
buttons_frame = tk.Frame(container)

# "Open Help" Button
pack(ttk.Button(buttons_frame,
Expand Down

0 comments on commit e4f523d

Please sign in to comment.