This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

PasteButton

PasteButton[expr]
represents a button that pastes expr whenever it is pressed.
PasteButton
displays with label on the button.
  • expr is by default pasted at the current insertion point in your input notebook.
  • PasteButton evaluates its arguments in an ordinary way, so that expr is immediately evaluated.
  • PasteButton[Defer[expr]] creates a button which pastes the unevaluated form of expr.
  • If expr contains a selection placeholder, it will be replaced by your current selection when the paste is done.
  • label can be any expression.
Create a button that will paste its contents:
Supply a different label:
Create a button to paste an unevaluated expression:
Create a button that will paste its contents:
In[1]:=
Click for copyable input
Out[1]=
 
Supply a different label:
In[1]:=
Click for copyable input
Out[1]=
 
Create a button to paste an unevaluated expression:
In[1]:=
Click for copyable input
Out[1]=
Use any expression as a label:
Paste the result of an evaluation:
Paste a graphics object:
Different predefined alignment options:
Default and appearance:
Change the background colors:
Align with the surrounding text:
By default PasteButton is enabled:
By setting Enabled->False, the button is disabled but visible in its current state:
By default the paste operation takes place in the front end:
By setting FrameMargins you make the button content area larger:
By setting ImageMargins you make the button area larger:
Use preset values:
Or use any values:
By setting the second element you can also control the height:
Set a fully custom size:
Make paste buttons for a collection of country strings:
Use to replace it with the current selection:
PasteButton is a special case of Button:
PasteButton does not evaluate its arguments on each click:
New in 6