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

MathGroup Archive 2009

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

Search the Archive

Looking for a custom control example that support dynamic arguments

  • To: mathgroup at smc.vnet.net
  • Subject: [mg98934] Looking for a custom control example that support dynamic arguments
  • From: meitnik <meitnik at gmail.com>
  • Date: Wed, 22 Apr 2009 05:11:14 -0400 (EDT)

I want to learn how to support dynamic arguments for dynamic modules.
Any sample code or where I should read on doing this? I would like to
do the same kind of stuff as am able to do wth PopupMenu as shown
below but with my LIstField code. Thanks

Lists = {"Lists", "Elements"};
ListsMenu = {{Nice, Table, Chair}, {Part, Spin, First}};

gt[e_, f_, h_] := Flatten[h[[Flatten[Position[f, e]]]]]

ob[Ls_, LsM_] := DynamicModule[
  {x, y},
  PopupMenu[Dynamic[x], Ls]
   Dynamic[y = gt[x, Ls, LsM][[1]];
    PopupMenu[Dynamic[y], gt[x, Ls, LsM]]]
  ]

ob[Lists, ListsMenu]


  • Prev by Date: pure function with optional number of arguments
  • Next by Date: Using the slider values in a Manipulate
  • Previous by thread: Re: pure function with optional number of arguments
  • Next by thread: Using the slider values in a Manipulate