#!/usr/bin/env python3
"""Simple text viewer window (stands in for a text editor in screenshots)

    viewer.py <file> [columns] [rows]
"""
import os
import sys
import tkinter as tk

path = sys.argv[1]
root = tk.Tk()
root.title(os.path.basename(path))
text = tk.Text(root, width=int(sys.argv[2]) if len(sys.argv) > 2 else 90,
               height=int(sys.argv[3]) if len(sys.argv) > 3 else 22,
               font=("DejaVu Sans Mono", 9), bg="white", relief="flat", padx=6, pady=4)
text.insert("1.0", open(path, errors="replace").read())
text.config(state="disabled")
text.pack(fill="both", expand=True)
root.mainloop()
