Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

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

Search the Archive

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

  • To: mathgroup at smc.vnet.net
  • Subject: [mg98882] Re: Looking for a scrolling list control, or how to create/simulate
  • From: "Sjoerd C. de Vries" <sjoerd.c.devries at gmail.com>
  • Date: Mon, 20 Apr 2009 19:13:36 -0400 (EDT)
  • References: <gsbvrt$5gh$1@smc.vnet.net> <gsh1al$ri$1@smc.vnet.net>

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