Skip to content

Commit c23b717

Browse files
committed
Document bind=None options
1 parent 6872692 commit c23b717

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

docs/VPythonDocs/controls.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,15 @@ <h1><font color="#0000A0">Widgets:
9696
<p class="attributes"> <span class="attribute">text</span> The text shown on the button. Can be changed at any time. The text can contain html directives. For example '&lt;b&gt;Run&lt;/b&gt;' will display 'Run' in bold.</p>
9797
<p class="attributes"> <span class="attribute">color</span> The color of the text shown on the button. Can be changed at any time.</p>
9898
<p class="attributes"> <span class="attribute">background</span> The background color of the button. Can be changed at any time.</p>
99-
<p class="attributes"> <font color="#FF0000">bind</font> The name of the function to be called when the button is clicked. Cannot be changed after creating the button.</p>
99+
<p class="attributes"> <font color="#FF0000">bind</font> The name of the function to be called when the button is clicked. Cannot be changed after creating the button. If you say B = button(text=YES', bind=None), then print(B.text) will display 'Yes', and if you then say B.text = 'NO', the text on the button will lchange to 'NO'. (Currently, setting bind=None gives an error when using VPython with installed Python.)</p>
100100
<p class="attributes"><font color="#FF0000">disabled</font> If True, the button text is grayed out and the button is inactive. Can be changed at any time.</p>
101101
<p class="attributes"><font color="#FF0000">delete()</font> If B is a button, B.delete() deletes the button from the display.</p>
102102
<p class="Normal"></p>
103103
<p class="Header"><strong><font color="#0000a0">radio</font></strong></p>
104104
<p class="Normal">Radio buttons are often used in a group of two or more, in which you arrange that only one is checked at any time. Here are the attributes of a <strong>radio</strong> widget (a radio button):</p>
105105
<p class="attributes"> <font color="#FF0000" class="attribute">pos</font> Position to which to append the widget (see &quot;Appending to anchor points&quot; below). Cannot be changed after creating the radio button. </p>
106106
<p class="attributes"><span class="attribute">text</span> The text shown one space to the right of the radio button. Can be changed at any time. The text can contain html directives. For example '&lt;b&gt;Run&lt;/b&gt;' will display 'Run' in bold. You may wish to add some spaces to the end of the text to separate the text from an adjacent widget.</p>
107-
<p class="attributes"> <font color="#FF0000">bind</font> The name of the function to be called when the radio button is clicked. Cannot be changed after creating the radio button.</p>
107+
<p class="attributes"> <font color="#FF0000">bind</font> The name of the function to be called when the radio button is clicked. Cannot be changed after creating the radio button. If you say R = radio(text=YES', bind=None), then print(R.text) will display 'Yes', and if you then say R.text = 'NO', the text on the radio button will lchange to 'NO'. (Currently, setting bind=None gives an error when using VPython with installed Python.)</p>
108108
<p class="attributes"><font color="#FF0000">checked</font> If True, the radio button is highlighted; default is False. Can be changed at any time.</p>
109109
<p class="attributes"><font color="#FF0000">disabled</font> If True, the radio button is grayed out and the radio button is inactive. Can be changed at any time.</p>
110110
<p class="attributes"><font color="#FF0000">delete()</font> If R is a radio button, R.delete() deletes the radio button from the display.</p>
@@ -114,7 +114,7 @@ <h1><font color="#0000A0">Widgets:
114114
<p class="Normal">Here are the attributes of a <strong>checkbox</strong> widget:</p>
115115
<p class="attributes"> <font color="#FF0000" class="attribute">pos</font> Position to which to append the widget (see &quot;Appending to anchor points&quot; below). Cannot be changed after creating the checkbox.</p>
116116
<p class="attributes"><span class="attribute">text</span> The text shown one space to the right of the checkbox. Can be changed at any time. The text can contain html directives. For example '&lt;b&gt;Run&lt;/b&gt;' will display 'Run' in bold. You may wish to add some spaces to the end of the text to separate the text from an adjacent widget.</p>
117-
<p class="attributes"> <font color="#FF0000">bind</font> The name of the function to be called when the checkbox is clicked. Cannot be changed after creating the checkbox.</p>
117+
<p class="attributes"> <font color="#FF0000">bind</font> The name of the function to be called when the checkbox is clicked. Cannot be changed after creating the checkbox. If you say C = checkbox(text=YES', bind=None), then print(C.text) will display 'YES', and if you then say C.text = 'NO', the text on the checkbox will lchange to 'NO'. (Currently, setting bind=None gives an error when using VPython with installed Python.)</p>
118118
<p class="attributes"><font color="#FF0000">checked</font> If True, the checkbox is highlighted; default is False. Can be changed at any time.</p>
119119
<p class="attributes"><font color="#FF0000">disabled</font> If True, the checkbox is grayed out and the checkbox is inactive. Can be changed at any time.</p>
120120
<p class="attributes"><font color="#FF0000">delete()</font> If C is a checkbox, C.delete() deletes the checkbox from the display.</p>
@@ -144,15 +144,15 @@ <h1><font color="#0000A0">Widgets:
144144
<p class="attributes"> <span class="attribute">choices</span> A list of strings to appear on the menu, such as ['cat', 'dog', 'horse']. Can be changed after creating the menu by specifying a new list of strings to replace the existing list.</p>
145145
<p class="attributes"><font color="#FF0000">selected</font> The chosen string, such as 'dog'. Can be set by program as well as by user choice. </p>
146146
<p class="attributes"><font color="#FF0000">index</font> The position of the chosen string in the choices list, starting from zero. Can be set by program as well as by user choice.</p>
147-
<p class="attributes"> <font color="#FF0000">bind</font> The name of the function to be called when a menu item is chosen. Cannot be changed after creating the menu.</p>
147+
<p class="attributes"> <font color="#FF0000">bind</font> The name of the function to be called when a menu item is chosen. Cannot be changed after creating the menu. If you say M = menu(choices=['dog', 'cat']', bind=None), then print(M.selected) will display 'dog', and if you then choose 'cat', print(M.selected) will display 'cat'. (Currently, setting bind=None gives an error when using VPython with installed Python.)</p>
148148
<p class="attributes"><font color="#FF0000">disabled</font> If True, the menu is grayed out and the menu is inactive. Can be changed at any time.</p>
149149
<p class="attributes"><font color="#FF0000">delete()</font> If M is a menu, M.delete() deletes the menu from the display.</p>
150150
<p class="Normal"></p>
151151
<p class="Header"><strong><font color="#0000a0">winput</font></strong></p>
152152
<p class="Normal">The <strong>winput</strong> object (widget input) displays a box in which the user can input a numeric expression or text. The user must select the text either by clicking in the box or by using the tab key. <em>A function bound to a winput object is executed if the user presses Enter or Tab or clicks somewhere other than in a VPython canvas (clicks in a canvas are handled separately).</em></p>
153153
<p class="attributes"> <font color="#FF0000" class="attribute">pos</font> Position to which to append the widget (see &quot;Appending to anchor points&quot; below). Cannot be changed after creating the object.</p>
154-
<p class="attributes"><font color="#FF0000" class="attribute">bind</font> The name of the function to be called when the user presses Enter. Cannot be changed after creating the object. In Web VPython, if no bind function is specified, a pop-up dialog box appears for the user to type some input; this no-bind version is not yet available with installed Python (VPython 7).</p>
155-
<p class="attributes"><font color="#FF0000" class="attribute">prompt</font> If bind is specified, the prompt text is displayed to the left of the input box, and this text is erased if the winput object is deleted. If no bind is specified, the prompt text is displayed above the place where the user types the input. This prompt option is not yet available with installed Python (VPython 7).</p>
154+
<p class="attributes"><font color="#FF0000" class="attribute">bind</font> The name of the function to be called when the user presses Enter. Cannot be changed after creating the object. In Web VPython, if no bind function is specified, a pop-up dialog box appears for the user to type some input; this no-bind version is not yet available with installed Python. If you say W = winput(bind=None), then enter '42' and press Enter while at a pause, print(W.text) will display '42', and if you then say W.text = '31', the text in the winput box will lchange to '31'.. (Currently, setting bind=None gives an error when using VPython with installed Python.)</p>
155+
<p class="attributes"><font color="#FF0000" class="attribute">prompt</font> If bind is specified, the prompt text is displayed to the left of the input box, and this text is erased if the winput object is deleted. If no bind is specified, the prompt text is displayed above the place where the user types the input. This prompt option is not yet available with installed Python..</p>
156156
<p class="attributes"> <font color="#FF0000" class="attribute">type</font> &quot;numeric&quot; (the default) or &quot;string&quot;. If it is numeric, the user can input expressions such as 3+2*sqrt(5.2e4). An error message is displayed if there is something wrong with the expression, and the bound function is not called. Cannot be changed after creating the object.</p>
157157
<p class="attributes"><font color="#FF0000" class="attribute">width</font> The width of the winput box in pixels; default is 100. Cannot be changed after creating the object.</p>
158158
<p class="attributes"> <font color="#FF0000" class="attribute">height</font> The height of the winput box in pixels; default is 20. Cannot be changed after creating the object.</p>

0 commit comments

Comments
 (0)