0
$\begingroup$

How to create a button, which has exactly the same functionality as pressing ctlr+2 in an inputField? So it is basicly appending an sqrt sign to a string.

$\endgroup$
1
  • 3
    $\begingroup$ Um, did you try searching on your own ? Like, CreatePalette, etc ? $\endgroup$
    – Sektor
    Aug 26, 2015 at 17:36

1 Answer 1

2
$\begingroup$
CreatePalette[{"Square root",PasteButton[Sqrt@\[SelectionPlaceholder]]}]
$\endgroup$
2
  • $\begingroup$ Can't just ignore simplicity and readability; +1 $\endgroup$
    – Sektor
    Aug 26, 2015 at 17:49
  • $\begingroup$ In a .nb notebook, it opens a new notebook for the palette everytime i run it, and if I try to close this palette, it asks me if i want to save it or not. ...strange $\endgroup$
    – ricsirke
    Aug 26, 2015 at 17:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.