The Artima Developer Community
Sponsored Link

Agile Buzz Forum
Handy A Couple of Hours Later

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
James Robertson

Posts: 29924
Nickname: jarober61
Registered: Jun, 2003

David Buck, Smalltalker at large
Handy A Couple of Hours Later Posted: Jul 20, 2007 6:58 PM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: Handy A Couple of Hours Later
Feed Title: Travis Griggs - Blog
Feed URL: http://www.cincomsmalltalk.com/rssBlog/travis-rss.xml
Feed Description: This TAG Line is Extra
Latest Agile Buzz Posts
Latest Agile Buzz Posts by James Robertson
Latest Posts From Travis Griggs - Blog

Advertisement

It wasn't a couple of hours before I ended up using a similar technique as yesterday's post. In this case, it was a multi selection list. Multiple selections were allowed, but some combinations were not allowed. I used the notification property (rather than the verification) and put together a method like this:


clearOtherVersions: aController

	| targetPackage cleanedSelections |

	targetPackage := packagesList list at: aController view targetIndex.

	cleanedSelections := packagesList selections

		reject: [:each | each name = targetPackage name and: [each ~~ targetPackage]].

	packagesList selections: cleanedSelections

Basically, we find what element was just selected, and then reject any other like elements of different versions from the current selection set.

Read: Handy A Couple of Hours Later

Topic: Taking the A-Listers to Task Previous Topic   Next Topic Topic: Smalltalk Daily 7/18/07: More on File Dialogs

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use