(LOGO.JPG) Python for OpenVMS

(go to: table of contents, index, list of vms_smg, prev: SCROLL_DISPLAY_AREA, next: NEXT)


SCROLL_VIEWPORT - Scroll a Display Under a Viewport

Scroll a virtual display under its associated viewport.

Format:

    status = vms_smg.scroll_viewport (display_id, \
                    [direction], [count])
Returns:
status
Condition code as returned from SMG$SCROLL_VIEWPORT. You must check the status yourself - no exception is created.
Arguments:
display_id
Virtual display to be scrolled.
direction
Direction specifier. Bit mask values like SMG_M_UP are in module 'vms_smgdef'.
count
Number of rows or columns to scroll.
Examples:
>>> 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)
>>>

Screen layout, file: VMS_SMG_009.JPG

(picture VMS_SMG_009.JPG)

>>> # 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
>>>

Screen layout, file: VMS_SMG_050.JPG

(picture VMS_SMG_050.JPG)

>>> # 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
>>>

Screen layout, file: VMS_SMG_051.JPG

(picture VMS_SMG_051.JPG)

>>> 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
>>>

(go to: table of contents, index, list of vms_smg, prev: SCROLL_DISPLAY_AREA, next: NEXT)

11-SEP-2000 ZE.