MathGroup Archive 2009

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

Search the Archive

Re: Looking for a scrolling list control, or how to create/simulate


I'd give x a starting value and the ld in the beginning should be lt

ListField[wd_, tz_, ls_] :=
 DynamicModule[{x, lt}, x = ls[[1]]; lt = Length[ls];
  Framed[Pane[
     Column[Table[
       With[{i = i},
        Button[Style[ls[[i]], FontSize -> tz], Dynamic[x = ls[[i]]],
         Appearance -> "None", ImageSize -> {wd, tz + 2},
         ImageMargins -> 0, Alignment -> Left]], {i, lt}],
      Spacings -> 0],
     ImageSize -> {wd, Round[(ld*tz/2) + (ld*2) - 4]},
     ImageMargins -> {{1, 0}, {0, 0}}, Scrollbars -> {False, True},
     AppearanceElements -> None],
    FrameMargins -> {{1, 0}, {0, -1}}] Dynamic[x]]

mm = {"yes", "no", "Andrew Merit", "Marvin Honks", "Pam Bakes",
   "Marie loves", "Anne jo Ann"};
ListField[120, 14, mm]

Cheers -- Sjoerd


  • Prev by Date: Re: integrate problem
  • Next by Date: Re: representing the dihedral group {1,r,r^2...s,sr^2...}
  • Previous by thread: Re: Re: Looking for a scrolling list control, or how to
  • Next by thread: Re: Re: Looking for a scrolling list control, or how to create/simulate