(LOGO.JPG) Python for OpenVMS

(go to: table of contents, index, list of vms_smg, prev: CHANGE_RENDITION, next: CHANGE_VIRTUAL_DISPLAY)


CHANGE_VIEWPORT - Change Viewport associated with a Virtual Display

Change the size of an existing viewport in a virtual display.

Format:

    vms_smg.change_viewport (display_id,                 \
        [viewport_row_start], [viewport_column_start],   \
        [viewport_number_rows], [viewport_number_columns])
Returns:

None

Arguments:

display_id
Display to which the viewport is associated.
viewport_row_start
New row number in the virtual display that will become row 1 in the viewport.
viewport_column_start
New column number in the virtual display that will become column 1 in the viewport.
viewport_number_rows
New number of rows in the viewport.
viewport_number_columns
New number of columns in the viewport.
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)

>>> # change the viewport
>>> vms_smg.change_viewport (vtdpy1, 1, 2, 3, 4)
>>>

Screen layout, file: VMS_SMG_010.JPG

(picture VMS_SMG_010.JPG)

>>> # errors
>>> vms_smg.change_viewport (vtdpy1, 0, 0, 9, 9)
Traceback (innermost last):
  File "<stdin>", line 1, in ?
vms_smg.error: (1212972, '%SMG-F-INVROW, invalid row')
>>>

>>> vms_smg.change_viewport (vtdpy1, 1, 0, 9, 9)
Traceback (innermost last):
  File "<stdin>", line 1, in ?
vms_smg.error: (1212948, '%SMG-F-INVCOL, invalid column')
>>>

>>> # try to change the viewport of a non-existing display
>>> vms_smg.change_viewport (vtdpy1+99, 1, 2, 3, 4)
Traceback (innermost last):
  File "<stdin>", line 1, in ?
vms_smg.error: (1212956, '%SMG-F-INVDIS_ID, invalid display-id')
>>>

>>> # delete the viewport for the next demo
>>> vms_smg.delete_viewport (vtdpy1)

Notice that the virtual display has just been un-pasted. This can
be checked with: vms_smg.get_pasting_info()

>>> # try to change a non-existing viewport
>>> vms_smg.change_viewport (vtdpy1, 1, 2, 3, 4)
Traceback (innermost last):
  File "<stdin>", line 1, in ?
vms_smg.error: (1213332, '%SMG-F-NO_WINASSOC, no viewport has been\
 associated with the display')
>>>

(go to: table of contents, index, list of vms_smg, prev: CHANGE_RENDITION, next: CHANGE_VIRTUAL_DISPLAY)

10-SEP-2000 ZE.