Reference for show_prompt
Ask the user to enter a string in a dialog box. This is part of the reference section.
Arc
Buffer
Data
Dialog
show_prompt
Ellipse
Geo Utils
Image
Joystick (future)
Keyboard
Line
Mouse / Touchscreen
Pixel
Rectangle
Renderers
Shape
Sound (future)
Style
System
Text
Transform
Purpose
Show a message in a dialog box to the user with the option for the user to provide an input string via keyboard input.
Snippet
Request a string from the user and print the result.
sketch.get_dialog_layer().show_prompt('Enter text:', lambda x: print(x))
Parameters
- message: The message to display in the box. May be interpreted as HTML on some platforms.
- callback: Function to invoke if the user provides a string or clicks OK, calling a single string parameter.
Examples
Availability
Available for Sketch2DWeb and Sketch2DApp. For app, will try to interpret as HTML.