home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!caen!uvaarpa!adastra!mbs
- From: mbs@adastra.cvl.va.us (Michael B. Smith)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: Listview selection help!
- Distribution: world
- Message-ID: <mbs.1g87@adastra.cvl.va.us>
- References: <Bob_Rye.06f0@guru.apana.org.au>
- X-NewsSoftware: GRn-beta 1.16g (10.12.92) by Michael B. Smith & Mike Schwartz
- MIME-Version: 1.0
- Content-Type: text/plain; charset=iso-8859-1
- Content-Transfer-Encoding: 8bit
- Date: 13 Dec 92 07:36:14 EDT
- Organization: Well, I haven't decided on a name yet...
- Lines: 37
-
- In article <Bob_Rye.06f0@guru.apana.org.au> Bob_Rye@guru.apana.org.au (Bob Rye) writes:
- > I have just attached a Listview gadget to a window of mine, and I would
- > like to know if it is possible for the user to:
- >
- > select an item from the list, via a mouse button click, and for the
- > selection to remain highlighted in the listview display?
- >
- > I don't need to have a readonly listview, and I don't need an editable
- > selection listview, I only need to receive which entry from the list
- > has been selected, and that the selection will remain selected, as in a
- > file requester. Any takers?
-
- On 2.04 there isn't a legal way to keep the item highlighted/selected (that I
- know of anyway).
-
- Obviously, you have the { GTLV_ShowSelected, NULL } option, which creates
- a readonly box indicating the user's option on 2.04.
-
- When the user clicks on a particular line in the listview, the application
- should receive an IDCMP_GADGETUP IntuiMessage with the index into the Listview
- List in m->Code. Thus, given the List and m->code, this routine will return
- the list entry:
-
- struct Node *FindListItem (struct List *list, int num)
- {
- struct Node *np;
-
- for (np = list->lh_Head; np->ln_Succ; np = np->ln_Succ) {
- if (!num)
- return np;
- num--;
- }
- return NULL;
- }
- --
- // Michael B. Smith
- \X/ mbs@adastra.cvl.va.us -or- uunet.uu.net!virginia.edu!adastra!mbs
-