[comp.windows.x.motif] Freezing the Scrollbar

rick@prodnet.la.locus.com (Richard Petkiewicz) (06/22/91)

-------
I need to find out if there is any way to temporarily turn off scrollbar
processing.  I have an application where it may sometimes take a while
to get the data I need to display when a scrollbar moves.  I would like
to display a "watch" cursor and halt scrollbar processing while the
application is waiting for data.

I don't want to "freeze" the whole application by waiting for the data
in the callback.

I tried to use XtSetSensitive to make the scrollbar insensitive to
input, however that does not prevent scrollbar changes due to auto-repeating.
In fact, if the mouse button was pressed in the increment or page-increment
area, turning off sensitivity will induce auto-repeating even if the
mouse button is released, because the release is never seen.

I've considered moving the scrollbar back to where I want it, but my
guess is that that approach would produce a "jittering" scrollbar
effect.

I am currently using Motif 1.0, but plan to move to Motif 1.1 in the
relatively near future.

I would appreciate any suggestions on how best to handle this situation.

nazgul@alfalfa.com (Kee Hinckley) (06/24/91)

> -------
> I need to find out if there is any way to temporarily turn off scrollbar
> processing.  I have an application where it may sometimes take a while
This sounds like a good candidate for sending an enhancement request
to OSF.  In the meantime I suspect your best bet is to unmap the scrollbar
and hope that it doesn't get to annoying.  (This appears to be what the
FileSelection Dialog does in 1.1).

BTW.  Please include a .signature in your messages.

						-kee

Alfalfa Software, Inc.          |       Poste:  The EMail for Unix
nazgul@alfalfa.com              |       Send Anything... Anywhere
617/646-7703 (voice/fax)        |       info@alfalfa.com

I'm not sure which upsets me more: that people are so unwilling to accept
responsibility for their own actions, or that they are so eager to regulate
everyone else's.

pete@ESV2.BIOSYM.COM (Pete Ware) (06/25/91)

Perhaps you should assume responsibility for the scrolling in your
application.  Let the callback accumulate any additional events until your
application catches up.  You'll need to install a callback for
valueChangedCallback.

--pete
Pete Ware / Biosym / San Diego CA / (619) 546-5532
     email: pete@biosym.com

jerryl@is.Morgan.COM (Jerry Liebelson) (06/25/91)

> 
> > -------
> > I need to find out if there is any way to temporarily turn off scrollbar
> > processing.  I have an application where it may sometimes take a while
>
> This sounds like a good candidate for sending an enhancement request
> to OSF.  In the meantime I suspect your best bet is to unmap the scrollbar
> and hope that it doesn't get to annoying.  (This appears to be what the
> FileSelection Dialog does in 1.1).
> 

Actually, we had to do something similar because we wanted to store
hidden data in each row of a XmList but not have the users be able to
scroll and see it.  The key to doing this is simple, though VERY KLUDGY:
Just get the particular scrollbar from the widget, make it insensitive
and invisible: (On monochrome SLC's this code is still missing something,
because a faint, partial outline of the scrollbar remains; but on color
displays, the scrollbar is completely invisible.)

    /* ... */

	register int i;
	Arg argList[10];
	Widget list;  /* an XmList */
	Widget listContainerWidget; /* a widget containing the XmList */
	Widget hScrollBar; 
	Pixel bg;

	/* Get the horizontal scrollbar of the XmList */
	i=0;
	XtSetArg (argList[i], XmNhorizontalScrollBar, &hScrollBar); i++;
	XtGetValues (list, argList, i);

	/* Get the background color of the widget containing the XmList */
	i=0;
	XtSetArg (argList[i], XmNbackground, &bg); i++;
	XtGetValues (listContainerWidget, argList, i);

	/* Make the scrollbar invisible */
	i=0;
	XtSetArg (argList[i], XmNsensitive, False); i++;
	XtSetArg (argList[i], XmNbackground, bg); i++;
	XtSetArg (argList[i], XmNforeground, bg); i++;
	XtSetArg (argList[i], XmNtroughColor, bg); i++;
	XtSetArg (argList[i], XmNshadowThickness, 0); i++;
	XtSetArg (argList[i], XmNhighlightThickness, 0); i++;
	XtSetArg (argList[i], XmNbottomShadowColor, bg); i++;
	XtSetArg (argList[i], XmNtopShadowColor, bg); i++;
	XtSetValues (hScrollBar, argList, i);
    /* ... */


-- 
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
|        Jerry Liebelson         |      EMAIL: jerryl@is.morgan.com          |
|      Information Systems       |             uunet!is.morgan.com!jerryl    |
|    Morgan Stanley & Co., Inc.  |             Compuserve: 73477,2740        |
|    1633 Broadway 36th Floor    |      VOICE: (212) 703-2409                |
|      New York, NY  10019       |      FAX:   (212) 703-2371                |
|                                |                                           |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~