#!/usr/bin/env python3 """ Test script to verify the scrollable input frame functionality. """ import os import sys import tkinter as tk from tkinter import ttk # Add src to path sys.path.append(os.path.join(os.path.dirname(__file__), "src")) def test_scrollable_input(): """Test the scrollable input frame.""" from src.init import logger from src.ui_manager import UIManager # Create a test window root = tk.Tk() root.title("Scrollable Input Frame Test") root.geometry("400x600") # Smaller window to test scrolling # Create UI manager ui_manager = UIManager(root, logger) # Create main frame main_frame = ttk.Frame(root, padding="10") main_frame.grid(row=0, column=0, sticky="nsew") root.grid_rowconfigure(0, weight=1) root.grid_columnconfigure(0, weight=1) main_frame.grid_rowconfigure(1, weight=1) main_frame.grid_columnconfigure(0, weight=1) # Create the scrollable input frame _input_ui = ui_manager.create_input_frame(main_frame) # Add instructions instructions = ttk.Label( root, text="Test the scrolling functionality:\n" "1. Try mouse wheel scrolling over the input area\n" "2. Use the scrollbar on the right\n" "3. Test dose tracking buttons\n" "4. Resize the window to test responsiveness", justify="left", ) instructions.grid(row=1, column=0, padx=10, pady=10, sticky="ew") # Print success message print("✓ Scrollable input frame created successfully!") print("✓ Medicine dose tracking UI elements loaded") print("✓ Scrollbar functionality active") print("✓ Mouse wheel scrolling enabled") print("\nTest window opened. Close the window when done testing.") # Start the test GUI root.mainloop() if __name__ == "__main__": test_scrollable_input()