🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.sys.next.programmer
3 messages
3 total messages Started by Mike Sanford Tue, 27 Oct 1992 15:36
PopUpList Question
#12
Author: Mike Sanford
Date: Tue, 27 Oct 1992 15:36
20 lines
989 bytes
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
Re: PopUpList Question
#17
Author: charlie
Date: Tue, 27 Oct 1992 21:26
37 lines
1498 bytes
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
Re: PopUpList Question
#116
Author: Gregory H. Anderson
Date: Mon, 02 Nov 1992 19:40
31 lines
1634 bytes
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.
> 

No, the item that was selected *is* removed by your method, but it gets  
put right back when you click the cover button. The docs say that if the  
title of the sender (cover button) does not exist on the PopUpList, an  
item is created automatically. I think that's what is happening here.  
You'd have to change the cover button title to one of your desired values,  
or blank it, to get the behavior you want.

--
Gregory H. Anderson          | "We're very tolerant around here,
Benevolent Dictator-for-Life |  being only amateurs ourselves."
Anderson Financial Systems   | - Tortoise (Godel, Escher, Bach)
greg@afs.com  (Nextmail OK)  | 
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads