[comp.windows.x.motif] XmListDeleteItemsPos bug??

jhc@ivan.uucp (05/03/91)

I am experiencing occasional crashes in XmListDeleteItemsPos.  Is there
a known bug in this function?  If so, is there a recommended work
around?  I already use the workaround for XmListDeleteAllItems:

	XtSetArg(wargs[0],XmNitemCount,0);
	XtSetArg(wargs[1],XmNitems,NULL);
	XtSetValues(list,wargs,2);

To delete a subset of the list, should I just regenerate the entire
list?

Thanks.  --Jim

klee@wsl.dec.com (Ken Lee) (05/03/91)

In article <54456@inkwell.UUCP>, jhc@ivan.uucp writes:
|> I am experiencing occasional crashes in XmListDeleteItemsPos.

I had alot of trouble with deleting list items in Motif 1.1, especially
if the items were selected or were not visible (e.g., scrolled off the
screen).  All these bugs seem to be fixed in Motif 1.1.1.  If you can't
upgrade to 1.1.1, you might try deselecting and/or scrolling your list
before deleting items.

-- 
Ken Lee
DEC Western Software Laboratory, Palo Alto, Calif.
Internet: klee@wsl.dec.com
uucp: uunet!decwrl!klee

jh@ist.CO.UK (Jeremy Huxtable) (05/07/91)

From article <54456@inkwell.UUCP>, by jhc@ivan.uucp:
> I am experiencing occasional crashes in XmListDeleteItemsPos.  Is there
> a known bug in this function?

One bug, though possibly the one you are looking for is that when the bottom
element of the list is visible and you call XmListDeleteXXX, the List
widget gets its display one line out of whack with where it thinks it is.
To get round this, we had to resort to horrible manipulations using
XmListSetBottomPos and so on. I think the same problem applies to
XmListAddItemXXX.

...and another thing... why isn't there an XmList routine to just make the
current selection visible? You can make the selection the top or bottom
item, but not just make sure that it is visible....

...and another thing... why can't I have a list of things other than strings,
such as icons, mixtures of text and pictures etc?

...and another thing, why can't I have a multi-column list? Having programmed
the Macintosh, I am amazed how difficult it is to do things under Motif which
are trivial in the Mac environment. Were the widgets designed by committee?

...shall I mention XmRowColumn? I think not.

jason@cs.odu.edu (Jason "dedos" Austin) (05/09/91)

In article <2899@istop.ist.CO.UK> jh@ist.CO.UK (Jeremy Huxtable) writes:
-> From article <54456@inkwell.UUCP>, by jhc@ivan.uucp:
-> > I am experiencing occasional crashes in XmListDeleteItemsPos.  Is there
-> > a known bug in this function?
-> 
-> One bug, though possibly the one you are looking for is that when the bottom
-> element of the list is visible and you call XmListDeleteXXX, the List
-> widget gets its display one line out of whack with where it thinks it is.
-> To get round this, we had to resort to horrible manipulations using
-> XmListSetBottomPos and so on. I think the same problem applies to
-> XmListAddItemXXX.

	These calls gave me trouble for quite a while, so I finally
decided to stop using them.  Instead, just use XtSetValues to set
items to a pointer to an array of compound strings and itemCount to
the number of items in the array.

-> 
-> ...and another thing... why isn't there an XmList routine to just make the
-> current selection visible? You can make the selection the top or bottom
-> item, but not just make sure that it is visible....

	What's visible and what's not it determined by the scrollBar
widget and not the list widget.  It wouldn't be too hard to write a
routine to get the scrollbar position, an item's position, and figure
out if that item is visible.  Don't limit yourself to the motif
convenience functions or there will be a lot of things you won't be
able to do.

	
-> ...and another thing... why can't I have a list of things other than strings,
-> such as icons, mixtures of text and pictures etc?
-> 
-> ...and another thing, why can't I have a multi-column list? Having programmed
-> the Macintosh, I am amazed how difficult it is to do things under Motif which
-> are trivial in the Mac environment. Were the widgets designed by committee?
-> 
-> ...shall I mention XmRowColumn? I think not.

	The nice thing about X is that it's expandable.  You can
