/**/

rx_tools_init = getclip( 'rx_tools_init' )
interpret rx_tools_init

i = 1

a_window = _send( 'rx_console', _OPEN, 430, 20, 150, 170, "console window" i, my_port )

is_opened.a_window = 't'

call send a_window, _SET_IDCMP_FLAGS, INTUITICKS

/* call send a_window, _START_REPORT_MOUSEBUTTONS */

call send a_window, _SET_IDCMP_RX_CALLBACKS, INTUITICKS

number_of_open_windows = i

event_handler = getclip( 'rx_tools_event_handler' )
interpret event_handler

NEWPREFS:
DISKINSERTED:
WBENCHMESSAGE:
ACTIVEWINDOW:
INACTIVEWINDOW:
VANILLAKEY:
INTUITICKS:
REFRESHWINDOW:
MOUSEBUTTONS:
MOUSEMOVE:
DELTAMOVE:
NEWSIZE: procedure expose function_identifier
	parse arg a_window

	call send a_window, _PUT_STRING, function_identifier || '0A'x

	return

CLOSEWINDOW: procedure expose intui_message. number_of_open_windows is_opened. ,
                              a_screen packet
	parse arg a_window

	call send a_window, _CLOSE
	call send a_window, _DELETE
	is_opened.a_window = 'f'
	number_of_open_windows = number_of_open_windows - 1
	if number_of_open_windows = 0 then
		do
        	call reply packet, 0
			exit 0
		end
	else
		return
    end
