Re: Looking for a scrolling list control, or how to create/simulate
- To: mathgroup at smc.vnet.net
- Subject: [mg98828] Re: Looking for a scrolling list control, or how to create/simulate
- From: meitnik <meitnik at gmail.com>
- Date: Mon, 20 Apr 2009 01:32:49 -0400 (EDT)
- References: <gsbvrt$5gh$1@smc.vnet.net>
OK, here is what I have come up with so far. Any corrections or
improvements? And how do I reuse my custom control outside of the
current notebook cell? That is how do I "install" it for use in other
notebook cells? Thanks.
ListField[wd_, tz_, ls_] :=
DynamicModule[{x},
ld = 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]
- Follow-Ups:
- Re: Re: Looking for a scrolling list control, or how to
- From: Andrew Meit <meitnik@gmail.com>
- Re: Re: Looking for a scrolling list control, or how to