SunView questions

don't know mrs at philabs.philips.com
Tue May 9 05:01:05 AEST 1989


I have a number of questions with respect to SunView that I've been saving
up. I would appreciate the net's help in answering them.

1)  When I run lint on some files that use SunView's variable
    argument list, I get the following message:

    pass 2 error:(file interface.c) more than 59 args?

Q1) How do I get lint to work with long argument lists. 
    Currently I use a "#ifndef lint .. #endif" construct.

2) Whenever I use a SunView function such as
     data = (Structure *) window_get(panel, WIN_CLIENT_DATA,0);

  Lint reports an error message such as:

interface.c(153): warning: possible pointer alignment problem

Q2) How do I get lint to shut-up about such constructs.

3) I'm attempting to use "window_loop()/window_return()" functions
   to implement a blocking popup. Unfortunately, and as stated in
   the SunView manual, window_loop() will not work with subframes
   composed of more then one type of window. In my specific case I
   have a  frame that encloses a canvas and a panel subwindow. The
   frame does block; however, only the first sub-window defined is
   shown and I can't interact with the other subwindow.

Q3) Is it possible to use SunView blocking pop-ups that have more
   than one subwindow?

4) My application generates a number of pop-up panels that
   the user can display and interact with at any time.
   However, there is a practical limit to the number of
   windows that can be simultaneously open.

Q4) How does one determine if the next window_create() call
    can open a window, since window_create() never returns with
    an error status because SunView bombs internally.


5) I have a problem with the following minimal code construct:

  my_menu = menu_create(
    MENU_ITEM,	MENU_STRING,		"String1",
		MENU_ACTION_PROC,	dispatch_menu_command,
 	        MENU_CLIENT_DATA,       COMMAND_1,
		0,
    MENU_ITEM,	MENU_STRING,		"String2",
		MENU_ACTION_PROC,	dispatch_menu_command,
 	        MENU_CLIENT_DATA,       COMMAND_2,
		0,
    MENU_GEN_PROC, init_menu,
    0);


Menu init_menu(menu,op)
Menu menu;
Menu_generate op;
{
  Menu_item menu_item;

  if (op != MENU_DISPLAY)
    return(menu);

#ifdef THIS_WORKS
  menu_item = (Menu_item) menu_get(menu, MENU_NTH_ITEM, 1, 0);
#else
  menu_item = (Menu_item) menu_find(menu, MENU_CLIENT_DATA, COMMAND1, 0);
#endif

  /* 
   * code to do something with the menu_item.
   */
  return(menu);
}



Q5)	What happens is that the menu_find call also recursively calls
	the menu's generate procedure, so the program goes into an infinite 
	loop, repeatedly calling the function "init_menu".  If, as shown above,
	I "#define THIS_WORKS" the program performs as expected. However, I 
	want the menu_items to be position independent, and they will be 
	uniquely identifiable by MENU_CLINET_DATA.  Is this a feature of 
	SunView or have I missed something?



Mark R. Simpson						(914) 945-6163
Philips Laboratories					uunet!philabs!mrs
North American Philips Corporation			       or
Briarcliff Manor, NY 10510			    mrs at philabs.philips.com



More information about the Comp.sys.sun mailing list