Problem with popup lists (Senders of, implementors of etc.)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem with popup lists (Senders of, implementors of etc.)

Gary Chambers-4
Hi.
 
Since the update to 12168 I am getting an MNU...
Tracked down to
 
showMenuOf: selectorCollection withFirstItem: firstItem ifChosenDo: choiceBlock withCaption: aCaption
 "Show a sorted menu of the given selectors, preceded by firstItem, and all abbreviated to 40 characters.  Use aCaption as the menu title, if it is not nil.  Evaluate choiceBlock if a message is chosen."
 
 | index menuLabels sortedList |
 sortedList := selectorCollection asSortedCollection.
 menuLabels := Array streamContents:
  [:strm | strm nextPutAll: (firstItem contractTo: 40).
  sortedList do: [:sel | strm nextPutAll: (sel contractTo: 40)]].
 index := UIManager default chooseFrom: (menuLabels substrings) lines: #(1).
 index = 1 ifTrue: [choiceBlock value: firstItem].
 index > 1 ifTrue: [choiceBlock value: (sortedList at: index - 1)]
 
The following revision seems to work ok...
 
 
showMenuOf: selectorCollection withFirstItem: firstItem ifChosenDo: choiceBlock withCaption: aCaption
 "Show a sorted menu of the given selectors, preceded by firstItem, and all abbreviated to 40 characters.  Use aCaption as the menu title, if it is not nil.  Evaluate choiceBlock if a message is chosen."
 
 | index menuLabels sortedList |
 sortedList := selectorCollection asSortedCollection.
 menuLabels := Array streamContents:
  [:strm | strm nextPut: (firstItem contractTo: 40).
  sortedList do: [:sel | strm nextPut: (sel contractTo: 40)]].
 index := UIManager default chooseFrom: menuLabels lines: #(1).
 index = 1 ifTrue: [choiceBlock value: firstItem].
 index > 1 ifTrue: [choiceBlock value: (sortedList at: index - 1)]

Regards, Gary

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Problem with popup lists (Senders of, implementors of etc.)

Henrik Sperre Johansen
<base href="x-msg://40/">This is the same issue as the previously missing method, expect a lot more to pop up.

Trouble is Monticello doesn't mark packages dirty correctly when dealing with extension category changes, so the recent Pharo-Kernel lead to alot of method removals rather than movings.

http://code.google.com/p/pharo/issues/detail?id=3060 details some of the issues with Monticello, in addition all the recategorization changes should be looked over and fixed in one sweep where removals was the outcome instead of recategorization.


Cheers,
Henry

On Oct 4, 2010, at 12:56 47PM, Gary Chambers wrote:

Hi.
 
Since the update to 12168 I am getting an MNU...
Tracked down to
 
showMenuOf: selectorCollection withFirstItem: firstItem ifChosenDo: choiceBlock withCaption: aCaption
 "Show a sorted menu of the given selectors, preceded by firstItem, and all abbreviated to 40 characters.  Use aCaption as the menu title, if it is not nil.  Evaluate choiceBlock if a message is chosen."
 
 | index menuLabels sortedList |
 sortedList := selectorCollection asSortedCollection.
 menuLabels := Array streamContents: 
  [:strm | strm nextPutAll: (firstItem contractTo: 40).
  sortedList do: [:sel | strm nextPutAll: (sel contractTo: 40)]].
 index := UIManager default chooseFrom: (menuLabels substrings) lines: #(1).
 index = 1 ifTrue: [choiceBlock value: firstItem].
 index > 1 ifTrue: [choiceBlock value: (sortedList at: index - 1)]
 
The following revision seems to work ok...
 
 
showMenuOf: selectorCollection withFirstItem: firstItem ifChosenDo: choiceBlock withCaption: aCaption
 "Show a sorted menu of the given selectors, preceded by firstItem, and all abbreviated to 40 characters.  Use aCaption as the menu title, if it is not nil.  Evaluate choiceBlock if a message is chosen."
 
 | index menuLabels sortedList |
 sortedList := selectorCollection asSortedCollection.
 menuLabels := Array streamContents: 
  [:strm | strm nextPut: (firstItem contractTo: 40).
  sortedList do: [:sel | strm nextPut: (sel contractTo: 40)]].
 index := UIManager default chooseFrom: menuLabels lines: #(1).
 index = 1 ifTrue: [choiceBlock value: firstItem].
 index > 1 ifTrue: [choiceBlock value: (sortedList at: index - 1)]

Regards, Gary
_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Problem with popup lists (Senders of, implementors of etc.)

Stéphane Ducasse
In reply to this post by Gary Chambers-4
Thanks this is my mistake....
I will integrate it now.

On Oct 4, 2010, at 12:57 PM, Gary Chambers wrote:

> Hi.
>  
> Since the update to 12168 I am getting an MNU...
> Tracked down to
>  
> showMenuOf: selectorCollection withFirstItem: firstItem ifChosenDo: choiceBlock withCaption: aCaption
>  "Show a sorted menu of the given selectors, preceded by firstItem, and all abbreviated to 40 characters.  Use aCaption as the menu title, if it is not nil.  Evaluate choiceBlock if a message is chosen."
>  
>  | index menuLabels sortedList |
>  sortedList := selectorCollection asSortedCollection.
>  menuLabels := Array streamContents:
>   [:strm | strm nextPutAll: (firstItem contractTo: 40).
>   sortedList do: [:sel | strm nextPutAll: (sel contractTo: 40)]].
>  index := UIManager default chooseFrom: (menuLabels substrings) lines: #(1).
>  index = 1 ifTrue: [choiceBlock value: firstItem].
>  index > 1 ifTrue: [choiceBlock value: (sortedList at: index - 1)]
>  
> The following revision seems to work ok...
>  
>  
> showMenuOf: selectorCollection withFirstItem: firstItem ifChosenDo: choiceBlock withCaption: aCaption
>  "Show a sorted menu of the given selectors, preceded by firstItem, and all abbreviated to 40 characters.  Use aCaption as the menu title, if it is not nil.  Evaluate choiceBlock if a message is chosen."
>  
>  | index menuLabels sortedList |
>  sortedList := selectorCollection asSortedCollection.
>  menuLabels := Array streamContents:
>   [:strm | strm nextPut: (firstItem contractTo: 40).
>   sortedList do: [:sel | strm nextPut: (sel contractTo: 40)]].
>  index := UIManager default chooseFrom: menuLabels lines: #(1).
>  index = 1 ifTrue: [choiceBlock value: firstItem].
>  index > 1 ifTrue: [choiceBlock value: (sortedList at: index - 1)]
>
> Regards, Gary
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project