Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!rice!sun-spots-request From: matrix!venkat@uunet.uu.net (D Venkatrangan) Newsgroups: comp.sys.sun Subject: Re: Sunview programming questions Keywords: Windows Message-ID: <8505@brazos.Rice.edu> Date: 4 Jun 90 16:04:52 GMT Sender: root@rice.edu Organization: Sun-Spots Lines: 29 Approved: Sun-Spots@rice.edu X-Refs: Original: v9n184 X-Sun-Spots-Digest: Volume 9, Issue 184, message 11 In article <8288@brazos.Rice.edu> peters@udel.edu writes: > >Problem: how do I keep the window alive and still return control to the >calling program. SunView, like most other windowing environments is "message based". You register your functions with window objects when the window objects are created. Then, you enter a window loop function which actively examines user and program events and dispatches them to the proper functions. In this sense, the window loop is always in control; you enter the functions that you registered when the windowing environment thinks that your functions are to be called. For e.g. base_frame = window_create(NULL, FRAME, 0); /* add other frame attrs */ panel = window_create(base_frame, PANEL, WIN_X, 0, WIN_Y, 0, WIN_WIDTH, WIN_EXTEND_TO_EDGE, WIN_HEIGHT, WIN_EXTEND_TO_EDGE, 0); quit_button = panel_create_item(panel, PANEL_BUTTON, PANEL_LABEL_X, 20, PANEL_LABEL_Y, 30, PANEL_LABEL_IMAGE, panel_button_image(panel, "Quit", 0, 0), PANEL_NOTIFY_PROC, quit_proc, 0); window_main_loop(base_frame); Here, quit_proc is your function that will be called when user presses the Quit button. To build a library in FORTRAN, you need to design a general way of registering FORTRAN functions with SunView. A lot of other issues such as sharing and passing data, pointers to data etc. will have to be worked out as well. Good luck!