2

I'm trying to popup a window with a list of strings that I can then individually select and copy to the clipboard. Using CreateDialog I can select items formatted as a Quantity but not simple text. In the example below I can right click and copy the 1kg entry, but not the Hello text. I tried a few Copyable/Selectable options with no luck. Is there a way to make the text selectable in a CreateDialog?

CreateDialog[{"Hello", Quantity[1, "Kilograms"]}, ContentSelectable -> True, Copyable -> True, Selectable -> True];

enter image description here

DrBubbles
  • 1,391
  • 9
  • 17

1 Answers1

2

Setting the option Deployed to False seems to do the trick, someone else will have to say why though.

CreateDialog[
    {
        "Hello",
        Quantity[1, "Kilograms"],
        Style["bob", ShowStringCharacters -> True]
    },
    Deployed -> False, Selectable -> True
]

enter image description here

Jason B.
  • 68,381
  • 3
  • 139
  • 286
  • Very good! It is odd that "Quantity"s are selectable without that, even with Selectable and Copyable set to False. – DrBubbles May 09 '19 at 19:57
  • 1
    I think that is because the normal formatting for Quantity has both a tooltip and specially defined right-click behavior, and the dialog doesn't suppress that. – Jason B. May 09 '19 at 20:04