[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

3298.0. "Help !! ACCVIO with listboxes" by TENERE::SABIANI () Tue Sep 04 1990 13:27

Hello,

I have designed a tool that manages many listboxes that I fill with this 
function :

void new_listbox_items(Widget lb, char **table, int nb) {
  int i;
  DwtCompString *list_items, *list_selected;
  Arg arglist[4];

  list_items=XtCalloc((nb+1),sizeof(DwtCompString *));
  list_selected=NULL;

  for (i=0;i<nb;i++)   
    list_items[i]=DwtLatin1String(table[i]);

  XtSetArg( arglist[0], DwtNitems, list_items);
  XtSetArg( arglist[1], DwtNitemsCount, nb);
  XtSetArg( arglist[2], DwtNselectedItems, list_selected);
  XtSetArg( arglist[3], DwtNselectedItemsCount, 0);  
  XtSetValues( lb, arglist, 4);

  for (i=0;i<nb;i++) {
    XtFree(list_items[i]);
  }
  XtFree(list_items);
}

Everything is ok until I get an ACCVIO after a random amount of time. 
I have checked many times with the debugger that my string array (table) was not 
corrupted.

Does anybody have an idea or experienced the same problem ???

Thanks,
Steph.
T.RTitleUserPersonal
Name
DateLines
3298.1Yes, I have had this problem.CSC32::B_KEMPX'ed out TopFliteTue Sep 04 1990 15:094
If you are accvioing on the call to XtSetValues, I think you may need to 
call DwtListBoxDeselectAllItems.  See note 982 in HARBOR::DECWINDOWS_PROGRAMMING.

Bill
3298.2I have found MY bug.TENERE::SABIANIWed Sep 05 1990 15:181
Thanks for the very useful pointer but my data were corrupted...