TransWikia.com

Why the horizontalgauge can not be directly added to the control part of manipulate[]?

Mathematica Asked by DORA on November 25, 2020

I try to use horizontalgauge in Manipulate as following:

    Manipulate[
 Graphics[Disk[]],
 HorizontalGauge[Dynamic[x], {0, 100}]
 ]

but it didn’t work, but if I wrap the gauge with Row[] then it works, can anyone explain why it works like this?

    Manipulate[
 Graphics[Disk[]],
 Row@{HorizontalGauge[Dynamic[x], {0, 100}]}
 ]

One Answer

In Manipulate >> Details and Options allowed forms of the second argument are listed:

enter image description here

So HorizontalGauge[Dynamic[x], {0,10}] (or, for that matter, Slider[Dynamic[x], {0, 10}] or Checkbox[Dynamic[z]] or InputField[Dynamic[w]] etc.) is not allowed in the second (or later) argument.

The highlighted row of the list is elaborated on as

enter image description here

So using Row @ {HorizontalGauge[...], Style @ HorizontalGauge[...], Text @ HorizontalGauge[...] etc. do work.

Correct answer by kglr on November 25, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP