From: lewis@KOALA.DREA.DND.CA (Lloyd Lewis)
Newsgroups: comp.windows.x.motif
Subject: Re: Composite Resources (fwd)
Date: 14 Oct 92 17:56:00 GMT
Distribution: inet
Organization: The Internet


> 
> The function takes a widget and returns a value in the range 0 to the number
> of children the parent currently has.
> 
> Sounds like your Xt needs updating.
> 

Well I followed your advice.  Everything appears to be working. However,
not quite right.  Once I at least had the new insert_position function
seemingly working I began to do a little testing to see what exactly was
going on.

Here's what I discovered.  

- composite.num_slots = 0 when the rowcol widget is created.

- once the rowcol widget was created I immediately changed its
  insert_position function.  You cannot specify the change in
  the original arguments prior to creation of the rowcol widget
  because you need to pass the address of the rowcol widget to
  the new insert_position function (chicken and the egg problem).

- the new insert_position function was immediately called by
  the application.  I had to block copy the code to other places
  where I specifically wanted the new insert_position function
  called.  (The literature says that the insert_position
  function is called before each child is inserted to determine
  its position within the widget list.  Not so, unless it is
  calling something else).

- as long as the new insert_position function returned 0, everything
  appeared to work.  Almost!  A dump of the widget list confirmed it.
  A returned value of 0 is suppose to cause the new child to be
  inserted at the start of the widget list.  But, each new child 
  was being added to the end of the widget list.

- also composite.num_slots changed from 0 to 5 as soon as the
  first child widget was added to the rowcol.  Once it was filled
  it changed from 5 to 9.  It is also noted one of the OSF manuals
  that when num_slots = num_children, Motif will allocate additional
  slots and place the new child whereever it pleases (obviously a problem
  for list insertions when num_slots is changed).

- if the new insert_position function returned anything but 0,
  the application crashes (and that includes a returned value of
  num_children  -  the book OSF manuals state the a returned value
  of num_children will cause the new child to be added to the 
  end of the widget list).


Am I missing something?


--
****************************************************************

Lloyd Lewis  BSc(CS), MSc(CS)                  271 Brownlow Ave.
Systems Development Group                      Dartmouth, N.S.
OCEANROUTES CANADA INC.                        Canada  B3B 1W6
lewis@koala.drea.dnd.ca                   tel: (902) 468-3007
                                          fax: (902) 468-3009

****************************************************************


--
****************************************************************

Lloyd Lewis  BSc(CS), MSc(CS)                  271 Brownlow Ave.
Systems Development Group                      Dartmouth, N.S.
OCEANROUTES CANADA INC.                        Canada  B3B 1W6
lewis@koala.drea.dnd.ca                   tel: (902) 468-3007
                                          fax: (902) 468-3009

****************************************************************
Newsgroups: comp.windows.x.motif