[comp.windows.x.motif] Troubles with menu bars

phil@hpsmdca.HP.COM (Philip Walden) (04/04/91)

I have a menu bar cascade button that invokes a somewhat lengthy
graphics re-paint.  The problem is that the menu bar being "modal" locks
out or "redirects" all other window input until the the processing in
the button callback is complete.  Thus while my graphics is painting,
the whole server is useless.

What is the best method to circumvent this problem?  I tried to use
XtRemoveGrab, but I could not find a "widget" to use it on.  I could put
the repaint in a different (user) callback, but how do I get motif to
execute a user-generated callback?

--------------------------------------------------------------------------
Philip Walden
Hewlett Packard
Product Generation Processes Lab
Integrated Product Engineering Systems
3155 Porter Drive, M/S 28AQ
Palo Alto, CA 94304-1213
(415) 857-3899 FAX (415) 857-7499
--------------------------------------------------------------------------

tsang@ISI.COM (Kam C. Tsang) (04/09/91)

> I have a menu bar cascade button that invokes a somewhat lengthy
> graphics re-paint.  The problem is that the menu bar being "modal" locks
> out or "redirects" all other window input until the the processing in
> the button callback is complete.  Thus while my graphics is painting,
> the whole server is useless.

Seems like you're saying that the buttons that make up the items in
your menu pane are cascade buttons.  Try using normal push buttons
instead.

-kam

     ----------------------------+-----------------------------
                      Kam Tsang  |  User Interface Group
           (408) 980-1500 x 275  |  Integrated Systems, Inc.
           (408) 980-0400 [Fax]  |  2500 Mission College Blvd.
                  tsang@isi.com  |  Santa Clara, CA  94054
     ----------------------------+-----------------------------

roger@zuken.co.jp (Roger Meunier) (04/09/91)

In article <173780001@hpsmdca.HP.COM> phil@hpsmdca.HP.COM (Philip Walden) writes:

 > I have a menu bar cascade button that invokes a somewhat lengthy
 > graphics re-paint.  The problem is that the menu bar being "modal" locks
 > out or "redirects" all other window input until the the processing in
 > the button callback is complete.

I had a similar problem: trying to use a debugger within a routine
called from a pulldown menu.  I added a XmNactivateCallback
to the CascadeButton, and put the following code in the callback:

	Display*	display;
	display = XtDisplay(widget);
	XUngrabPointer(display,CurrentTime);
	XUngrabKeyboard(display,CurrentTime);

This disabled the grab and let me get some useful work done.

Hope this helps.
--
Roger Meunier @ Zuken, Inc.  Yokohama, Japan	(roger@zuken.co.jp)