#!/usr/bin/env rexx
/* drawbox.rex - Draw an ncurses box using ooRexx nCurses library */

do
    /* call ORXCURINITSCR      / Initialize ncurses /
    call OrxCurNoecho       / Disable echoing /
    call OrxCurCbreak       / Enable immediate input /
     */
    /* Create a window: height, width, start_y, start_x */
    win = OrxCurNewwin(10, 20, 5, 10)
    call OrxCurBox win, 0, 0 /* Draw box with default ACS characters */
    call OrxCurWrefresh win  /* Display the window */
    
    call OrxCurGetch         /* Wait for keypress */
    call OrxCurEndwin        /* Clean up */
end

catch error
    say "Error:" error~message
    call OrxCurEndwin        /* Ensure cleanup on error */
exit

::requires "ncurses.cls"