Hot answers tagged

18

In this case I don't know how to post something helpful without providing full code so I'll just do that and hope this wasn't homework. My emphasis is on clarity (hopefully) rather than brevity or peak efficiency. flip = # /. {LightRed -> LightBlue, LightBlue -> LightRed} &; flipNeighbors[i_, j_] := (color[##] = flip @ color[##];) & @@@ ...


10

Do you mean Button[ Tooltip["click", Column[{"Click this button to select a ColorScheme.", "This button will be replaced with ColorData"}]], With[{box = EvaluationBox[]}, SelectionMove[box, All, Expression]; FrontEndExecute@ FrontEnd`AttachCell[box, FrontEndResource["ColorSchemeSelector"], {1, {Right, Top}}, {Left, Top}, "...


9

Edit Can you think of another way to accomplish the same thing [...]? It would be nice to have a solution that didn't involve duplicating each slider. -nibudd DynamicModule[{a = 1, tempA = 1, auto = True} , ifAuto = Dynamic[ If[auto, Identity, Setting]@#, TrackedSymbols :> {auto} ] &; Column[{ ifAuto @ Dynamic @ Plot[Sin[...


7

Here is a modification of Karsten's answer attempting to get the behavior you described in a comment. The selected value is assigned to Global`$color (as shown by Dynamic) I made the picker wider to get rid of the annoying bottom scroll bar Code: Button["Pick a color", Module[{picker, box = EvaluationBox[]}, picker = FrontEndResource["...


3

Here's a quick mockup of what it sounds to me like you are attempting: DynamicModule[{iTabCount, iSelectedTab, tabSlider, tabUI}, iTabCount = 5; tabSlider[_] = 0; tabUI[i_] := Column[{ Slider[Dynamic @ tabSlider[i], {-1, 1}], Dynamic @ Plot[Sin[x + tabSlider[i]], {x, -2 Pi, 2 Pi}] }]; Column[{ Dynamic @ TabView[Array[...


3

Things to keep in mind when developing complex GUI in Mathematica: Styles management/inheritance system (StyleSheets and friend) It is complicated, full of exceptions and only a tip of the iceberg is documented. Those 3 features are limiting the usage of it, which is a pity because it has a potential to give a lot. I'm also missing guidelines about common/...



Only top voted, non community-wiki answers of a minimum length are eligible