easily create new widgets by adding to existing ones.  No one could
possibly come up with a widget set for all situations, so it's left
open to the programmers to expand as they see fit.
--
Jason C. Austin
jason@cs.odu.edu

jfr@locus.com (Jon Rosen) (05/10/91)

In article <JASON.91May8110001@sarasvathi.cs.odu.edu> jason@cs.odu.edu (Jason "dedos" Austin) writes:
>
>	The nice thing about X is that it's expandable.  You can
>easily create new widgets by adding to existing ones.  No one could
>possibly come up with a widget set for all situations, so it's left
>open to the programmers to expand as they see fit.

Good point, but it is NOT SIMPLE TO DO and the Motif toolkit is abysmal...
The previous author's post indicated some valid concerns about missing
widget functionality, similar to some that I have posted here (multi-
column lists, highlighting (not selecting) items in lists, etc)...
 
The Macintosh came out in 1984 (and the Lisa a year before that) and
had many features and some missing ones... That is NOT startling since
the Mac was really the first widely used GUI-based product... Since
then, the Mac has made many new features available, including the ones
named above and others... These were mostly known by early 1987 when
the Motif effort actually started... Therefore, it is hard to believe
that the OSF group did not attempt to incorporate as many of these
features as possible into Motif... Certainly Motif made some strides
in different areas.... The form widget, particularly, is a major
stride given that it removes the need for a programmer to deal with
constant resizing of subordinate objects when a window is resized...
This has always been a gripe I have had about Mac (and early Windows..
I do not know if Windows 3.0 solved this problem)... But stil,
multi-column lists is obvious... and not hard to implement from a
systems perpspective... But if I am an application programmer, it
may be WAY beyond my abilities to do that... I just want the tools
to do my job...
 
Jon Rosen

jason@cs.odu.edu (Jason "dedos" Austin) (05/11/91)

In article <24232@oolong.la.locus.com> jfr@locus.com (Jon Rosen) writes:
-> In article <JASON.91May8110001@sarasvathi.cs.odu.edu> jason@cs.odu.edu (Jason "dedos" Austin) writes:
-> >
-> >	The nice thing about X is that it's expandable.  You can
-> >easily create new widgets by adding to existing ones.  No one could
-> >possibly come up with a widget set for all situations, so it's left
-> >open to the programmers to expand as they see fit.
-> 
-> Good point, but it is NOT SIMPLE TO DO and the Motif toolkit is abysmal...
-> The previous author's post indicated some valid concerns about missing
-> widget functionality, similar to some that I have posted here (multi-
-> column lists, highlighting (not selecting) items in lists, etc)...
->  
-> The Macintosh came out in 1984 (and the Lisa a year before that) and
-> had many features and some missing ones... That is NOT startling since
-> the Mac was really the first widely used GUI-based product... Since
-> then, the Mac has made many new features available, including the ones
-> named above and others... These were mostly known by early 1987 when
-> the Motif effort actually started... Therefore, it is hard to believe
-> that the OSF group did not attempt to incorporate as many of these
-> features as possible into Motif... Certainly Motif made some strides
-> in different areas.... The form widget, particularly, is a major
-> stride given that it removes the need for a programmer to deal with
-> constant resizing of subordinate objects when a window is resized...
-> This has always been a gripe I have had about Mac (and early Windows..
-> I do not know if Windows 3.0 solved this problem)... But stil,
-> multi-column lists is obvious... and not hard to implement from a
-> systems perpspective... But if I am an application programmer, it
-> may be WAY beyond my abilities to do that... I just want the tools
-> to do my job...
->  
-> Jon Rosen

	There's not need to limit yourself to motif (or Xt for that
matter).  If a particular Widget set doesn't apply itself well to your
application, use another. (Of course, there's always the limitation of
management, but that's not a fault of the system) I have never seen a
completely generic high level user interface, and motif is no
exception.  I never meant to say expanding the widget set was simple,
but it easy in the sense that the system was designed with expansion
in mind, and extensive knowledge of the implementation and hacking is
not necessary.
 --
Jason C. Austin
jason@cs.odu.edu