Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!howland.reston.ans.net!ix.netcom.com!netcom.com!netcom22!johnr
From: johnr@netcom.com (John Rickenbrode)
Subject: Re: VW2.0 SelectionInList
In-Reply-To: horne02@ibm.net's message of 27 Mar 1995 23:16:14 PDT
Message-ID: <JOHNR.95Mar29165850@netcom22.netcom.com>
Sender: johnr@netcom22.netcom.com
Organization: NETCOM On-line services
References: <3l89je$1k2u@news-s01.ny.us.ibm.net>
Date: Thu, 30 Mar 1995 00:58:50 GMT
Lines: 29


In article <3l89je$1k2u@news-s01.ny.us.ibm.net> horne02@ibm.net writes:
>Using VW2.0 and Envy, I created a List widget, connected to a
>SelectionInList ValueModel.  I want the List to refresh when any
>object in the SelectionInList changes (i.e. not the list, but the 
>objects in the list).

>This works ok, but it seems like there should be a more elegant
>way of accomplishing this goal.  Any suggestions?

You can do it without changing any system code by having the list used
by the SelectionInList send a changed: #at: with: indexOfChangedObjectInList.

For example:

list := List new.
list addLast: object1.
list addLast: object2.

theSelectionInList list: list.

Now, to refresh the entry of object2:
	list changed: #at: with: 2 " (or with: (list indexOf: object2))"

Unfortunately, List won't pass along change messages from its contents.

-John Rickenbrode
johnr@netcom.com

