[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference bulova::decw_jan-89_to_nov-90

Title:DECWINDOWS 26-JAN-89 to 29-NOV-90
Notice:See 1639.0 for VMS V5.3 kit; 2043.0 for 5.4 IFT kit
Moderator:STAR::VATNE
Created:Mon Oct 30 1989
Last Modified:Mon Dec 31 1990
Last Successful Update:Fri Jun 06 1997
Number of topics:3726
Total number of notes:19516

2709.0. "How can I trigger the scroll bar widget???" by FREZEN::PROJECTS () Thu May 03 1990 20:18

I have read the UIL programmers ref and have a Toolkit ref manual.

I have a scroll window set up in UIL and one of it's controls is set up to be a
scroll bar.

I have callbacks set up in UIL to direct execution to actual callbacks that I
set up in my C code module.

My callbacks are empty because I don't know what to do from here. 

I know that I have a callback structure and a whole bunch of callback reasons
but I can't seem to make sense out of it.

(1) How can I trigger the action of the scrollbar which should in turn trigger
    the scrolling of my scroll window?

Here is a sample callback:

static void drag_cb (w, tag, reason)
Widget w;
int *tag;
DwtScrollBarCallbackStruct reason;
{
    int argCount = 0;
    Arg arglist [20];
					/*??????????????*/
    XtSetArg (arglist [argCount], DwtNinc, reason.value);
    argCount++;
    XtSetValues (w, arglist, argCount);
}
static void pg_decrement_cb (w, tag, reason)
Widget w;
int *tag;
DwtScrollBarCallbackStruct reason;
{
    int argCount = 0;
    Arg arglist [20];
					/*???????????????*/
    XtSetArg (arglist [argCount], DwtNinc, reason.pixel);
    argCount++;
    XtSetValues (w, arglist, argCount);
}


Much Appreciated
T.RTitleUserPersonal
Name
DateLines
2709.1yours for the asking...R2ME2::OBRYANTerms of Employment. - DRBNWFri May 04 1990 00:1722
re:.0

The problem with XUI scroll_windows is that they do not provide the option
of "auto-scrolling", i.e. your program is in charge of making the "work area"
child of the scroll_window move in response to scroll_bar events.  I've written
a single, general purpose routine which can be used for all 8 callback events
on a scroll_window's scroll_bar.  The routine (called "util_scroll_work_area")
takes a scroll_bar widget id, a work_area widget id (the widget to be
scrolled), and the scroll_bar's callback data structure as arguments.  It
will determine which scroll_bar (vertical/horizontal) is making the call and
"do the right thing" to the work area.  (The routine assumes scrolling can
be achieved by simply modifying the x and y of the work_area in relation to the
scroll_window.)

The routine is located in the file:
	CLT::WIDGET$KITS:[uigltrans]dwt_uigen_utils.c

(If you wish to see how to make calls to the routine, use UIGen to generate
a dummy application containing only a scroll_window.)

Michael
2709.2FREZEN::PROJECTSMon May 07 1990 07:163

	Thanks buddy