New answers tagged

1

Suppress formatting errors by setting the necessary options for the actual notebook or for the front-end: SetOptions[EvaluationNotebook[], AutoStyleOptions -> { "FormattingErrorStyle" -> {FontColor -> RGBColor[1., 0.33, 0.33], Background -> RGBColor[1., 0.33, 0.33, 0.15]}, "FormattingErrorTooltips" -> False, "...


6

A modification of the answer provided by Kuba that uses an AttachedCell to give the hint: Button[ "Show hint", With[{box = EvaluationBox[]}, SelectionMove[box, All, Expression]; FrontEndExecute@FrontEnd`AttachCell[box, Cell[BoxData[GridBox[ { {Cell["You can plot a function using:", "Text"]}, {Cell[BoxData["Plot[Sin[x],{x,0,1}...


7

How about FlipView: FlipView[{ Button@"Show hint", Column[{ TextCell[ "You can plot a function using:", "Notebook", "Text" ], ExpressionCell[ Defer@Plot[Sin[x], {x, 0, 1}], "Notebook", "Input" ] }] }] alternatively, born from comments under Karsten's answer: FlipView[{ Button["Show hint"], Tooltip[ ...


1

TabView[{"Question" -> "What is a guppy?", "Hint" -> "Think about fish", "Answer" -> InputField["", String, FieldHint -> "Enter your answer"]}] or MenuView[{"Question" -> "What is a guppy?", "Hint" -> "Think about fish", "Answer" -> InputField["", String, FieldHint -> "Enter your answer"]}]


8

You can overwrite specific NotebookEventActions which are responsible for that: CreateDialog[ Overlay[{DefaultButton[], CancelButton[], InputField[]}, {3}, 3], NotebookEventActions -> { "EscapeKeyDown" :> {}, "ReturnKeyDown" :> {}, PassEventsDown -> True } ] PassEventsDown -> True allows "\[AliasDelimiter]" to appear in the ...


10

You are almost there but Graphs are not mutable so: DynamicModule[{graph}, Dynamic[graph] , Initialization :> ( graph = Graph[ {1 -> 3, 2 -> 3, 3 -> 6, 4 -> 6, 1 -> 5, 5 -> 4, 6 -> 2}, VertexLabels -> "Name", VertexShapeFunction -> ( EventHandler[ Disk[#1, .1], "MouseClicked" :> (graph = ...


12

I would suggest using the second argument of Dynamic: DynamicModule[{shape = Disk[], targets = RandomPoint[Disk[], 10]}, Panel@Column@{ Item[ RadioButtonBar[Dynamic[ shape, (targets = RandomPoint[#, 10]; shape = #) & ], {Disk[] -> "Disk", Rectangle[] -> "Rectangle"}], Alignment -> Center ], Dynamic@...


3

You can use DynamicWrapper or the second argument of Dynamic to take an action after something is done. Additionaly let me reshape your dataset to association form: <|name1->activities1,...|> CreateWindow[ DialogNotebook[ DynamicModule[ {name, activity, fauxDB, dbRow} , fauxDB = { <|"name" -> "Bill", "activities" -> {"...



Top 50 recent answers are included