summaryrefslogtreecommitdiffstats
path: root/Lib/lib-stdwin/filewin.py
blob: a03c3f70a63cdd8d1849a935c04765186ee561f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Module 'filewin'
# File windows, a subclass of textwin (which is a subclass of gwin)

import textwin
import builtin


# FILE WINDOW

def open_readonly(fn): # Open a file window
	fp = builtin.open(fn, 'r')
	w = textwin.open_readonly(fn, fp.read())
	w.fn = fn
	return w

def open(fn): # Open a file window
	fp = builtin.open(fn, 'r')
	w = textwin.open(fn, fp.read())
	w.fn = fn
	return w