MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Manually culling a list

  • To: mathgroup at smc.vnet.net
  • Subject: [mg115124] Re: Manually culling a list
  • From: Armand Tamzarian <mike.honeychurch at gmail.com>
  • Date: Sat, 1 Jan 2011 04:24:28 -0500 (EST)
  • References: <ifhi9c$i2o$1@smc.vnet.net>

On Dec 30 2010, 8:10 pm, ntg <ntgl... at gmail.com> wrote:
> Hello guys,
>
> Suppose I have a longish list of items that I want to manually cull.
> It seems I should be able to do something like
>
> checkList = ({Checkbox[], #)& /@ list
>
> Then, I could write
>
> instanceOfCheckList = checkList
>
> check away, and hopefully see something like
>
> {{True, item1}, {False, item2}, ...}
>
> which I could manipulate. But all I see is the the list of "checked"
> checkboxs and items, not the consequence of checking the boxes. I can
> do a FullForm on instanceOfCheckList and extract what I need via list
> surgery-- but that is inelegant. I'm sure there is some magic
> incantation involving Evaluate or Interpretation or Dynamic. Can you
> help?
>
> Thanks,
> Tom


It looks to me like CheckboxBar is what you need.

CheckboxBar[Dynamic[x], list]

then make your manual selections, then to recover your selections:

list[[x]]

Note that on a Mac CheckboxBar has a formatting issue when you display
it vertically (WRI tech support have logged this bug) the labels, if
you have word labels, do no align very well with the check box.

Mike


  • Prev by Date: Thread vs MapThread with Compiled functions
  • Next by Date: Re: Default Lighting for Graphics3D
  • Previous by thread: Re: Thread vs MapThread with Compiled functions
  • Next by thread: Re: Manually culling a list