The Artima Developer Community
Sponsored Link

Agile Buzz Forum
Keeping a List Selected

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
Keeping a List Selected Posted: Jul 19, 2007 12:56 PM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: Keeping a List Selected
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

Often we write all kinds of code for a case we don't want to have happen. For example, a UI where a list controls what is viewed in other parts of the UI. Often, there is no real use of never having something selected. But hey, lists can have no selection, so we code our UI to deal with the null selection, showing no associated widgets (or disabling them) when nothing is selected. Wouldn't it just be easier to never let the list be deselected?

Happily this is quite easy in VisualWorks. Simply add a validation in the properties tool as such: Picture of Properties Tool

Then in your ApplicationModel, you implement that method as:


verifyStillSelected: aSequenceController

    ^aSequenceController view targetIndex ~= aSequenceController view selectionIndex

Basically, unless we're selecting something different than the current selection, we void the selection, because it would end up toggling it off.

Read: Keeping a List Selected

Topic: Meeting 15 - Dreaming in Code Previous Topic   Next Topic Topic: Facebook thoughts

Sponsored Links



Google
  Web Artima.com   

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