(LOGO.JPG) Python for OpenVMS

(go to: table of contents, index, list of vms_smg, prev: PREV, next: VIRTUAL_DISPLAY)


CREATE_VIEWPORT - Create Virtual Viewport

Associate a viewport with a virtual display.

Format:

    status = vms_smg.create_viewport (display_id,    \
        viewport_row_start, viewport_column_start,   \
        viewport_number_rows, viewport_number_columns)
Returns:
status
Condition code as returned from SMG$CREATE_VIEWPORT. Either SS$_NORMAL or SMG$_NOTPASTE are returned here - all other codes produce a Python exception.
Arguments:
display_id
Display to which the viewport is associated.
viewport_row_start
Row number in the virtual display that will become row 1 in the viewport.
viewport_column_start
Column number in the virtual display that will become column 1 in the viewport.
viewport_number_rows
Number of rows in the viewport.
viewport_number_columns
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
>>> vms_smg.put_chars (vtdpy1, '1234567890', 1, 1)
>>> vms_smg.put_chars (vtdpy1, 'ABCDEFGHIJ', 2, 1)
>>> vms_smg.put_chars (vtdpy1, 'KLMNOPQRST', 3, 1)
>>> vms_smg.put_chars (vtdpy1, 'abcdefghij', 4, 1)
>>> vms_smg.put_chars (vtdpy1, 'klmnopqrst', 5, 1)
>>>

>>> # paste virtual display
>>> status = vms_smg.paste_virtual_display \
...          (vtdpy1, pasteboard_id, 3, 5, None)
>>>

Screen layout

(picture VMS_SMG_008.JPG)

>>> # create a viewport
>>> status = vms_smg.create_viewport (vtdpy1, 2, 3, 4, 5)
>>>

Notice that the effect is not immediately visible.

>>> # repaste virtual display
>>> vms_smg.repaste_virtual_display (vtdpy1, pasteboard_id, 3, 5, None)
>>>

Screen layout

(picture VMS_SMG_009.JPG)

>>> # try to associate a viewport to a non-existing display
>>> status = vms_smg.create_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')
>>>

(go to: table of contents, index, list of vms_smg, prev: PREV, next: VIRTUAL_DISPLAY)

02-JUL-2000 ZE.