🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.next.programmer
Article #54

Re: PopUpList Question

#54
From: Mike Sanford
Date: Thu, 29 Oct 1992 15:00
71 lines
2961 bytes
In article <1992Oct28.165110.4483@fnbc.com> drew@fnbc.com (Drew Davidson)  
writes:
> In article <7584@transfer.stratus.com> charlie@snowflake.az.stratus.com  
writes:
> > In article <1992Oct27.153629.16802@pencom.com> msanford@finn  
> > (Mike Sanford) writes:
> > > 
> > > This is the deal.  I want to remove the items from a popuplist  
> > and put in  
> > > new items. The following method does not work correctly.
> > > 
> > > - deleteAllItems:aPopUpList
> > > {
> > > 	while ([aPopUpList count])
> > > 		[aPopUpList removeItemAt:0];
> > > 	return self;
> > > }
> > > 
> > > Execution does leave the method making me think that  
> > aPopUpList is empty,  
> > > however, the item that is selected when this methods is  
> > invoked is not  
> > > removed.
> > > 
> > > I guess I could programmatically (yuk!) create a new popUpList  
> > and replace  
> > > the old one, but that still doesn't answer my question about  
> > why my method  
> > > doesn't work correctly.
> > > 
> > > - Mike
> > 
> > I have exactly that code in one of my apps and it works
> > correctly. Are you sure that aPopUpList is not nil?
> > 
> > --
> > Charles Spitzer
> > charlie@snowflake.az.stratus.com
> > Telecom Customer Assistance Center
> > Stratus Computer, Inc.
> > Phoenix, AZ  85018
> 
> The docs state that if an item in the PopUpList does not exist that has  
the  
> same title as the title of the Button that called it, the PopUpList will  
add  
> the title to itself.  That's what's happening - you are really removing  
> everything from the PopUpList, but when you click on it again it is  
inserting  
> the title of the Button into the PopUpList.
> --
>  
+--------------------------------+---------------------------------------- 
---+
> |        Drew  Davidson          | "Never ask a programmer if he'll have      
|
> |         Software Guy           |  another cup of coffee because it's        
|
> | First National Bank of Chicago |  nobody's damn business how much he's      
|
> |     drew@fnbc.com  (NeXTmail)  |  already had!"       - me                  
|
>  
+--------------------------------+---------------------------------------- 
---+

However, I am inserting other items in the PopUpList before the user  
clicks on the PopUpList.  Are you saying I need to programmatically select  
one of the new items in the PopUpList after inserting these items??

- Mike
Technical Details
Message-ID: <1992Oct29.150029.27240@pencom.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!kithrup!hoptoad!pacbell.com!iggy.GW.Vitalink.COM!cs.widener.edu!eff!sol.ctr.columbia.edu!zaphod.mps.ohio-state.edu!swrinde!news.dell.com!uudell!pensoft!usenet
References: <1992Oct28.165110.4483@fnbc.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!kithrup!hoptoad!pacbell.com!iggy.GW.Vitalink.COM!cs.widener.edu!eff!sol.ctr.columbia.edu!zaphod.mps.ohio-state.edu!swrinde!news.dell.com!uudell!pensoft!usenet
From: msanford@starfish (Mike Sanford)
Newsgroups: comp.sys.next.programmer
Subject: Re: PopUpList Question
Message-ID: <1992Oct29.150029.27240@pencom.com>
Date: 29 Oct 92 15:00:29 GMT
References: <1992Oct28.165110.4483@fnbc.com>
Sender: usenet@pencom.com (Usenet Pseudo User)
Organization: Pencom Software
Lines: 71