Sunview programming questions

D Venkatrangan matrix!venkat at uunet.uu.net
Tue Jun 5 02:04:52 AEST 1990


In article <8288 at brazos.Rice.edu> peters at 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!



More information about the Comp.sys.sun mailing list