🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.sun
Article #10238

YMSS (Yet More Sunview Strangeness)

#10238
From: Mike Smithwick
Date: Fri, 13 Jan 1989 12:12
58 lines
2701 bytes
["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 ***
Technical Details
Message-ID: <20477@ames.arc.nasa.gov>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!lll-winken!ames!mailrus!cornell!uw-beaver!rice!sun-spots-request

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!lll-winken!ames!mailrus!cornell!uw-beaver!rice!sun-spots-request
From: mike@ames.arc.nasa.gov (Mike Smithwick)
Newsgroups: comp.sys.sun
Subject: YMSS (Yet More Sunview Strangeness)
Message-ID: <20477@ames.arc.nasa.gov>
Date: 13 Jan 89 12:12:28 GMT
Sender: usenet@rice.edu
Organization: Sun-Spots
Lines: 58
Approved: Sun-Spots@rice.edu
Original-Date: 9 Jan 89 18:50:26 GMT
X-Sun-Spots-Digest: Volume 7, Issue 101, message 2 of 19