1990-10-13 20:23:40 +01:00
|
|
|
# Module 'filewin'
|
|
|
|
# File windows, a subclass of textwin (which is a subclass of gwin)
|
|
|
|
|
|
|
|
import textwin
|
1991-04-21 21:31:39 +02:00
|
|
|
import builtin
|
1990-10-13 20:23:40 +01:00
|
|
|
|
|
|
|
|
|
|
|
# FILE WINDOW
|
|
|
|
|
|
|
|
def open_readonly(fn): # Open a file window
|
1991-04-21 21:31:39 +02:00
|
|
|
fp = builtin.open(fn, 'r')
|
|
|
|
w = textwin.open_readonly(fn, fp.read())
|
1990-10-13 20:23:40 +01:00
|
|
|
w.fn = fn
|
|
|
|
return w
|
|
|
|
|
|
|
|
def open(fn): # Open a file window
|
1991-04-21 21:31:39 +02:00
|
|
|
fp = builtin.open(fn, 'r')
|
|
|
|
w = textwin.open(fn, fp.read())
|
1990-10-13 20:23:40 +01:00
|
|
|
w.fn = fn
|
|
|
|
return w
|