1
$\begingroup$

Does anyone know how to prevent the text from cutting when using a Togglerbar? I would like the text to wrap instead.

For instance:

TogglerBar[Dynamic[x], {a ->
   Text[Style[
     "a)   Early runs of the Turing test used individuals, who were \
easily fooled by the machines used.", "Roboto", 21]],
  b ->
   Text[Style[
     "b)   Turing, whose test examines machines\[CloseCurlyQuote] \
ability to behave in a way indistinguishable from human behavior, has \
a UK law named after him.", "Roboto", 21]]
  }, Appearance -> "Vertical"]

enter image description here

$\endgroup$
4
  • 1
    $\begingroup$ I see that the "b)" text gets cut inconsistently depending on the width of the window. Weird. Anyway, you can force it to a particular width by wrapping the Text inside a Panel. $\endgroup$ – Gustavo Delfino Aug 17 '20 at 12:48
  • $\begingroup$ Strange... What version & OS are you using? For me (Windows 10, Mathematica 12.1), it looks like this: imgur.com/VWQn4yL - note how the second one is wrapped for me, while the first one is broken instead $\endgroup$ – Lukas Lang Aug 17 '20 at 12:48
  • 2
    $\begingroup$ Eliminate the Text wrappers. Just use the Style. `TogglerBar[Dynamic[x], {a -> Style["a)Early runs of the Turing test used individuals, who were easily fooled by the machines used.", "Roboto", 21], ...] $\endgroup$ – Bob Hanlon Aug 17 '20 at 13:15
  • $\begingroup$ @LukasLang I'm using the same for both. It actually randomly chooses what to break. Since I have more options usually, $\endgroup$ – Tim B Aug 17 '20 at 15:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.