(go to: table of contents, index, list of vms_smg, prev: SCROLL_DISPLAY_AREA, next: NEXT)
Format:
SCROLL_VIEWPORT - Scroll a Display Under a Viewport
Scroll a virtual display under its associated viewport.
status = vms_smg.scroll_viewport (display_id, \
[direction], [count])
Returns:
Arguments:
Examples:
(go to: table of contents,
index, list of vms_smg,
prev: SCROLL_DISPLAY_AREA,
next: NEXT)
>>> 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 virtual display
>>> status, vtdpy1 = vms_smg.create_virtual_display \
... (5, 10, vms_smgdef.SMG_M_BORDER, None, None)
>>>
>>> # write to virtual display
>>> status = vms_smg.put_chars (vtdpy1, '1234567890', 1, 1)
>>> status = vms_smg.put_chars (vtdpy1, 'ABCDEFGHIJ', 2, 1)
>>> status = vms_smg.put_chars (vtdpy1, 'KLMNOPQRST', 3, 1)
>>> status = vms_smg.put_chars (vtdpy1, 'abcdefghij', 4, 1)
>>> status = vms_smg.put_chars (vtdpy1, 'klmnopqrst', 5, 1)
>>>
>>> # create a viewport
>>> status = vms_smg.create_viewport (vtdpy1, 2, 3, 4, 5)
>>>
The examples section of vms_smg.create_viewport() shows that
this has no immediate effect if the virtual display is already
pasted. It also shows the contents of the whole virtual display.
>>> # paste virtual display
>>> status = vms_smg.paste_virtual_display \
... (vtdpy1, pasteboard_id, 3, 5, None)
>>>
>>> # scroll the viewport
>>> status = vms_smg.scroll_viewport \
... (vtdpy1, vms_smgdef.SMG_M_DOWN, 2)
>>>
>>> import vms_sys
>>> print vms_sys.getmsg (status)[0]
%SMG-S-WINTRUNCFIT, viewport truncated to fit
>>>
>>> # scroll the viewport again
>>> status = vms_smg.scroll_viewport \
... (vtdpy1, vms_smgdef.SMG_M_LEFT, 2)
>>>
>>> import vms_sys
>>> print vms_sys.getmsg (status)[0]
%SYSTEM-S-NORMAL, normal successful completion
>>>
>>> status = vms_smg.scroll_viewport (vtdpy1, vms_smgdef.SMG_M_UP, 999)
>>> print vms_sys.getmsg (status)[0]
%SMG-S-WINTRUNCFIT, viewport truncated to fit
>>> # (the viewport has disappeared)
>>> # try to scroll the viewport of a non-existing display
>>> status = vms_smg.scroll_viewport (vtdpy1+99, vms_smgdef.SMG_M_UP, 1)
>>> print vms_sys.getmsg (status)[0]
%SMG-F-INVDIS_ID, invalid display-id
>>>
>>> # delete the viewport for the next demo
>>> vms_smg.delete_viewport (vtdpy1)
>>> # try to change a non-existing viewport
>>> status = vms_smg.scroll_viewport (vtdpy1, vms_smgdef.SMG_M_UP, 1)
>>> print vms_sys.getmsg (status)[0]
%SMG-F-NO_WINASSOC, no viewport has been associated with the display
>>>