PROCEDURE window_box_init IF GET_INFO (d_box_array, "type") = ARRAY THEN RETURN; ENDIF; pushbutton_class := DEFINE_WIDGET_CLASS ( "pushbuttonwidgetclassrec", "dwt$dialog_box_popup_create"); dialog_class := DEFINE_WIDGET_CLASS ( "dialogwidgetclassrec", "dwt$push_button_create"); d_box_array := CREATE_ARRAY; ENDPROCEDURE; PROCEDURE make_button_widget (parent, label, closure, offset, program_source) LOCAL button_widget; button_widget := CREATE_WIDGET (pushbutton_class, label, parent, COMPILE (program_source), closure, "activatCallback", 0, "x", 0, "y", offset, "conformToText", 1, "label", label); MANAGE_WIDGET (button_widget); offset := offset + 20; ENDPROCEDURE; PROCEDURE eve_window_box LOCAL button_index, d_box, d_box_index, offset; CONSTANT no_closure := "Closure Not Used"; ! ! Create the dialog box ! d_box := CREATE_WIDGET (dialog_class, "Window Box", SCREEN, "MESSAGE ('Activated')", no_closure, "title", "Window Box"); ! ! Save the dialog box widget ! IF GET_INFO (d_box_array, "last") = TPU$K_UNSPECIFIED THEN d_box_index := 0; ELSE d_box_index := GET_INFO (d_box_array, "last") + 1; ENDIF; d_box_array {d_box_index} := d_box; offset := 0; make_button_widget (d_box, "Next Window", no_closure, offset, "eve_next_window"); make_button_widget (d_box, "Previous Window", no_closure, offset, "eve_previous_window"); make_button_widget (d_box, "Split Window", no_closure, offset, "eve_split_window (2)"); make_button_widget (d_box, "Delete Window", no_closure, offset, "eve_delete_window"); make_button_widget (d_box, "Dismiss", d_box_index, offset, "window_box_dismiss"); MANAGE_WIDGET (d_box); RETURN true; ENDPROCEDURE; PROCEDURE window_box_dismiss LOCAL callback_args, d_box_index, status; ! ! Fetch parameters for this callback ! status := GET_INFO (WIDGET, "callback_parameters", callback_args); ! ! The closure is an index for the dialog box ! d_box_index := callback_args {"closure"}; DELETE (d_box_array {d_box_index}); d_box_array {d_box_index} := TPU$K_UNSPECIFIED; ENDPROCEDURE; window_box_init;