|
Contents | Previous | Next | Subchapters |
| Syntax |
addeditor(caption, geometry, call back, data)caption, geometry, call back, data, style)
|
| See Also | geteditor , delwin , adddialog , controls , addtable , gaddwin |
Editors created with this command can be saved using the O-Matrix menu
commands "File | Save" and "File | Save As," but the caption does not
change to reflect the specified file name.
When the edit window is closed,
the user is not automatically prompted to save the text
contained within the editor
(even if the editor's contents have been saved to a file previously).
c:\omwin\autoexec.oms
into a character row vector.
It then creates an editor window
that initially contains the contents of the file.
The contents of the editor are printed in the Command window
when the editor is deleted from its caption bar.
(Warning: if you change the contents of this editor window
and then use File | Save, you will change you autoexec
file.)
clear
#
file = "c:\omwin\autoexec.oms"
enough = 10000
data = fill(" ", 1, enough)
idata = 1
for i = 1 to nrows(file) begin
line = read(file, "byte")
nc = coldim(line)
data.col(idata, nc) = line
idata = idata + nc + 1
data(idata - 1) = NEW_LINE
end
data = data.col(1, idata - 1)
#
caption = "Example Editor"
geometry = [100, 100, 400, 400]
callback = "Done"
addeditor(caption, geometry, callback, data)
#
function Done() begin
global caption
data = geteditor(caption)
write("screen", data)
delwin(caption);
end