(go to: table of contents, index, list of vms_smg, prev: PREV, next: MOVE_TEXT)
Format:
If 'filespec' is omitted, the default file specification
is SMGDISPLY.DAT. You must use OpenVMS format for the file specification.
LOAD_VIRTUAL_DISPLAY - Load a Virtual Display from a File
Create a new virtual display and loads it from a file that has been created from
another virtual display saved with
vms_smg.save_virtual_display().
display_id = vms_smg.load_virtual_display ([filespec])
Returns:
Arguments:
Examples:
(go to: table of contents,
index, list of vms_smg,
prev: PREV,
next: MOVE_TEXT)
>>> import vms_smg
>>> import vms_smgdef
>>> # create a new DECwindows terminal using SMG
>>> status, pasteboard_id, number_of_pasteboard_rows, \
... number_of_pasteboard_columns, type_of_terminal, \
... device_name = vms_smg.create_pasteboard \
... (None, vms_smgdef.SMG_M_WORKSTATION)
>>>
>>> # create a virtual display
>>> status, vtdpy1 = vms_smg.create_virtual_display \
... (5, 10, vms_smgdef.SMG_M_BORDER, None, None)
>>>
>>> # paste the virtual display
>>> status = vms_smg.paste_virtual_display \
... (vtdpy1, pasteboard_id, 3, 5, None)
>>>
>>> # put some text in the display
>>> status = vms_smg.put_chars (vtdpy1, 'Line1Line1Line1', 1, 1)
>>> status = vms_smg.put_chars (vtdpy1, 'Line2Line2Line2', 2, 2)
>>> status = vms_smg.put_chars (vtdpy1, 'Line3Line3Line3', 3, 3)
>>>
>>> # save contents to a file
>>> vms_smg.save_virtual_display (vtdpy1, 'SMG.TMP')
>>>
The result is a file with binary contents. You should not use the DCL command
'TYPE' to view its contents.
>>> # load these contents into a new virtual display
>>> vtdpy2 = vms_smg.load_virtual_display ('SMG.TMP')
>>>
>>> # paste the new display
>>> status = vms_smg.paste_virtual_display \
... (vtdpy2, pasteboard_id, 7, 8, None)
>>>
>>> # try to save to an invalid filespec
>>> vms_smg.save_virtual_display (vtdpy1, 'BAD%@*.TMP')
Traceback (innermost last):
File "<stdin>", line 1, in ?
vms_smg.error: (100052, '%RMS-F-SYN, file specification syntax error')
>>>
>>> # try to save a non-existent display id
>>> vms_smg.save_virtual_display (vtdpy1+99, 'SMG.TMP')
Traceback (innermost last):
File "