YMSS (Yet More Sunview Strangeness)

Mike Smithwick mike at ames.arc.nasa.gov
Fri Jan 13 22:12:28 AEST 1989


["Bite me"-David Letterman]

I have a control panel of a couple of dozen buttons. Some are your normal
run-of-the-mill buttons using notifier procs. Others use event-procs, and
will display a menu when the Right mouse button is pressed, or behave as
normal buttons (image inverting) when the left button is pressed.

One button cannot have the "normal" button behaviour for the left-mouse
button. That is, it can have a menu with the right button, but I ignore
any left mouse-button events. Got that? Good, I knew you would. Now, I
decided that I should bring up the menu when EITHER the right or left
mouse buttons are pressed. So I have something like :

    if(event_action(event) == MS_RIGHT || event_action(event) == MS_LEFT)
    {
       build_the_menu();
       mi=(Menu_item) menu_show(ac_menu, pp_panel, event, 0);

       . . . do some funky stuff . . .

    }

Straightforward enough.

Trouble is, using menu_show() with this one button, and one event
(MS_LEFT) does funny things to all of the other buttons which have only a
notifier_proc(). The notifier will now cause these buttons to respond to
events generated by merely moving the arrow into the button. They will
invert, and stay inverted until I move the arrow out and back in again.
The associated notifier procs are not called however.

This behaviour can be reset by clicking on top of any one of these buttons
in the normal fashion.

It looks like some default event mask for panel items is being tinkered
with, and not being reset by the system. But why would a menu_show()
affect that to begin with??? Questions, questions. . .

I assume what the internals are doing for standard buttons is :

			>>> button thingie <<<
                                 |  (some event)
this is probably                 V 
getting messed up -> mask out all but left-mouse button events
                                 |
				 V
		if(left_mouse button is used)
		{
                   if mouse button is down, invert this dude
	           else if mouse button is up, revert to normal imagery	

                   now, call the registered notifier_proc()     
                }



-- 
			          *** mike smithwick ***



More information about the Comp.sys.sun mailing list