🧪 Version 0.2.2 is our alpha release candidate. Please send us bug reports and suggestions!

Sketchingpy

Creative coding and interactive science everywhere for everyone: web, desktop, mobile, Jupyter, and more. Open source!

Reference for show_prompt

Ask the user to enter a string in a dialog box. This is part of the reference section.

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.

See also