[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

1425.0. "accvio when scrolling in list box widget" by CSC32::B_BRADACH () Tue Sep 12 1989 16:36

    I have a customer who is using a list box, allowshellresize is set on
    the top level widget, DwtNshownValuAutomaticVert is set on the list box
    to enable scrolling of the veritcal scroll bar.  If the visible items
    count is set to the maximum number set in the list and a resize is
    performed on the window, the slider shows that there are scrollable
    items, however, if you attempt to scroll you get an access violation.
    
    This code was tested out on ULTRIX 3.1 -- everything works just fine.
    Copied the code to VMS 5.1 sdc decwindows -- it results in access
    violation.  Also copied it to a field test version of vms5.3 and V2
    decwindows and I get an access violation.  
    
    This note is cross posted in decwindows_programming 54.3.
    A copy of the c and uil files follows in the first and second reply.
    
    If anyone has any ideas on what is going on they would be greatly
    appreciated.  Is this a bug in the list box widget?  Any information or
    ideas would be greatly appreciated.
    
    bernie
    csc/cs
    

T.RTitleUserPersonal
Name
DateLines
1425.1c source fileCSC32::B_BRADACHTue Sep 12 1989 16:3771
#include <stdio.h>
#include <decw$include/DECwDwtApplProg.h>
#include <decw$include/DwtAppl.h>
#include <decw$include/Vendor.h>
#include <decw$include/Intrinsic.h>
static DRMHierarchy	s_DRMHierarchy;		/* DRM database hierarch id */
static char		*vec[]={"list.uid"};
						/* DRM database file list   */
Display *display;	/* display pointer */
static DRMCode		class ;

    Widget toplevel, helloworldmain, list; 
/*
 *  Main program
 */
int main(argc, argv)
    unsigned int argc;
    char **argv;
{
    Arg arglist[10] ;
    int n = 0;
	if (! (display = XOpenDisplay(NULL)))
		{
		fprintf (stderr, "Can't open display\n");
		}

    DwtInitializeDRM ();
    toplevel = XtInitialize(
	"Hi",	 			/* application name */
	"helloworldclass",              /* application class */
	NULL, 0,                        /* options */
	&argc, argv);                   /* command line parameters */

    XtSetArg (arglist[n], DwtNx, 50) ; n++;
    XtSetArg (arglist[n], DwtNy, 50) ; n++;
    XtSetArg (arglist[n], XtNallowShellResize, True) ; n++;
    
    
    XtSetValues (toplevel, arglist, n) ;

    if (DwtOpenHierarchy (1,			    /* number of files	    */
			vec, 			    /* files     	    */
			NULL,			    /* os_ext_list (null)   */
			&s_DRMHierarchy)	    /* ptr to returned id   */
			!= DRMSuccess) {
	printf ("can't open hierarchy");
     }

    if (DwtFetchWidget (s_DRMHierarchy,
			"helloworld_main",
			toplevel,
			&helloworldmain,
			&class)
			!= DRMSuccess)
			    printf("can't fetch interface");

    list = XtNameToWidget (helloworldmain, "helloworld_main.helloworld_list");

    n=0;
    XtSetArg (arglist[n], DwtNshownValueAutomaticVert, True) ; n++;
    XtSetValues (list, arglist, n) ;

    XtManageChild(helloworldmain);
    XtRealizeWidget(toplevel);

    /* Get the widget id's to install the accelerator */
    XtMainLoop();

}
    

1425.2uil fileCSC32::B_BRADACHTue Sep 12 1989 16:3840
module helloworld
    version = 'v1.0'
    names = case_sensitive

include file 'decw$include:DECwDwtApplProg.uil';
value
            list_text           :
            string_table ('Apple Juice', 'Orange Juice', 'Grape Juice',
                                  'Cola', 'Punch','Root beer', 'Water',
                                  'Ginger Ale', 'Milk', 'Coffee');
            list_select         : 
                     string_table('Apple Juice','Orange Juice');

object
    helloworld_main : main_window {
	arguments { 
	    x=50;
            y=50;
	    width=0;
	   height=0;
	};
	controls {
	    list_box	helloworld_list;
	};
    };

object
    helloworld_list : list_box {
	arguments {
		x = 5;
		y = 25;
                visible_items_count=10;
                items = list_text;
                single_selection = true;
		};
    };

end module;