On Tue, 2004-10-19 at 15:53, Dave Williss wrote:
> >> It seems that each click of the mouse wheel scrolls by a whole "page".
> >> Any way to adjust that to something smaller?
> >
> > In which case exactly (which widget class) ?
> 
> XmScrolledWindow with an XmRowColumn child.

Attached is a new small example (test/Xm/scrolledwindow/test23.c).

It demonstrates (1) that scroll wheel doesn't work well when the
pointer is above the buttons, and (2) that the scrolling with the
wheel does indeed work in pages.
The latter point is rather obvious, looking at the translations
I put in for XmScrolledWindow :
    "\n<Btn4Down>:              SWUpPage()"
    "\n<Btn5Down>:              SWDownPage()"

The trouble is that XmScrolledWindow doesn't define actions to scroll
down half a page.

Does anyone have bright ideas about this ?

        Danny
-- 
Danny Backx - danny.backx-at-planetinternet.be    http://up.to/danny.backx
/* $Header: /cvsroot/lesstif/lesstif/test/Xm/scrolledwindow/test23.c,v 1.1 2004/10/19 21:58:05 dannybackx Exp $ */

#include <stdlib.h>
#include <stdio.h>

#include <Xm/Xm.h>
#include <Xm/ScrolledW.h>
#include <Xm/RowColumn.h>
#include <Xm/PushB.h>

#include "../../common/Test.h"


int
main(int argc, char **argv)
{
  Widget toplevel;
  Widget sw, rc, button;
  int i;

  XtAppContext app;

  XtSetLanguageProc(NULL, NULL, NULL);

  toplevel = XtVaAppInitialize(&app, "Label", NULL, 0, &argc, argv, NULL, NULL);

  sw  = XtVaCreateManagedWidget("sw", 
                                xmScrolledWindowWidgetClass, 
                                toplevel, 
                                XmNscrollingPolicy, XmAUTOMATIC,
                                NULL);

  rc = XtVaCreateManagedWidget("da",
                               xmRowColumnWidgetClass,
                               sw,
                               NULL);

  for (i=0; i<30; i++) {
	  char t[20];
	  sprintf(t, "button %d", i);
	  button = XtVaCreateManagedWidget(t, xmPushButtonWidgetClass, rc, NULL);
  }

  XtRealizeWidget(toplevel);
  LessTifTestMainLoop(toplevel);

  exit(0);
}

Reply via email to