Path: news.daimi.aau.dk!news.net.uni-c.dk!sunsite.auc.dk!newsfeed1.uni2.dk!newsfeed1.swip.net!swipnet!rill.news.pipex.net!pipex!newsfeed.nacamar.de!news-kar1.dfn.de!news-fra1.dfn.de!Uni-Dortmund.DE!brain.hrz.uni-dortmund.de!volkher From: Volkher Kaschlun Newsgroups: comp.lang.beta Subject: Re: Problems with motif/list/itempos Date: Sun, 27 Sep 1998 02:50:17 +0200 Organization: University of Dortmund, Germany Lines: 76 Message-ID: References: <360BEF6D.7FA8FF1F@nef.wh.uni-dortmund.de> Reply-To: su0056@studserver.uni-dortmund.de NNTP-Posting-Host: stud-171.hrz.uni-dortmund.de Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Sender: volkher@brain.hrz.uni-dortmund.de To: Mjolner Support , Arne Hueggenberg In-Reply-To: <360BEF6D.7FA8FF1F@nef.wh.uni-dortmund.de> Xref: news.daimi.aau.dk comp.lang.beta:11717 On Fri, 25 Sep 1998, Arne Hueggenberg wrote: > Hello everyone, > > Im looking for help with a slight problem i have. > > Inside my app i do something like this: > > List: @ScrolledList > (# > defaultActionCallback:: > (# item: @motifstring; posofitem: @integer; > do > data.item->item; > item->itempos->posofitem; > posofitem->putint; > posofitem->Mailhandler.getentry->editor.value; > #); > init:: > ...; > #); > > The problem now is that no matter wich listentry i doubleclick, > resulting in the defaultactioncallback, posofitem always is 0. > Looking at what itempos is doing i see that it calls XmListItemPos. > Now, looking in my ORA Motif Programming Manual, i see that > XmListItemPos returns 0 if it didnt find the item in the list. > Why cant it find the item? > As I look for an item wich i very well know to be there, i selected it > from the list after all, i dont see how this is possible. > > Can anyone help me with this? > > Regards, > Arne Hueggenberg Hello! itemPos do not get the result from XmListItemPos, and so the value is 0 (also in itemExists). When you look at the do-part of itemPos you see (# do (thewidget,item)->XmListItemPos #). but it has to be (# do (thewidget,item)->XmListItemPos->value #) You can call XmListItemPos direct and it works fine List: @ScrolledList (# defaultActionCallback:: (# item: ^motifstring; posofitem: @integer; do &motifstring[]->item[]; &motifstring[]->item2[]; data.item->item; item.getText->putText; (* item->itempos->posofitem; *) (thewidget,item)->XmListItemPos->posofitem; posofitem->Mailhandler.getentry->editor.value; posofitem->putint; newline; itemcount->putInt; newline; #); #) regards Volkher Kaschlun e-mail: su0056@studserver.uni-dortmund.de (kaschl00@marvin.informatik.uni-dortmund.de) (volkher@free.de) (volkher@writeme.com) Home-Page: http://studserver.uni-dortmund.de/~su0056