[comp.sys.amiga.tech] PopUpMenu

d5adria@dtek.chalmers.se. (Martin Adrian) (11/22/89)

My new popupmenu program is almost ready for release.
New features include:
  Now uses SwapBitsRastPortClipRect. (that means speed)
  The delay before opening item & subitem windows is removed.
  Multiple select is supported. (but not drag-select)
  MENUVERIFY is supported.
  Semaphores is used to prevent other tasks from changing the displyed menues.

But there is one bug left.

Sometimes the input.device stops and it is impossible to do anything.
I think intuition tries to do an ActivateWindow or something on the Locked
screen and then stops.
Does intuition do things like that in it's inputhandler???
If i remove the LockLayers out of my code, the menues work alright but they are
overwritten by windows borders.

Whats really happening is:
  I have to screens open.  The workbench and one custom.
  The custom screen is half the way down.
  My testprogram on the workbench screen looks like this:

 FOREVER { 
    Wait(1L << MyWindow->UserPort.mp_SigBit);
    Message = GetMsg(MyWindow->UserPort);
    if (Message->Class == MENUVERIFY)
      WorkbenchToFront();
    ReplyMsg(Message);
  }

  When i press the menubutton in my testprogram window the 
  workbench comes to the front and the inputhandler stops.
  Xoper tells me that the input.device is waiting for a signal
  0x00000040.

Can anyone out there help me with this problem.

Martin Adrian.

jimm@amiga.UUCP (Jim Mackraz) (11/25/89)

In article <1751@mathrt0.math.chalmers.se> d5adria@dtek.chalmers.se (Martin Adrian) writes:
)My new popupmenu program is almost ready for release.

)But there is one bug left.

)  When i press the menubutton in my testprogram window the 
)  workbench comes to the front and the inputhandler stops.
)  Xoper tells me that the input.device is waiting for a signal
)  0x00000040.

This is the semaphore signal, you are in a deadly embrace.
Intuition will commit to getting a semaphore in the input handler,
from time to time, and this has to be carefully integrated with
other progams who would like to lock layers.

As you note, the alternative to arbitration is collision and garbage.

Sorting all this out is the Hard Part of a multi-tasking system like
Intuition.  It barely manages to avoid deadly embrace on itself,
and has some failures when Workbench locks layers for icon dragging.

)Can anyone out there help me with this problem.

While I applaud your work, I contend that there is no support for
glueing on something like SwapBits menus externally.  Perhaps that
will change, but there are other matters to attend to.

)Martin Adrian.

	jimm
-- 
--------------------------------------------------	- opinions by me
"This voice console is a *must*.  I press Execute. 
 `Hello, I know that you've been feeling tired.
  I bring you love and deeper understanding.' "		-lyrics by Kate Bush